diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..aeb7cc5dc94 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,47 @@ +{ + "name": "OpenAPIGenerator", + "image": "mcr.microsoft.com/devcontainers/base:debian", + "features": { + "ghcr.io/devcontainers/features/java:1": { + "version": "11", + "installMaven": true + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "lts" + }, + "ghcr.io/snebjorn/devcontainer-feature/chromium:latest": {} + }, + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "java.configuration.runtimes": [ + { + "name": "JavaSE-11", + "path": "/usr/local/sdkman/candidates/java/11.0.16.1-ms", + "sources": "/usr/local/sdkman/candidates/java/11.0.16.1-ms/lib/src.zip", + "javadoc": "https://docs.oracle.com/en/java/javase/11/docs/api", + "default": true + } + ] + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "vscjava.vscode-java-pack", + "attilabuti.mustache-syntax-vscode", + "formulahendry.code-runner", + "visualstudioexptteam.vscodeintellicode", + "42crunch.vscode-openapi", + "mermade.openapi-lint" + ] + } + }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "mvn clean package -DskipTests", + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" +} diff --git a/.envrc b/.envrc new file mode 100644 index 00000000000..3550a30f2de --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.github/workflows/samples-cpp-qt-client.yaml b/.github/workflows/samples-cpp-qt-client.yaml index 2ef3fbc96a1..e1e6e4e5dc4 100644 --- a/.github/workflows/samples-cpp-qt-client.yaml +++ b/.github/workflows/samples-cpp-qt-client.yaml @@ -23,12 +23,16 @@ jobs: - ubuntu-latest - macOS-latest - windows-latest + include: + - os: windows-latest + tools: 'tools_openssl_x64' runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: jurplel/install-qt-action@v3 with: version: ${{ matrix.qt-version }} + tools: ${{ matrix.tools }} - name: Build working-directory: "samples/client/petstore/cpp-qt" - run: ./build-and-test.bash + run: cmake . && cmake --build . diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml index c345dad2829..ea2d5b6d2cc 100644 --- a/.github/workflows/samples-dotnet.yaml +++ b/.github/workflows/samples-dotnet.yaml @@ -7,12 +7,14 @@ on: - 'samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore**/' - 'samples/server/petstore/aspnetcore-6.0/**' - 'samples/server/petstore/aspnetcore-6.0-pocoModels/**' + - 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**' pull_request: paths: - 'samples/client/petstore/csharp-netcore/**net6.0**/' - 'samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore**/' - 'samples/server/petstore/aspnetcore-6.0/**' - 'samples/server/petstore/aspnetcore-6.0-pocoModels/**' + - 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**' jobs: build: name: Build .Net projects @@ -30,6 +32,7 @@ jobs: - samples/server/petstore/aspnetcore-6.0 - samples/server/petstore/aspnetcore-6.0-pocoModels - samples/server/petstore/aspnetcore-6.0-project4Models + - samples/server/petstore/aspnetcore-6.0-useSwashBuckle steps: - uses: actions/checkout@v3 - uses: actions/setup-dotnet@v3.0.3 diff --git a/.github/workflows/samples-go.yaml b/.github/workflows/samples-go.yaml index 73155482dcd..d279fb568d0 100644 --- a/.github/workflows/samples-go.yaml +++ b/.github/workflows/samples-go.yaml @@ -25,7 +25,7 @@ jobs: #- samples/server/petstore/go-chi-server/ steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: go-version: "stable" - run: go version diff --git a/.github/workflows/samples-java-client-jdk17.yaml b/.github/workflows/samples-java-client-jdk17.yaml index cb439e97603..0e4bbf2c3ae 100644 --- a/.github/workflows/samples-java-client-jdk17.yaml +++ b/.github/workflows/samples-java-client-jdk17.yaml @@ -34,6 +34,9 @@ jobs: path: | ~/.m2 key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - - name: Build + - name: Build with Maven working-directory: ${{ matrix.sample }} run: mvn clean package + - name: Build with Gradle + working-directory: ${{ matrix.sample }} + run: gradle clean build diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 8c51f45a8c0..0ba66f74a5e 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -22,26 +22,30 @@ jobs: - samples/openapi3/client/petstore/spring-cloud - samples/client/petstore/spring-cloud-date-time - samples/openapi3/client/petstore/spring-cloud-date-time - - samples/client/petstore/spring-stubs - samples/openapi3/client/petstore/spring-stubs - samples/openapi3/client/petstore/spring-stubs-skip-default-interface + - samples/openapi3/client/petstore/spring-cloud-async + - samples/openapi3/client/petstore/spring-cloud-spring-pageable # servers - samples/server/petstore/springboot - samples/openapi3/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-useoptional - - samples/openapi3/server/petstore/springboot-useoptional - samples/server/petstore/springboot-reactive - - samples/openapi3/server/petstore/springboot-reactive - samples/server/petstore/springboot-implicitHeaders - samples/openapi3/server/petstore/springboot-implicitHeaders - samples/server/petstore/springboot-delegate + - samples/server/petstore/springboot-delegate-no-response-entity - samples/openapi3/server/petstore/springboot-delegate - samples/server/petstore/spring-boot-nullable-set - samples/server/petstore/spring-boot-defaultInterface-unhandledException - samples/openapi3/server/petstore/spring-boot-oneof - samples/server/petstore/springboot-virtualan - samples/server/petstore/springboot-implicitHeaders-annotationLibrary + - samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8 + - samples/server/petstore/springboot-spring-pageable-delegatePattern + - samples/server/petstore/springboot-spring-pageable-without-j8 + - samples/server/petstore/springboot-spring-pageable steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/.gitignore b/.gitignore index c2192dfc5e2..38bf29180d1 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ packages/ nbproject/ nbactions.xml nb-configuration.xml +.direnv/ .settings diff --git a/.travis.yml b/.travis.yml index 3598d19172d..43975266388 100644 --- a/.travis.yml +++ b/.travis.yml @@ -150,14 +150,15 @@ script: - docker buildx version # run integration tests defined in maven pom.xml # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet. - - mvn -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error + # show "error" only to reduce the log size + - mvn -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error 2>&1 | grep -i error #- mvn -e --no-snapshot-updates --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error after_success: # push to maven repo - if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ]; then echo "Publishing from branch $TRAVIS_BRANCH"; - mvn clean deploy -DskipTests=true -B -U -P release --settings CI/settings.xml; + mvn clean deploy -DskipTests=true -B -U -P release --settings CI/settings.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error; echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; pushd .; cd modules/openapi-generator-gradle-plugin; @@ -166,7 +167,7 @@ after_success: popd; elif [ -z $TRAVIS_TAG ] && [[ "$TRAVIS_BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]]; then echo "Publishing from branch $TRAVIS_BRANCH"; - mvn clean deploy --settings CI/settings.xml; + mvn clean deploy --settings CI/settings.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error; echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; pushd .; cd modules/openapi-generator-gradle-plugin; diff --git a/README.md b/README.md index d51150914ab..04585139c8c 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,14 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`6.4.0`): -[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`6.6.0`): +[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/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) [![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) [7.0.x](https://github.com/OpenAPITools/openapi-generator/tree/7.0.x) (`7.0.x`): -[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/7.0.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) +[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/7.0.x.svg?label=Integration%20Test)](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/7.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=7.0.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) [![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/7.0.x?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) @@ -78,7 +78,7 @@ 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, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, 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, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 13.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | +| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, 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, MicroProfile Rest Client, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 15.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | | **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** ([rust-server](https://openapi-generator.tech/docs/generators/rust-server/)), **Scala** (Akka, [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**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | @@ -120,9 +120,9 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 | OpenAPI Generator Version | Release Date | Notes | | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- | -| 7.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.0-SNAPSHOT/) | Feb/Mar 2023 | Major release with breaking changes (no fallback) | -| 6.4.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.4.0-SNAPSHOT/) | 05.12.2022 | Minor release with breaking changes (with fallback) | -| [6.3.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.3.0) (latest stable release) | 01.02.2023 | Minor release with breaking changes (with fallback) | +| 7.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.0-SNAPSHOT/) | May/Jun 2023 | Major release with breaking changes (no fallback) | +| 6.6.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.5.0-SNAPSHOT/) | 28.04.2023 | Minor release with breaking changes (with fallback) | +| [6.5.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.5.0) (latest stable release) | 01.04.2023 | Minor release with breaking changes (with fallback) | | [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) | | [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) | @@ -182,16 +182,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o 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: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.5.0/openapi-generator-cli-6.5.0.jar` For **Mac/Linux** users: ```sh -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.5.0/openapi-generator-cli-6.5.0.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.5.0/openapi-generator-cli-6.5.0.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -263,6 +263,20 @@ If you don't have maven installed, you may directly use the included [maven wrap ./mvnw clean install ``` +#### Nix users + +If you're a nix user, you can enter OpenAPI Generator shell, by typing: +```sh +nix develop +``` +It will enter a shell with Java 8 and Maven installed. + +Direnv supports automatically loading of the nix developer shell, so if you're using direnv too, type: +```sh +direnv allow +``` +and have `java` and `mvn` set up with correct versions each time you enter project directory. + The default build contains minimal static analysis (via CheckStyle). To run your build with PMD and Spotbugs, use the `static-analysis` profile: ```sh @@ -416,7 +430,7 @@ openapi-generator-cli version To use a specific version of "openapi-generator-cli" ```sh -openapi-generator-cli version-manager set 6.3.0 +openapi-generator-cli version-manager set 6.5.0 ``` Or install it as dev-dependency: @@ -440,7 +454,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/3_0/petstore.yaml -g php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar) +You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.5.0/openapi-generator-cli-6.5.0.jar) To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` @@ -588,8 +602,9 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Angular.Schule](https://angular.schule/) - [Aqovia](https://aqovia.com/) - [Australia and New Zealand Banking Group (ANZ)](http://www.anz.com/) -- [ASKUL](https://www.askul.co.jp) - [Arduino](https://www.arduino.cc/) +- [ASKUL](https://www.askul.co.jp) +- [Amazon Web Services (AWS)](https://aws.amazon.com/) - [b<>com](https://b-com.com/en) - [百度营销](https://e.baidu.com) - [Bandwidth](https://dev.bandwidth.com) @@ -878,6 +893,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2022-04-06 - [Effective Software Development using OpenAPI Generator](https://apexlabs.ai/post/openapi-generator) by Ajil Oommen (Senior Flutter Developer) - 2022-05-13 - [A Path From an API To Client Libraries](https://www.youtube.com/watch?v=XC8oVn_efTw) by [Filip Srnec](https://www.devoxx.co.uk/talk/?id=11211) at Infobip - 2022-06-01 - [API First, using OpenAPI and Spring Boot](https://medium.com/xgeeks/api-first-using-openapi-and-spring-boot-2602c04bb0d3) by [Micael Estrázulas Vianna](https://estrazulas.medium.com/) +- 2022-06-12 - [Mustache templates with OpenAPI specs](https://medium.com/geekculture/mustache-templates-with-openapi-specs-f24711c67dec) by [Beppe Catanese](https://github.com/gcatanese) - 2022-07-01 - [Generate API contract using OpenAPI Generator Maven plugin](https://huongdanjava.com/generate-api-contract-using-openapi-generator-maven-plugin.html) by [Khanh Nguyen](https://huongdanjava.com/) - 2022-07-22 - [使用OpenAPI Generator Maven plugin开发api优先的java客户端和服务端代码](https://blog.roccoshi.top/2022/java/openapi-generator%E7%9A%84%E4%BD%BF%E7%94%A8/) by [Lincest](https://github.com/Lincest) - 2022-08-01 - [Tutorial: Etsy Open API v3 (ruby)](https://blog.tjoyal.dev/etsy-open-api-v3/) by [Thierry Joyal](https://github.com/tjoyal) @@ -889,6 +905,10 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2022-12-13 - [API-First with Spring WebFlux and OpenAPI Generator](https://boottechnologies-ci.medium.com/api-first-with-spring-webflux-and-openapi-generator-38b7804c4ed4) by [Eric Anicet](https://boottechnologies-ci.medium.com/) - 2023-01-06 - [Major Improvements with Helidon and OpenAPI](https://medium.com/helidon/major-improvements-with-helidon-and-openapi-f76a0951508e) by [Tim Quinn](https://medium.com/@tquinno600) - 2023-02-02 - [Replacing Postman with the Jetbrains HTTP Client](https://lengrand.fr/replacing-postman-in-seconds-with-the-jetbrains-http-client/) by [julien Lengrand-Lambert](https://github.com/jlengrand) +- 2023-03-15 - [OpenAPI Generatorに適したOpenAPIの書き方](https://techblog.zozo.com/entry/how-to-write-openapi-for-openapi-generator) by [ZOZO Tech Blog](https://techblog.zozo.com/) +- 2023-03-19 - [EXOGEM: Extending OpenAPI Generator for Monitoring of RESTful APIs](https://link.springer.com/chapter/10.1007/978-3-031-26507-5_10) by Daniel Friis Holtebo, Jannik Lucas Sommer, Magnus Mølgaard Lund, Alessandro Tibo, Junior Dongo & Michele Albano at "ICSOC 2022: Service-Oriented Computing – ICSOC 2022 Workshops" +- 2023-03-28 - [API-First Design with OpenAPI Generator](https://www.linkedin.com/pulse/api-first-design-openapi-generator-jonathan-manera/) by [Jonathan Manera](https://www.linkedin.com/in/manerajona/) +- 2023-03-28 - [ハンズオンで学ぶサーバーサイド Kotlin(Spring Boot&Arrow&OpenAPI Generator)v1.0.1](https://zenn.dev/msksgm/books/implementing-server-side-kotlin-development) by [msk](https://zenn.dev/msksgm) ## [6 - About Us](#table-of-contents) @@ -1016,6 +1036,7 @@ Here is a list of template creators: * Erlang Server: @galaxie * F# (Giraffe) Server: @nmfisher * Go Server: @guohuang + * Go Server (refactored in 7.0.0): @lwj5 * Go (Echo) Server: @ph4r5h4d * Go (Gin) Server: @kemokemo * GraphQL Express Server: @renepardon @@ -1120,7 +1141,7 @@ If you want to join the committee, please kindly apply by sending an email to te | Elm | @eriktim (2018/09) | | Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) | | F# | @nmfisher (2019/05) | -| Go | @antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @jirikuncar (2021/01) @ph4r5h4d (2021/04) | +| Go | @antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @jirikuncar (2021/01) @ph4r5h4d (2021/04) @lwj5 (2023/04) | | GraphQL | @renepardon (2018/12) | | Groovy | | | Haskell | | @@ -1230,3 +1251,4 @@ See the License for the specific language governing permissions and limitations under the License. --- + diff --git a/bin/configs/aspnetcore-6.0-useSwashBuckle.yaml b/bin/configs/aspnetcore-6.0-useSwashBuckle.yaml new file mode 100644 index 00000000000..e0e873e8ec4 --- /dev/null +++ b/bin/configs/aspnetcore-6.0-useSwashBuckle.yaml @@ -0,0 +1,11 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-6.0-useSwashBuckle +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "6.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + useSwashBuckle: false + buildTarget: library + isLibrary: true diff --git a/bin/configs/csharp-netcore-OpenAPIClient-net47.yaml b/bin/configs/csharp-netcore-OpenAPIClient-net47.yaml index 35e90e8db71..9ca276977a9 100644 --- a/bin/configs/csharp-netcore-OpenAPIClient-net47.yaml +++ b/bin/configs/csharp-netcore-OpenAPIClient-net47.yaml @@ -9,3 +9,4 @@ additionalProperties: disallowAdditionalPropertiesIfNotPresent: false useOneOfDiscriminatorLookup: true targetFramework: net47 + skipOneOfAnyOfGetter: true diff --git a/bin/configs/csharp-netcore-OpenAPIClient-unityWebRequest.yaml b/bin/configs/csharp-netcore-OpenAPIClient-unityWebRequest.yaml new file mode 100644 index 00000000000..b65bdf593f9 --- /dev/null +++ b/bin/configs/csharp-netcore-OpenAPIClient-unityWebRequest.yaml @@ -0,0 +1,6 @@ +# for .net Unity +generatorName: csharp-netcore +outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +library: unityWebRequest \ No newline at end of file diff --git a/bin/configs/unmaintained/erlang-client.yaml b/bin/configs/erlang-client.yaml similarity index 100% rename from bin/configs/unmaintained/erlang-client.yaml rename to bin/configs/erlang-client.yaml diff --git a/bin/configs/unmaintained/erlang-proper.yaml b/bin/configs/erlang-proper.yaml similarity index 100% rename from bin/configs/unmaintained/erlang-proper.yaml rename to bin/configs/erlang-proper.yaml diff --git a/bin/configs/jaxrs-cxf-cdi.yaml b/bin/configs/jaxrs-cxf-cdi.yaml index 63299c1d4e9..83b548e0e25 100644 --- a/bin/configs/jaxrs-cxf-cdi.yaml +++ b/bin/configs/jaxrs-cxf-cdi.yaml @@ -1,6 +1,6 @@ generatorName: jaxrs-cxf-cdi outputDir: samples/server/petstore/jaxrs-cxf-cdi -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/jaxrs/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi additionalProperties: hideGenerationTimestamp: "true" diff --git a/bin/configs/jaxrs-spec-required-and-readonly-property.yaml b/bin/configs/jaxrs-spec-required-and-readonly-property.yaml new file mode 100644 index 00000000000..c6a1f257385 --- /dev/null +++ b/bin/configs/jaxrs-spec-required-and-readonly-property.yaml @@ -0,0 +1,10 @@ +generatorName: jaxrs-spec +outputDir: samples/server/petstore/jaxrs-spec-required-and-readonly-property +inputSpec: modules/openapi-generator/src/test/resources/3_0/required-and-readonly-property.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec +additionalProperties: + artifactId: jaxrs-spec-petstore-server + serializableModel: "true" + hideGenerationTimestamp: "true" + implicitHeadersRegex: (api_key|enum_header_string) + generateBuilders: "true" diff --git a/bin/configs/python-nextgen-aiohttp.yaml b/bin/configs/python-nextgen-aiohttp.yaml index b211652bf57..991d18a620e 100644 --- a/bin/configs/python-nextgen-aiohttp.yaml +++ b/bin/configs/python-nextgen-aiohttp.yaml @@ -5,4 +5,4 @@ templateDir: modules/openapi-generator/src/main/resources/python-nextgen library: asyncio additionalProperties: packageName: petstore_api - floatStrictType: false + mapNumberTo: float diff --git a/bin/configs/python-nextgen-echo-api.yaml b/bin/configs/python-nextgen-echo-api.yaml index 47dd5fa3ba5..b9eb1f91416 100644 --- a/bin/configs/python-nextgen-echo-api.yaml +++ b/bin/configs/python-nextgen-echo-api.yaml @@ -4,4 +4,3 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml templateDir: modules/openapi-generator/src/main/resources/python-nextgen additionalProperties: hideGenerationTimestamp: "true" - allowStringInDateTimeParameters: true diff --git a/bin/configs/python-nextgen.yaml b/bin/configs/python-nextgen.yaml index c2c09ee0147..c3636e22a5d 100644 --- a/bin/configs/python-nextgen.yaml +++ b/bin/configs/python-nextgen.yaml @@ -6,3 +6,4 @@ additionalProperties: packageName: petstore_api useOneOfDiscriminatorLookup: "true" disallowAdditionalPropertiesIfNotPresent: false + mapNumberTo: StrictFloat diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml deleted file mode 100644 index b1e5245ae85..00000000000 --- a/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml +++ /dev/null @@ -1,13 +0,0 @@ -generatorName: spring -outputDir: samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable -library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - groupId: org.openapitools.openapi3 - documentationProvider: springdoc - java8: "false" - useBeanValidation: true - artifactId: spring-boot-beanvalidation-no-nullable - hideGenerationTimestamp: "true" - openApiNullable: "false" diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml index 1457469bc72..718b0a87e9d 100644 --- a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml +++ b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml @@ -1,9 +1,10 @@ generatorName: spring outputDir: samples/server/petstore/springboot-beanvalidation-no-nullable library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + groupId: org.openapitools.openapi3 documentationProvider: springfox java8: "false" useBeanValidation: true diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml index 4a5daef5845..b43f22721a1 100644 --- a/bin/configs/spring-boot-beanvalidation.yaml +++ b/bin/configs/spring-boot-beanvalidation.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-beanvalidation library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/spring-boot-defaultInterface-unhandledException.yaml b/bin/configs/spring-boot-defaultInterface-unhandledException.yaml index 3d492c12f76..9e096062883 100644 --- a/bin/configs/spring-boot-defaultInterface-unhandledException.yaml +++ b/bin/configs/spring-boot-defaultInterface-unhandledException.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/spring-boot-defaultInterface-unhandledException -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: spring-boot-defaultInterface-unhandledException diff --git a/bin/configs/spring-boot-delegate-j8.yaml b/bin/configs/spring-boot-delegate-j8.yaml index e1fae5805cd..be11dd0dec0 100644 --- a/bin/configs/spring-boot-delegate-j8.yaml +++ b/bin/configs/spring-boot-delegate-j8.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/springboot-delegate-j8 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/spring-boot-delegate-no-response-entity.yaml b/bin/configs/spring-boot-delegate-no-response-entity.yaml new file mode 100644 index 00000000000..f8b5cdd3c35 --- /dev/null +++ b/bin/configs/spring-boot-delegate-no-response-entity.yaml @@ -0,0 +1,11 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-delegate-no-response-entity +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + documentationProvider: springfox + artifactId: springboot-delegate-no-response-entity + hideGenerationTimestamp: "true" + java8: true + delegatePattern: "true" + useResponseEntity: "false" diff --git a/bin/configs/spring-boot-delegate-oas3.yaml b/bin/configs/spring-boot-delegate-oas3.yaml index 8b604d558a9..28ba653ad08 100644 --- a/bin/configs/spring-boot-delegate-oas3.yaml +++ b/bin/configs/spring-boot-delegate-oas3.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-delegate -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml index 228b14d823e..56199a182d1 100644 --- a/bin/configs/spring-boot-delegate.yaml +++ b/bin/configs/spring-boot-delegate.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/springboot-delegate -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/spring-boot-implicitHeaders-oas3.yaml b/bin/configs/spring-boot-implicitHeaders-oas3.yaml index 3d9423cd326..6d204b53c55 100644 --- a/bin/configs/spring-boot-implicitHeaders-oas3.yaml +++ b/bin/configs/spring-boot-implicitHeaders-oas3.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-implicitHeaders -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-boot-implicitHeaders.yaml b/bin/configs/spring-boot-implicitHeaders.yaml index d870353a0ff..b9a1a81c146 100644 --- a/bin/configs/spring-boot-implicitHeaders.yaml +++ b/bin/configs/spring-boot-implicitHeaders.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/springboot-implicitHeaders -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: springboot-implicitHeaders diff --git a/bin/configs/spring-boot-reactive-oas3.yaml b/bin/configs/spring-boot-reactive-oas3.yaml deleted file mode 100644 index 3e3fb91657b..00000000000 --- a/bin/configs/spring-boot-reactive-oas3.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: spring -outputDir: samples/openapi3/server/petstore/springboot-reactive -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - groupId: org.openapitools.openapi3 - documentationProvider: springdoc - artifactId: springboot-reactive - reactive: "true" - hideGenerationTimestamp: "true" - delegatePattern: "true" diff --git a/bin/configs/spring-boot-reactive.yaml b/bin/configs/spring-boot-reactive.yaml index b3edff7de11..ed5a1e56239 100644 --- a/bin/configs/spring-boot-reactive.yaml +++ b/bin/configs/spring-boot-reactive.yaml @@ -1,8 +1,9 @@ generatorName: spring outputDir: samples/server/petstore/springboot-reactive -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + groupId: org.openapitools.openapi3 artifactId: springboot-reactive documentationProvider: springfox reactive: "true" diff --git a/bin/configs/spring-boot-useoptional-oas3.yaml b/bin/configs/spring-boot-useoptional-oas3.yaml deleted file mode 100644 index ac66d1df148..00000000000 --- a/bin/configs/spring-boot-useoptional-oas3.yaml +++ /dev/null @@ -1,10 +0,0 @@ -generatorName: spring -outputDir: samples/openapi3/server/petstore/springboot-useoptional -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - groupId: org.openapitools.openapi3 - documentationProvider: springdoc - useOptional: true - artifactId: spring-boot-useoptional - hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml index 1e028977898..2b3dbdc1a86 100644 --- a/bin/configs/spring-boot-useoptional.yaml +++ b/bin/configs/spring-boot-useoptional.yaml @@ -1,8 +1,9 @@ generatorName: spring outputDir: samples/server/petstore/springboot-useoptional -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + groupId: org.openapitools.openapi3 documentationProvider: springfox useOptional: true artifactId: spring-boot-useoptional diff --git a/bin/configs/spring-boot-virtualan.yaml b/bin/configs/spring-boot-virtualan.yaml index f1ae90fa859..87a2e30fb91 100644 --- a/bin/configs/spring-boot-virtualan.yaml +++ b/bin/configs/spring-boot-virtualan.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-virtualan library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springdoc diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml index 8d3e101cead..3480d1ba174 100644 --- a/bin/configs/spring-boot.yaml +++ b/bin/configs/spring-boot.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/springboot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/spring-cloud-async-oas3.yaml b/bin/configs/spring-cloud-async-oas3.yaml index 59c9d22e695..01e4dc6ce4d 100644 --- a/bin/configs/spring-cloud-async-oas3.yaml +++ b/bin/configs/spring-cloud-async-oas3.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/openapi3/client/petstore/spring-cloud-async library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-cloud-async.yaml b/bin/configs/spring-cloud-async.yaml deleted file mode 100644 index b14f654366f..00000000000 --- a/bin/configs/spring-cloud-async.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: spring -outputDir: samples/client/petstore/spring-cloud-async -library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - async: "true" - java8: "true" - artifactId: petstore-spring-cloud - hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-cloud-oas3-fakeapi.yaml b/bin/configs/spring-cloud-oas3-fakeapi.yaml index 3f4e3c8ba3a..810aeff5997 100644 --- a/bin/configs/spring-cloud-oas3-fakeapi.yaml +++ b/bin/configs/spring-cloud-oas3-fakeapi.yaml @@ -1,7 +1,7 @@ generatorName: spring library: spring-cloud outputDir: samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 @@ -10,3 +10,4 @@ additionalProperties: interfaceOnly: "true" singleContentTypes: "true" hideGenerationTimestamp: "true" + generatedConstructorWithRequiredArgs: "false" diff --git a/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml b/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml index 02c96627b64..b130111f0e0 100644 --- a/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml +++ b/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/openapi3/client/petstore/spring-cloud-spring-pageable library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-cloud-petstore-feign-spring-pageable.yaml b/bin/configs/spring-cloud-petstore-feign-spring-pageable.yaml deleted file mode 100644 index 506a1c53be6..00000000000 --- a/bin/configs/spring-cloud-petstore-feign-spring-pageable.yaml +++ /dev/null @@ -1,9 +0,0 @@ -generatorName: spring -outputDir: samples/client/petstore/spring-cloud-spring-pageable -library: spring-cloud -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - artifactId: spring-cloud-spring-pageable - hideGenerationTimestamp: 'true' diff --git a/bin/configs/spring-http-interface-reactive.yaml b/bin/configs/spring-http-interface-reactive.yaml index 749d6fbf08d..d3cbf25f547 100644 --- a/bin/configs/spring-http-interface-reactive.yaml +++ b/bin/configs/spring-http-interface-reactive.yaml @@ -1,7 +1,7 @@ generatorName: spring library: spring-http-interface outputDir: samples/client/petstore/spring-http-interface-reactive -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: spring-http-interface-reactive diff --git a/bin/configs/spring-http-interface.yaml b/bin/configs/spring-http-interface.yaml index a5cf6c2d7cc..39cfec2307f 100644 --- a/bin/configs/spring-http-interface.yaml +++ b/bin/configs/spring-http-interface.yaml @@ -1,10 +1,11 @@ generatorName: spring library: spring-http-interface outputDir: samples/client/petstore/spring-http-interface -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: spring-http-interface snapshotVersion: "true" hideGenerationTimestamp: "true" modelNameSuffix: 'Dto' + generatedConstructorWithRequiredArgs: "false" diff --git a/bin/configs/spring-stubs-oas3.yaml b/bin/configs/spring-stubs-oas3.yaml index d5149f28adc..c37ba7e3c3c 100644 --- a/bin/configs/spring-stubs-oas3.yaml +++ b/bin/configs/spring-stubs-oas3.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/openapi3/client/petstore/spring-stubs -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-stubs-skip-default-interface.yaml b/bin/configs/spring-stubs-skip-default-interface.yaml index bb107e0bd2a..43d4dd08089 100644 --- a/bin/configs/spring-stubs-skip-default-interface.yaml +++ b/bin/configs/spring-stubs-skip-default-interface.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/openapi3/client/petstore/spring-stubs-skip-default-interface -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-stubs.yaml b/bin/configs/spring-stubs.yaml deleted file mode 100644 index 349c5e229c7..00000000000 --- a/bin/configs/spring-stubs.yaml +++ /dev/null @@ -1,10 +0,0 @@ -generatorName: spring -outputDir: samples/server/petstore/spring-stubs -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - documentationProvider: springfox - artifactId: spring-stubs - interfaceOnly: "true" - singleContentTypes: "true" - hideGenerationTimestamp: "true" diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml index 7d16b4a1e76..7716066d45e 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8 library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring delegatePattern: true java8: false diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml index 6cb1ca4b9cc..4060de18878 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-spring-pageable-delegatePattern library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring delegatePattern: true additionalProperties: diff --git a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml index 87c63968490..bbfb4e85312 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-spring-pageable-without-j8 library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring java8: false additionalProperties: diff --git a/bin/configs/springboot-petstore-server-spring-pageable.yaml b/bin/configs/springboot-petstore-server-spring-pageable.yaml index 2f4e88ed812..5ba08260299 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-spring-pageable library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/swift5-any-codable.yaml b/bin/configs/swift5-any-codable.yaml new file mode 100644 index 00000000000..62031951b9e --- /dev/null +++ b/bin/configs/swift5-any-codable.yaml @@ -0,0 +1,10 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/anycodable +inputSpec: modules/openapi-generator/src/test/resources/3_0/any_codable.yaml +modelNamePrefix: Prefix +modelNameSuffix: Suffix +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator \ No newline at end of file diff --git a/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml b/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml deleted file mode 100644 index 76c07c772d6..00000000000 --- a/bin/configs/unmaintained/csharp-dotnet2-OpenAPIClient.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: csharp-dotnet2 -outputDir: samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-dotnet2 -additionalProperties: - hideGenerationTimestamp: "true" diff --git a/docs/customization.md b/docs/customization.md index f9be18ff07f..e79cb471e63 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -216,7 +216,7 @@ These options default to true and don't limit the generation of the feature opti When using selective generation, _only_ the templates needed for the specific generation will be used. -To skip models defined as the form parameters in "requestBody", please use `skipFormModel` (default to `true`) (this option is introduced at v3.2.2 and `true` by default starting from v5.x). +To skip models defined as the form parameters in "requestBody", please use `skipFormModel` (default to `true`) (this option is introduced at v3.2.2 and `true` by default starting from v5.0.0). ```sh --global-property skipFormModel=true @@ -458,7 +458,6 @@ OpenAPI Normalizer (off by default) transforms the input OpenAPI doc/spec (which - `REF_AS_PARENT_IN_ALLOF`: when set to `true`, child schemas in `allOf` is considered a parent if it's a `$ref` (instead of inline schema). - Example: ``` java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml -o /tmp/java-okhttp/ --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true @@ -485,7 +484,7 @@ Example: java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/simplifyBooleanEnum_test.yaml -o /tmp/java-okhttp/ --openapi-normalizer SIMPLIFY_BOOLEAN_ENUM=true ``` -- `SIMPLIFY_ONEOF_ANYOF`: when set to `true`, simplify oneOf/anyOf by 1) removing null (sub-schema) and setting nullable to true instead, and 2) simplifying oneOf/anyOf with a single sub-schema to just the sub-schema itself. +- `SIMPLIFY_ONEOF_ANYOF`: when set to `true`, simplify oneOf/anyOf by 1) removing null (sub-schema) or enum of null (sub-schema) and setting nullable to true instead, and 2) simplifying oneOf/anyOf with a single sub-schema to just the sub-schema itself. Example: ``` @@ -505,3 +504,18 @@ Example: ``` java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml -o /tmp/java-okhttp/ --openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=true ``` + +- `ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE`: when set to true, auto fix integer with maximum value 4294967295 (2^32-1) or long with 18446744073709551615 (2^64-1) by adding x-unsigned to the schema + +Example: +``` +java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/addUnsignedToIntegerWithInvalidMaxValue_test.yaml -o /tmp/java-okhttp/ --openapi-normalizer ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE=true +``` + +- `REFACTOR_ALLOF_WITH_PROPERTIES_ONLY`: When set to true, refactor schema with allOf and properties in the same level to a schema with allOf only and, the allOf contains a new schema containing the properties in the top level. + +Example: +``` +java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml -o /tmp/java-okhttp/ --openapi-normalizer REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true +``` + diff --git a/docs/generators.md b/docs/generators.md index a21693e18e0..2596227ea37 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -19,7 +19,6 @@ The following generators are available: * [cpp-ue4 (beta)](generators/cpp-ue4.md) * [crystal (beta)](generators/crystal.md) * [csharp](generators/csharp.md) -* [csharp-dotnet2 (deprecated)](generators/csharp-dotnet2.md) * [csharp-netcore](generators/csharp-netcore.md) * [dart](generators/dart.md) * [dart-dio](generators/dart-dio.md) diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index 4a7ba7d2829..981232aca6d 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |httpSupport|The name of the HTTP support library. Possible values include 'curl' or 'aws'.| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |openApiName|The name of the Ada package which provides support for OpenAPI for the generated client and server code. The default is 'Swagger'.| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| diff --git a/docs/generators/ada.md b/docs/generators/ada.md index fa9bb262489..a96c449a244 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |httpSupport|The name of the HTTP support library. Possible values include 'curl' or 'aws'.| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |openApiName|The name of the Ada package which provides support for OpenAPI for the generated client and server code. The default is 'Swagger'.| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| diff --git a/docs/generators/android.md b/docs/generators/android.md index 2a5cfe46fe3..5b4bebc408e 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |groupId|groupId for use in the generated build.gradle and pom.xml| |null| |invokerPackage|root package for generated code| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |library|library template (sub-template) to use|
**volley**
HTTP client: Volley 1.0.19 (default)
**httpclient**
HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be deprecated in the next major release.
|null| |modelPackage|package for generated models| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index 40f0a5f3780..46c32f36611 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/apex.md b/docs/generators/apex.md index b1f506ef03a..521e492c35b 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |namedCredential|The named credential name for the HTTP callouts| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index 6b33e759222..f70a727ca4f 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| |invokerPackage|root package for generated code| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index ed22b580275..a5792b6757c 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -105,6 +105,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • long
  • long?
  • string
  • +
  • uint
  • +
  • uint?
  • +
  • ulong
  • +
  • ulong?
  • ## RESERVED WORDS diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index 4b6691d01e9..57ba424261c 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |packageName|package for generated classes (where supported)| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/bash.md b/docs/generators/bash.md index 50bffabc718..c48b6707f83 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateBashCompletion|Whether to generate the Bash completion script| |false| |generateZshCompletion|Whether to generate the Zsh completion script| |false| |hostEnvironmentVariable|Name of environment variable where host can be defined (e.g. PETSTORE_HOST='http://api.openapitools.org:8080')| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |processMarkdown|Convert all Markdown Markup into terminal formatting| |false| |scriptName|The name of the script that will be generated (e.g. petstore-cli)| |null| diff --git a/docs/generators/c.md b/docs/generators/c.md index fa2154d22eb..693f0962774 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index 88f2778755d..98b41478673 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null| |projectLicenseName|name of the license the project uses (Default: using info.license.name or not included in project.clj)| |null| diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index 09d65c8ea42..273f3e60bbc 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |optionalProjectFile|Generate client.pri.| |true| |packageName|C++ package (library) name.| |QtOpenAPIClient| diff --git a/docs/generators/cpp-qt-qhttpengine-server.md b/docs/generators/cpp-qt-qhttpengine-server.md index 419bf965dfa..5dee3e0a024 100644 --- a/docs/generators/cpp-qt-qhttpengine-server.md +++ b/docs/generators/cpp-qt-qhttpengine-server.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| diff --git a/docs/generators/cpp-tiny.md b/docs/generators/cpp-tiny.md index e292cffecc9..35381b175e8 100644 --- a/docs/generators/cpp-tiny.md +++ b/docs/generators/cpp-tiny.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index 1759a8e0693..a61e10f3bd5 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md index d80c179ff81..430558ba9e2 100644 --- a/docs/generators/cpp-ue4.md +++ b/docs/generators/cpp-ue4.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |optionalProjectFile|Generate Build.cs| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index 1f3bc4a655f..9040a07f211 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |moduleName|module name (e.g. TwitterClient| |OpenAPIClient| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |shardAuthor|shard author (only one is supported).| |null| diff --git a/docs/generators/csharp-dotnet2.md b/docs/generators/csharp-dotnet2.md deleted file mode 100644 index 5e4c904382c..00000000000 --- a/docs/generators/csharp-dotnet2.md +++ /dev/null @@ -1,293 +0,0 @@ ---- -title: Documentation for the csharp-dotnet2 Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | csharp-dotnet2 | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | CLIENT | | -| generator language | C# | | -| generator default templating engine | mustache | | -| helpTxt | Generates a C# .Net 2.0 client library (beta). | | - -## CONFIG OPTIONS -These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|clientPackage|C# client package name (convention: Camel.Case).| |Org.OpenAPITools.Client| -|packageName|C# package name (convention: Camel.Case).| |Org.OpenAPITools| -|packageVersion|C# package version.| |1.0.0| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | -|array|List| -|list|List| -|map|Dictionary| - - -## LANGUAGE PRIMITIVES - - - -## RESERVED WORDS - - - -## FEATURE SET - - -### Client Modification Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasePath|✗|ToolingExtension -|Authorizations|✗|ToolingExtension -|UserAgent|✗|ToolingExtension -|MockServer|✗|ToolingExtension - -### Data Type Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Custom|✗|OAS2,OAS3 -|Int32|✓|OAS2,OAS3 -|Int64|✓|OAS2,OAS3 -|Float|✓|OAS2,OAS3 -|Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension -|String|✓|OAS2,OAS3 -|Byte|✓|OAS2,OAS3 -|Binary|✓|OAS2,OAS3 -|Boolean|✓|OAS2,OAS3 -|Date|✓|OAS2,OAS3 -|DateTime|✓|OAS2,OAS3 -|Password|✓|OAS2,OAS3 -|File|✓|OAS2 -|Uuid|✗| -|Array|✓|OAS2,OAS3 -|Null|✗|OAS3 -|AnyType|✗|OAS2,OAS3 -|Object|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 -|Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension - -### Documentation Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Readme|✓|ToolingExtension -|Model|✓|ToolingExtension -|Api|✓|ToolingExtension - -### Global Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 -|Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✗|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✓|OAS3 -|LinkObjects|✗|OAS3 - -### Parameter Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✓|OAS3 - -### Schema Support Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✓|OAS2,OAS3 -|Union|✗|OAS3 -|allOf|✗|OAS2,OAS3 -|anyOf|✗|OAS3 -|oneOf|✗|OAS3 -|not|✗|OAS3 - -### Security Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 -|ApiKey|✓|OAS2,OAS3 -|OpenIDConnect|✗|OAS3 -|BearerToken|✓|OAS3 -|OAuth2_Implicit|✓|OAS2,OAS3 -|OAuth2_Password|✓|OAS2,OAS3 -|OAuth2_ClientCredentials|✓|OAS2,OAS3 -|OAuth2_AuthorizationCode|✓|OAS2,OAS3 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✓|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/csharp-netcore-functions.md b/docs/generators/csharp-netcore-functions.md index a5b638c5127..49b53ed219d 100644 --- a/docs/generators/csharp-netcore-functions.md +++ b/docs/generators/csharp-netcore-functions.md @@ -98,6 +98,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • long
  • long?
  • string
  • +
  • uint
  • +
  • uint?
  • +
  • ulong
  • +
  • ulong?
  • ## RESERVED WORDS diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 8f929b158ea..9a00c412d14 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -22,10 +22,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiName|Must be a valid C# class name. Only used in Generic Host library. Default: Api| |Api| |caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| |conditionalSerialization|Serialize only those properties which are initialized by user, accepted values are true or false, default value is false.| |false| +|dateFormat|The default Date format (only `generichost` library supports this option).| |yyyy'-'MM'-'dd| +|dateTimeFormat|The default DateTime format (only `generichost` library supports this option).| |yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I| -|library|HTTP library template (sub-template) to use|
    **generichost**
    HttpClient with Generic Host dependency injection (https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host) (Experimental. Subject to breaking changes without notice.)
    **httpclient**
    HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. Subject to breaking changes without notice.)
    **restsharp**
    RestSharp (https://github.com/restsharp/RestSharp)
    |restsharp| +|library|HTTP library template (sub-template) to use|
    **generichost**
    HttpClient with Generic Host dependency injection (https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host) (Experimental. Subject to breaking changes without notice.)
    **httpclient**
    HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. Subject to breaking changes without notice.)
    **unityWebRequest**
    UnityWebRequest (...) (Experimental. Subject to breaking changes without notice.)
    **restsharp**
    RestSharp (https://github.com/restsharp/RestSharp)
    |restsharp| |licenseId|The identifier of the license| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| |netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| @@ -41,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |packageVersion|C# package version.| |1.0.0| |releaseNote|Release note, default to 'Minor update'.| |Minor update| |returnICollection|Return ICollection<T> instead of the concrete type.| |false| +|skipOneOfAnyOfGetter|Skip the generation of getter for sub-schemas in oneOf/anyOf models.| |false| |sourceFolder|source folder for generated code| |src| |targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|
    **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
    **netstandard2.1**
    .NET Standard 2.1 compatible
    **netcoreapp3.1**
    .NET Core 3.1 compatible (End of Support 13 Dec 2022)
    **net47**
    .NET Framework 4.7 compatible
    **net48**
    .NET Framework 4.8 compatible
    **net6.0**
    .NET 6.0 compatible
    **net7.0**
    .NET 7.0 compatible
    |netstandard2.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| @@ -99,6 +102,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • long
  • long?
  • string
  • +
  • uint
  • +
  • uint?
  • +
  • ulong
  • +
  • ulong?
  • ## RESERVED WORDS diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index 59b874beb44..2dff47951a6 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -93,6 +93,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • long
  • long?
  • string
  • +
  • uint
  • +
  • uint?
  • +
  • ulong
  • +
  • ulong?
  • ## RESERVED WORDS diff --git a/docs/generators/cwiki.md b/docs/generators/cwiki.md index c7be7280e65..01f6ef8d55d 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -29,7 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| |invokerPackage|root package for generated code| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 486f4d5b782..4dca343c035 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |Author| |pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage| diff --git a/docs/generators/dart.md b/docs/generators/dart.md index cbc19071638..0d9bf111580 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |Author| |pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage| diff --git a/docs/generators/dynamic-html.md b/docs/generators/dynamic-html.md index cdb4ef80cd7..d8f466eb329 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |groupId|groupId in generated pom.xml| |null| |invokerPackage|root package for generated code| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index e6aae929e43..14209200122 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay.Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseHeader|The license header to prepend to the top of all source files.| |null| |packageName|Elixir package name (convention: lowercase).| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index b2961189bed..9f462fcad80 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |NoLicense| |licenseUrl|The URL of the license| |http://localhost| |packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI| diff --git a/docs/generators/go.md b/docs/generators/go.md index f99ca5e9fbf..3295fc5413f 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -218,7 +218,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |BasicAuth|✓|OAS2,OAS3 |ApiKey|✓|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✗|OAS3 +|BearerToken|✓|OAS3 |OAuth2_Implicit|✓|OAS2,OAS3 |OAuth2_Password|✗|OAS2,OAS3 |OAuth2_ClientCredentials|✗|OAS2,OAS3 diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 6fb7665f64d..96d30afd73c 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -46,7 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index 08e1738d3d6..8cd97834f6f 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -39,7 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateModelConstructors|Generate smart constructors (only supply required fields) for models| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |inlineMimeTypes|Inline (hardcode) the content-type and accept parameters on operations, when there is only 1 option| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelDeriving|Additional classes to include in the deriving() clause of Models| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |queryExtraUnreserved|Configures additional querystring characters which must not be URI encoded, e.g. '+' or ':'| |null| diff --git a/docs/generators/haskell-yesod.md b/docs/generators/haskell-yesod.md index 89540052792..d84dda4cee8 100644 --- a/docs/generators/haskell-yesod.md +++ b/docs/generators/haskell-yesod.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|name of the project (Default: generated from info.title or "openapi-haskell-yesod-server")| |null| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index 59cef6a6bde..a7bc269ed0d 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serveStatic|serve will serve files from the directory 'static'.| |true| diff --git a/docs/generators/html.md b/docs/generators/html.md index ee3d6caa564..c30e0ece496 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -29,7 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| |invokerPackage|root package for generated code| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/html2.md b/docs/generators/html2.md index d83c97311d5..3ff67ecd853 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -29,7 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| |invokerPackage|root package for generated code| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| |packageName|C# package name| |null| diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index f61b5630e83..e53dd2a92ce 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -56,6 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| @@ -64,7 +65,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template)|
    **spring-boot**
    Spring-boot Server application.
    **spring-cloud**
    Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
    **spring-http-interface**
    Spring 6 HTTP interfaces (testing)
    |spring-boot| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| @@ -96,6 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useFeignClientUrl|Whether to generate Feign client with url parameter.| |true| |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useOptional|Use Optional container for optional parameters| |false| +|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true| |useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false| |useSpringController|Annotate the generated API as a Spring Controller| |false| |useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md index 485eb65eac1..d5a6aeaf3ac 100644 --- a/docs/generators/java-helidon-client.md +++ b/docs/generators/java-helidon-client.md @@ -46,7 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.client| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template) to use|
    **mp**
    Helidon MP Client
    **se**
    Helidon SE Client
    |mp| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md index 276a7ebc863..793fe5ba68f 100644 --- a/docs/generators/java-helidon-server.md +++ b/docs/generators/java-helidon-server.md @@ -46,7 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.server| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template) to use|
    **mp**
    Helidon MP Server
    **se**
    Helidon SE Server
    **nima**
    Helidon NIMA Server
    **nima-annotations**
    Helidon NIMA Annotations Server
    |se| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index d1d6d4ae89f..2cd610b6ead 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.controllers| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 2d5e5585050..8fc1e6f41d7 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -29,10 +29,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-micronaut-client| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|authorizationFilterPattern|Configure the authorization filter pattern for the client. Generally defined when generating clients from multiple specification files| |null| +|basePathSeparator|Configure the separator to use between the application name and base path when referencing the property| |-| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| |build|Specify for which build tool to generate files|
    **gradle**
    Gradle configuration is generated for the project
    **all**
    Both Gradle and Maven configurations are generated
    **maven**
    Maven configuration is generated for the project
    |all| |camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| +|clientId|Configure the service ID for the Client| |null| |configureAuth|Configure all the authorization methods as specified in the file| |false| |containerDefaultToNull|Set containers (array, set, map) default to null| |false| |dateFormat|Specify the format pattern of date as a string| |null| @@ -56,7 +59,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.4.3| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index 5aecff1e6a0..043552d6a98 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -57,7 +57,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.4.3| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 7d4532cab34..307fb0dbecf 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -49,7 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template)|
    **jersey1**
    Jersey core 1.x
    **jersey2**
    Jersey core 2.x
    |jersey2| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 0a5ee14c224..9a598a78627 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -50,7 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |com.prokarma.pkmst.controller| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |com.prokarma.pkmst.model| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index e41abb5b575..8bd602c41cf 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -52,7 +52,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |apimodels| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index a4a74abd19a..678b683ec81 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.handler| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |null| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 93f60ef39ca..99aac21f25b 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.vertxweb.server| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.vertxweb.server.model| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 063da873d5b..4961536ce7b 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.server.api.model| diff --git a/docs/generators/java.md b/docs/generators/java.md index 55bc644c86b..4579c86a538 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.client| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey3' or other HTTP libraries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **jersey3**
    HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
    **feign**
    HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x. or Gson 2.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'.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.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.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 1.x. JSON processing: JSON-B or Jackson 2.9.x
    **apache-httpclient**
    HTTP client: Apache httpclient 5.x
    |okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/javascript-apollo-deprecated.md b/docs/generators/javascript-apollo-deprecated.md index ffc30f726ab..26948b3b3fa 100644 --- a/docs/generators/javascript-apollo-deprecated.md +++ b/docs/generators/javascript-apollo-deprecated.md @@ -27,7 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|root package for generated code| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|name of the license the project uses (Default: using info.license.name)| |null| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index f85f22cb96d..baf0382872d 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 5dc6a58c6d9..d4dfde07653 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index b9259f14ab6..3e04e8ee7b7 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -27,7 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|root package for generated code| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template)|
    **javascript**
    JavaScript client library
    **apollo**
    Apollo REST DataSource
    |javascript| |licenseName|name of the license the project uses (Default: using info.license.name)| |null| |modelPackage|package for generated models| |null| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index aac09068b9b..422852f3ad5 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -52,7 +52,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template)|
    **<default>**
    JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
    **quarkus**
    Server using Quarkus
    **thorntail**
    Server using Thorntail
    **openliberty**
    Server using Open Liberty
    **helidon**
    Server using Helidon
    **kumuluzee**
    Server using KumuluzEE
    |<default>| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index a9f89032ebe..92d8a8adccb 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index dc00f40d577..823e01e26f3 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -55,7 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |loadTestDataFromFile|Load test data from a generated JSON file| |false| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index f1b0b294f79..4ea4dc3e41e 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index be59dac624b..0c9717146af 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -49,7 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template)|
    **jersey1**
    Jersey core 1.x
    **jersey2**
    Jersey core 2.x
    |jersey2| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 0f5e5eed3d0..531aa13e351 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -50,7 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index ce4320fc60d..6bf76fbd837 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -50,7 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 076c45813a1..314b14c158c 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -52,7 +52,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template)|
    **<default>**
    JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
    **quarkus**
    Server using Quarkus
    **thorntail**
    Server using Thorntail
    **openliberty**
    Server using Open Liberty
    **helidon**
    Server using Helidon
    **kumuluzee**
    Server using KumuluzEE
    |<default>| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jetbrains-http-client.md b/docs/generators/jetbrains-http-client.md index 44da9dc6631..829686878d1 100644 --- a/docs/generators/jetbrains-http-client.md +++ b/docs/generators/jetbrains-http-client.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 90ee80172ab..2c7bc25a908 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/k6.md b/docs/generators/k6.md index f9de52fa699..e8574baee66 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 1b25cca82d3..691f53c757a 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -38,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |parcelizeModels|toggle "@Parcelize" for generated models| |null| |returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true. This option is currently supported only when using jaxrs-spec library.| |false| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson or 'kotlinx_serialization'| |moshi| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| |sourceFolder|source folder for generated code| |src/main/kotlin| diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 339497621d1..0bf820d705d 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -40,10 +40,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl |parcelizeModels|toggle "@Parcelize" for generated models| |null| |reactive|use coroutines for reactive behavior| |false| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson or 'kotlinx_serialization'| |moshi| |serverPort|configuration the port in which the sever is to run on| |8080| |serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false| |serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false| +|skipDefaultInterface|Whether to skip generation of default implementations for interfaces| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| |sourceFolder|source folder for generated code| |src/main/kotlin| diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 4bd4958a90a..16adee9e440 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |packageName|Generated artifact package name.| |org.openapitools| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson or 'kotlinx_serialization'| |moshi| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| |sourceFolder|source folder for generated code| |src/main/kotlin| diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 4c6b25ad394..c9512a849da 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -37,7 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |parcelizeModels|toggle "@Parcelize" for generated models| |null| |requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|
    **toJson**
    [DEFAULT] Date formatter option using a json converter.
    **toString**
    Use the 'toString'-method of the date-time object to retrieve the related string representation.
    |toJson| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson or 'kotlinx_serialization'| |moshi| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| |sourceFolder|source folder for generated code| |src/main/kotlin| @@ -46,6 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useRxJava|Whether to use the RxJava adapter with the retrofit2 library. IMPORTANT: this option has been deprecated. Please use `useRxJava3` instead.| |false| |useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: this option has been deprecated. Please use `useRxJava3` instead.| |false| |useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library.| |false| +|useSettingsGradle|Whether the project uses settings.gradle.| |false| ## IMPORT MAPPING diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index 75f0538b6bf..e3dbfbaff41 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -21,7 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 5612b294c21..1bff3d78f21 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index 18df0f28853..3cba8860f38 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen on.| |null| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index 196059ffba1..25ebea30c1c 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -22,7 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index bb9d06115fc..dd4a50965d3 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -21,7 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |outputFile|Output filename| |openapi/openapi.yaml| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index ed0420aa2bb..bee7b600ae1 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -21,7 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |outputFileName|Output file name| |openapi.json| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/php-dt.md b/docs/generators/php-dt.md index 7f9d0789bd5..2388f5caabf 100644 --- a/docs/generators/php-dt.md +++ b/docs/generators/php-dt.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modern|use modern language features (generated code will require PHP 8.0)| |false| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index 9c606506d75..b50da3ce223 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 28ac527eef4..71879cd494c 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-mezzio-ph.md b/docs/generators/php-mezzio-ph.md index 01cb9eb6ccd..e119ff6148f 100644 --- a/docs/generators/php-mezzio-ph.md +++ b/docs/generators/php-mezzio-ph.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modern|use modern language features (generated code will require PHP 8.0)| |false| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index f5844cd7096..1f30fd54381 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index fd30427de47..0b0b47c39cb 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index f818259b0e8..6112f3ae3c2 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |phpLegacySupport|Should the generated code be compatible with PHP 5.x?| |true| diff --git a/docs/generators/php.md b/docs/generators/php.md index 298d059c381..15d5513c024 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -26,7 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/plantuml.md b/docs/generators/plantuml.md index 847f0d65463..b1af2d30537 100644 --- a/docs/generators/plantuml.md +++ b/docs/generators/plantuml.md @@ -21,7 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index 2f6f7e4e510..f3c3874a7b0 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -26,7 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |featureCORS|use flask-cors for handling CORS requests| |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index ce4b7ae98dd..71fc3cf2e96 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -26,7 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |featureCORS|use flask-cors for handling CORS requests| |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md index ecb7fe8f237..20cd0ab9e82 100644 --- a/docs/generators/python-fastapi.md +++ b/docs/generators/python-fastapi.md @@ -23,7 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index 5624ecb8a04..d7f3df3f22f 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -26,7 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |featureCORS|use flask-cors for handling CORS requests| |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/python-nextgen.md b/docs/generators/python-nextgen.md index b445f5b2218..5343d442b36 100644 --- a/docs/generators/python-nextgen.md +++ b/docs/generators/python-nextgen.md @@ -19,14 +19,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|allowStringInDateTimeParameters|Allow string as input to datetime/date parameters for backward compartibility.| |false| |dateFormat|date format for query parameters| |%Y-%m-%d| |datetimeFormat|datetime format for query parameters| |%Y-%m-%dT%H:%M:%S%z| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| -|floatStrictType|Use strict type for float, i.e. StrictFloat or confloat(strict=true, ...)| |true| |generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3| |urllib3| +|mapNumberTo|Map number to Union[StrictFloat, StrictInt], StrictStr or float.| |Union[StrictFloat, StrictInt]| |packageName|python package name (convention: snake_case).| |openapi_client| |packageUrl|python package URL.| |null| |packageVersion|python package version.| |1.0.0| @@ -51,6 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • Dict
  • List
  • bool
  • +
  • bytearray
  • bytes
  • date
  • datetime
  • @@ -59,6 +59,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • float
  • int
  • list
  • +
  • none_type
  • object
  • str
  • diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 2200cadf241..918c8811374 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -32,7 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |gemSummary|gem summary. | |A ruby wrapper for the REST APIs| |gemVersion|gem version.| |1.0.0| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|HTTP library template (sub-template) to use|
    **faraday**
    Faraday >= 1.0.1 (https://github.com/lostisland/faraday)
    **typhoeus**
    Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)
    |typhoeus| |moduleName|top module name (convention: CamelCase, usually corresponding to gem name).| |OpenAPIClient| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index 322c4ed1e2f..95677bd7270 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |groupId|groupId in generated pom.xml| |org.openapitools| |invokerPackage|root package for generated code| |org.openapitools.server| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index e840955e1d5..dd560c4c508 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 54c7969f011..b5577af03c0 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index 5d9e403e85e..4767f3deb91 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index c2ab2adcf16..5a994270421 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index e0f60f0531c..d769de40550 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |generateCustomExceptions|If set, generates custom exception types.| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index c56f756df9e..0d4040f356b 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -27,7 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |jodaTimeVersion|The version of joda-time library| |2.10.13| |json4sVersion|The version of json4s library| |3.6.11| |jsonLibrary|Json library to use. Possible values are: json4s and circe.| |json4s| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index 25d057cf1c6..a859d74ed3f 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index a986e4bb8f6..e84b0971bab 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index c7380546a78..67fe63275f1 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -49,6 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| @@ -57,7 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |library|library template (sub-template)|
    **spring-boot**
    Spring-boot Server application.
    **spring-cloud**
    Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
    **spring-http-interface**
    Spring 6 HTTP interfaces (testing)
    |spring-boot| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| @@ -89,6 +90,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useFeignClientUrl|Whether to generate Feign client with url parameter.| |true| |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useOptional|Use Optional container for optional parameters| |false| +|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true| |useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false| |useSpringController|Annotate the generated API as a Spring Controller| |false| |useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index baabd043a86..14fdb8cf2f7 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -26,7 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateModelAdditionalProperties|Generate model additional properties (default: true)| |true| |hashableModels|Make hashable models (default: true)| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| |library|Library template (sub-template) to use|
    **urlsession**
    [DEFAULT] HTTP client: URLSession
    **alamofire**
    HTTP client: Alamofire
    **vapor**
    HTTP client: Vapor
    |urlsession| |mapFileBinaryToData|[WARNING] This option will be removed and enabled by default in the future once we've enhanced the code to work with `Data` in all the different situations. Map File and Binary to Data (default: false)| |false| @@ -73,6 +73,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl @@ -156,7 +162,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ### Client Modification Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|BasePath|✗|ToolingExtension +|BasePath|✓|ToolingExtension |Authorizations|✗|ToolingExtension |UserAgent|✗|ToolingExtension |MockServer|✗|ToolingExtension @@ -201,7 +207,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ### Documentation Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|Readme|✗|ToolingExtension +|Readme|✓|ToolingExtension |Model|✓|ToolingExtension |Api|✓|ToolingExtension @@ -221,7 +227,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |MultiServer|✗|OAS3 |ParameterizedServer|✗|OAS3 |ParameterStyling|✗|OAS3 -|Callbacks|✓|OAS3 +|Callbacks|✗|OAS3 |LinkObjects|✗|OAS3 ### Parameter Feature @@ -250,14 +256,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl ### Security Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 -|ApiKey|✓|OAS2,OAS3 +|BasicAuth|✗|OAS2,OAS3 +|ApiKey|✗|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✓|OAS3 -|OAuth2_Implicit|✓|OAS2,OAS3 -|OAuth2_Password|✓|OAS2,OAS3 -|OAuth2_ClientCredentials|✓|OAS2,OAS3 -|OAuth2_AuthorizationCode|✓|OAS2,OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✗|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 ### Wire Format Feature | Name | Supported | Defined By | diff --git a/docs/generators/wsdl-schema.md b/docs/generators/wsdl-schema.md index f9df093aa0c..08ba6899a19 100644 --- a/docs/generators/wsdl-schema.md +++ b/docs/generators/wsdl-schema.md @@ -24,7 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |hostname|the hostname of the service| |null| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serviceName|service name for the wsdl| |null| |soapPath|basepath of the soap services| |null| diff --git a/docs/plugins.md b/docs/plugins.md index f4586135cdb..dae527d4048 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -91,19 +91,19 @@ This gives access to the following tasks: | ---- | ----------- | | openApiGenerate | Generate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents. | | openApiGenerators | Lists generators available via Open API Generators. | -| openApiMeta | Generates a new generator to be consumed via Open API Generator. | +| openApiMeta | Generates a new generator to be consumed via Open API Generator. | | openApiValidate | Validates an Open API 2.0 or 3.x specification document. | > The plugin implements the above tasks as project extensions of the same name. If you’d like to declare these tasks as dependencies to other tasks (using `dependsOn`), you’ll need a task reference. e.g.: > ```groovy -> compileJava.dependsOn tasks.openApiGenerate +> compileJava.dependsOn tasks.named("openApiGenerate") > ``` For full details of all options, see the [plugin README](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin). ### Example -An example task for generating a kotlin client: +An example openApiGenerate task configuration for generating a kotlin client: ```groovy openApiGenerate { @@ -113,8 +113,10 @@ openApiGenerate { apiPackage = "org.openapi.example.api" invokerPackage = "org.openapi.example.invoker" modelPackage = "org.openapi.example.model" - configOptions = [ + configOptions.putAll([ dateLibrary: "java8" - ] + ]) } ``` + +*If you want to create separate tasks (for example when you have more than one api spec and require different parameters for each), this is how to do so in Gradle 7+: `tasks.register('taskName', org.openapitools.generator.gradle.plugin.tasks.GenerateTask) { ... }`.* diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000000..da1901930c2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1678083093, + "narHash": "sha256-eTkS9GcdSAYA3cE9zCAAs9wY3+oM2zT45ydIkAcEFFQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "684306b246d05168e42425a3610df7e2c4d51fcd", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000000..ccc7357dbb6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "OpenAPI generator nix flake"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells.default = pkgs.mkShell + { + buildInputs = with pkgs;[ + jdk8 + maven + ]; + }; + } + ); +} + diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index 4d6dd0f17c1..199a55e4232 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -67,6 +67,7 @@ remote.org.openapitools.client.api remote.org.openapitools.client.model remote.org.openapitools.client + true @@ -76,8 +77,8 @@ maven-compiler-plugin 3.8.1 - 1.7 - 1.7 + 1.8 + 1.8 none diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml index bedb6a19c8a..3a45b3beada 100644 --- a/modules/openapi-generator-maven-plugin/examples/kotlin.xml +++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml @@ -26,6 +26,7 @@ ${project.basedir}/swagger.yaml + true kotlin 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 5c811053cc5..d8980404f5e 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 @@ -59,8 +59,8 @@ maven-compiler-plugin 3.8.1 - 1.7 - 1.7 + 1.8 + 1.8 none 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 48f2d6ee07d..a7780239b2c 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 @@ -41,6 +41,7 @@ import java.util.Set; import com.google.common.io.ByteSource; import com.google.common.io.CharSource; import io.swagger.v3.parser.util.ClasspathHelper; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecution; @@ -99,6 +100,9 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "output", property = "openapi.generator.maven.plugin.output") private File output; + @Parameter(name = "cleanupOutput", property = "openapi.generator.maven.plugin.cleanupOutput", defaultValue = "false") + private boolean cleanupOutput; + /** * Location of the OpenAPI spec, as URL or file. */ @@ -494,6 +498,16 @@ public class CodeGenMojo extends AbstractMojo { LifecyclePhase.GENERATE_TEST_SOURCES.id().equals(mojo.getLifecyclePhase()) ? "generated-test-sources/openapi" : "generated-sources/openapi"); } + + if (cleanupOutput) { + try { + FileUtils.deleteDirectory(output); + LOGGER.info("Previous run output is removed from {}", output); + } catch (IOException e) { + LOGGER.warn("Failed to clean-up output directory {}", output, e); + } + } + addCompileSourceRootIfConfigured(); try { diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index e830e16ee8b..d1eab903cdc 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -272,6 +272,12 @@ commons-io ${commons-io.version} + + ch.qos.logback + logback-classic + 1.2.11 + test + org.slf4j slf4j-ext 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 2ee0c5474f8..841adbf3b6d 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 @@ -378,8 +378,11 @@ public class CodegenConstants { public static final String REMOVE_ENUM_VALUE_PREFIX = "removeEnumValuePrefix"; public static final String REMOVE_ENUM_VALUE_PREFIX_DESC = "Remove the common prefix of enum values"; + public static final String SKIP_ONEOF_ANYOF_GETTER = "skipOneOfAnyOfGetter"; + public static final String SKIP_ONEOF_ANYOF_GETTER_DESC = "Skip the generation of getter for sub-schemas in oneOf/anyOf models."; + public static final String LEGACY_DISCRIMINATOR_BEHAVIOR = "legacyDiscriminatorBehavior"; - public static final String LEGACY_DISCRIMINATOR_BEHAVIOR_DESC = "Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default)."; + public static final String LEGACY_DISCRIMINATOR_BEHAVIOR_DESC = "Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default)."; public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; public static final String USE_SINGLE_REQUEST_PARAMETER_DESC = "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter."; @@ -388,10 +391,12 @@ public class CodegenConstants { public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC = "If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " + "If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."; + public static final String UNSUPPORTED_V310_SPEC_MSG = "Generation using 3.1.0 specs is in development and is not officially supported yet. " + "If you would like to expedite development, please consider woking on the open issues in the 3.1.0 project: https://github.com/orgs/OpenAPITools/projects/4/views/1 " + "and reach out to our team on Slack at https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE = "enumUnknownDefaultCase"; public static final String ENUM_UNKNOWN_DEFAULT_CASE_DESC = "If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response." + @@ -399,13 +404,13 @@ public class CodegenConstants { public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP = "useOneOfDiscriminatorLookup"; public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC = "Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped."; + public static final String INIT_REQUIRED_VARS = "initRequiredVars"; public static final String INIT_REQUIRED_VARS_DESC = "If set to true then the required variables are included as positional arguments in __init__ and _from_openapi_data methods. Note: this can break some composition use cases. To learn more read PR #8802."; public static final String ERROR_OBJECT_TYPE = "errorObjectType"; public static final String NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS = "nonCompliantUseDiscriminatorIfCompositionFails"; - public static final String NON_COMPLIANT_USE_DISCR_IF_COMPOSITION_FAILS_DESC = "When true, If the payload fails to validate against composed schemas (allOf/anyOf/oneOf/not) and a " + "discriminator is present, then ignore the composition validation errors and attempt to use the " + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index 46790a8cad0..988a7eb0367 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -1209,10 +1209,25 @@ public class CodegenModel implements IJsonSchemaValidationProperties { return sb.toString(); } - public void addDiscriminatorMappedModelsImports() { + /* + * To clean up mapped models if needed and add mapped models to imports + * + * @param cleanUpMappedModels Clean up mapped models if set to true + */ + public void addDiscriminatorMappedModelsImports(boolean cleanUpMappedModels) { if (discriminator == null || discriminator.getMappedModels() == null) { return; } + + if (cleanUpMappedModels && !this.hasChildren && // no child + (this.oneOf == null || this.oneOf.isEmpty()) && // not oneOf + (this.anyOf == null || this.anyOf.isEmpty())) { // not anyOf + //clear the mapping + discriminator.setMappedModels(null); + return; + } + + // import child schemas defined in mapped models for (CodegenDiscriminator.MappedModel mm : discriminator.getMappedModels()) { if (!"".equals(mm.getModelName())) { imports.add(mm.getModelName()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index ae723856989..53495455009 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -35,7 +35,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { public String example; // example value (x-example) public String jsonSchema; public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, - isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isShort, isUnboundedInteger; + isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isShort, isUnboundedInteger; public boolean isArray, isMap; public boolean isFile; public boolean isEnum; @@ -229,6 +229,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { output.isUuid = this.isUuid; output.isUri = this.isUri; output.isEmail = this.isEmail; + output.isPassword = this.isPassword; output.isFreeFormObject = this.isFreeFormObject; output.isAnyType = this.isAnyType; output.isArray = this.isArray; @@ -244,7 +245,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { @Override public int hashCode() { - return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties); + return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties); } @Override @@ -281,6 +282,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { isUuid == that.isUuid && isUri == that.isUri && isEmail == that.isEmail && + isPassword == that.isPassword && isFreeFormObject == that.isFreeFormObject && isAnyType == that.isAnyType && isArray == that.isArray && @@ -394,6 +396,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { sb.append(", isUuid=").append(isUuid); sb.append(", isUri=").append(isUri); sb.append(", isEmail=").append(isEmail); + sb.append(", isPassword=").append(isPassword); sb.append(", isFreeFormObject=").append(isFreeFormObject); sb.append(", isAnyType=").append(isAnyType); sb.append(", isArray=").append(isArray); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java index 6362fb93d80..aeb92053388 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -134,6 +134,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public boolean isUuid; public boolean isUri; public boolean isEmail; + public boolean isPassword; public boolean isNull; /** * The type is a free-form object, i.e. it is a map of string to values with no declared properties. @@ -158,6 +159,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public boolean isCircularReference; public boolean isDiscriminator; public boolean isNew; // true when this property overrides an inherited property + public Boolean isOverridden; // true if the property is a parent property (not defined in child/current schema) public List _enum; public Map allowableValues; // If 'additionalProperties' is not set, items is null. @@ -1051,6 +1053,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti sb.append(", isUuid=").append(isUuid); sb.append(", isUri=").append(isUri); sb.append(", isEmail=").append(isEmail); + sb.append(", isPassword=").append(isPassword); sb.append(", isFreeFormObject=").append(isFreeFormObject); sb.append(", isArray=").append(isArray); sb.append(", isMap=").append(isMap); @@ -1065,6 +1068,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti sb.append(", isCircularReference=").append(isCircularReference); sb.append(", isDiscriminator=").append(isDiscriminator); sb.append(", isNew=").append(isNew); + sb.append(", isOverridden=").append(isOverridden); sb.append(", _enum=").append(_enum); sb.append(", allowableValues=").append(allowableValues); sb.append(", items=").append(items); @@ -1142,6 +1146,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti isUuid == that.isUuid && isUri == that.isUri && isEmail == that.isEmail && + isPassword == that.isPassword && isFreeFormObject == that.isFreeFormObject && isArray == that.isArray && isMap == that.isMap && @@ -1156,6 +1161,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti isCircularReference == that.isCircularReference && isDiscriminator == that.isDiscriminator && isNew == that.isNew && + isOverridden == that.isOverridden && hasValidation == that.hasValidation && isInherited == that.isInherited && isXmlAttribute == that.isXmlAttribute && @@ -1231,9 +1237,9 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti exclusiveMinimum, exclusiveMaximum, required, deprecated, hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isFile, - isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, + isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isArray, isMap, isEnum, isInnerEnum, isEnumRef, isAnyType, isReadOnly, isWriteOnly, isNullable, isShort, - isUnboundedInteger, isSelfReference, isCircularReference, isDiscriminator, isNew, _enum, + isUnboundedInteger, isSelfReference, isCircularReference, isDiscriminator, isNew, isOverridden, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase, nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index aa6b103b77c..edef0c709a3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -50,6 +50,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { public boolean isDateTime; public boolean isUuid; public boolean isEmail; + public boolean isPassword; public boolean isModel; public boolean isFreeFormObject; public boolean isAnyType; @@ -98,7 +99,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { public int hashCode() { return Objects.hash(headers, code, message, examples, dataType, baseType, containerType, hasHeaders, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate, - isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType, + isDateTime, isUuid, isEmail, isPassword, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType, isMap, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties, vars, requiredVars, isNull, hasValidation, isShort, isUnboundedInteger, getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(), @@ -130,6 +131,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { isDateTime == that.isDateTime && isUuid == that.isUuid && isEmail == that.isEmail && + isPassword == that.isPassword && isModel == that.isModel && isFreeFormObject == that.isFreeFormObject && isAnyType == that.isAnyType && @@ -568,6 +570,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { sb.append(", isDateTime=").append(isDateTime); sb.append(", isUuid=").append(isUuid); sb.append(", isEmail=").append(isEmail); + sb.append(", isPassword=").append(isPassword); sb.append(", isModel=").append(isModel); sb.append(", isFreeFormObject=").append(isFreeFormObject); sb.append(", isAnyType=").append(isAnyType); 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 40ff3a93ad7..a3c1bef3db1 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 @@ -25,15 +25,32 @@ import com.google.common.collect.ImmutableMap; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache.Compiler; import com.samskivert.mustache.Mustache.Lambda; - +import io.swagger.v3.core.util.Json; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.callbacks.Callback; +import io.swagger.v3.oas.models.examples.Example; +import io.swagger.v3.oas.models.headers.Header; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.*; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.responses.ApiResponses; +import io.swagger.v3.oas.models.security.OAuthFlow; +import io.swagger.v3.oas.models.security.OAuthFlows; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.servers.Server; +import io.swagger.v3.oas.models.servers.ServerVariable; +import io.swagger.v3.parser.util.SchemaTypeUtil; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.text.StringEscapeUtils; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; import org.openapitools.codegen.api.TemplatingEngineAdapter; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.examples.ExampleGenerator; +import org.openapitools.codegen.languages.PythonClientCodegen; import org.openapitools.codegen.languages.RustServerCodegen; import org.openapitools.codegen.meta.FeatureSet; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -595,6 +612,7 @@ public class DefaultCodegen implements CodegenConfig { /** * Loop through all models to update different flags (e.g. isSelfReference), children models, etc + * and update mapped models for import. * * @param objs Map of models * @return maps of models with various updates @@ -634,7 +652,7 @@ public class DefaultCodegen implements CodegenConfig { parent.hasChildren = true; Schema parentSchema = this.openAPI.getComponents().getSchemas().get(parent.name); if (parentSchema == null) { - throw new NullPointerException(parent.name+" in "+this.openAPI.getComponents().getSchemas()); + throw new NullPointerException(parent.name + " in " + this.openAPI.getComponents().getSchemas()); } if (parentSchema.getDiscriminator() == null) { parent = allModels.get(parent.getParent()); @@ -645,10 +663,17 @@ public class DefaultCodegen implements CodegenConfig { } // loop through properties of each model to detect self-reference + // and update mapped models for import for (ModelsMap entry : objs.values()) { for (ModelMap mo : entry.getModels()) { CodegenModel cm = mo.getModel(); removeSelfReferenceImports(cm); + + if (!this.getLegacyDiscriminatorBehavior()) { + // skip cleaning up mapped models for python client generator + // which uses its own logic + cm.addDiscriminatorMappedModelsImports(!(this instanceof PythonClientCodegen)); + } } } setCircularReferences(allModels); @@ -1728,9 +1753,11 @@ public class DefaultCodegen implements CodegenConfig { typeMapping.put("DateTime", "Date"); typeMapping.put("long", "Long"); typeMapping.put("short", "Short"); + typeMapping.put("integer", "Integer"); + typeMapping.put("UnsignedInteger", "Integer"); + typeMapping.put("UnsignedLong", "Long"); typeMapping.put("char", "String"); typeMapping.put("object", "Object"); - typeMapping.put("integer", "Integer"); // FIXME: java specific type should be in Java Based Abstract Impl's typeMapping.put("ByteArray", "byte[]"); typeMapping.put("binary", "File"); @@ -2062,7 +2089,7 @@ public class DefaultCodegen implements CodegenConfig { if (encoding != null) { boolean styleGiven = true; Encoding.StyleEnum style = encoding.getStyle(); - if(style == null || style == Encoding.StyleEnum.FORM) { + if (style == null || style == Encoding.StyleEnum.FORM) { // (Unfortunately, swagger-parser-v3 will always provide 'form' // when style is not specified, so we can't detect that) style = Encoding.StyleEnum.FORM; @@ -2070,12 +2097,12 @@ public class DefaultCodegen implements CodegenConfig { } boolean explodeGiven = true; Boolean explode = encoding.getExplode(); - if(explode == null) { + if (explode == null) { explode = style == Encoding.StyleEnum.FORM; // Default to True when form, False otherwise explodeGiven = false; } - if(!styleGiven && !explodeGiven) { + if (!styleGiven && !explodeGiven) { // Ignore contentType if style or explode are specified. codegenParameter.contentType = encoding.getContentType(); } @@ -2083,7 +2110,7 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.style = style.toString(); codegenParameter.isDeepObject = Encoding.StyleEnum.DEEP_OBJECT == style; - if(codegenParameter.isContainer) { + if (codegenParameter.isContainer) { codegenParameter.isExplode = explode; String collectionFormat = getCollectionFormat(codegenParameter); codegenParameter.collectionFormat = StringUtils.isEmpty(collectionFormat) ? "csv" : collectionFormat; @@ -2394,8 +2421,14 @@ public class DefaultCodegen implements CodegenConfig { return "number"; } } else if (ModelUtils.isIntegerSchema(schema)) { - if (ModelUtils.isLongSchema(schema)) { + if (ModelUtils.isUnsignedLongSchema(schema)) { + return "UnsignedLong"; + } else if (ModelUtils.isUnsignedIntegerSchema(schema)) { + return "UnsignedInteger"; + } else if (ModelUtils.isLongSchema(schema)) { return "long"; + } else if (ModelUtils.isShortSchema(schema)) {// int32 + return "integer"; } else { return schema.getType(); // integer } @@ -2631,9 +2664,6 @@ public class DefaultCodegen implements CodegenConfig { if (m.discriminator == null && innerSchema.getDiscriminator() != null) { LOGGER.debug("discriminator is set to null (not correctly set earlier): {}", m.name); m.setDiscriminator(createDiscriminator(m.name, innerSchema, this.openAPI)); - if (!this.getLegacyDiscriminatorBehavior()) { - m.addDiscriminatorMappedModelsImports(); - } modelDiscriminators++; } @@ -2788,6 +2818,7 @@ public class DefaultCodegen implements CodegenConfig { if (Boolean.TRUE.equals(schema.getNullable())) { m.isNullable = Boolean.TRUE; } + // end of code block for composed schema } @@ -2975,9 +3006,6 @@ public class DefaultCodegen implements CodegenConfig { m.isAlias = (typeAliases.containsKey(name) || isAliasOfSimpleTypes(schema)); // check if the unaliased schema is an alias of simple OAS types m.setDiscriminator(createDiscriminator(name, schema, this.openAPI)); - if (!this.getLegacyDiscriminatorBehavior()) { - m.addDiscriminatorMappedModelsImports(); - } if (schema.getDeprecated() != null) { m.isDeprecated = schema.getDeprecated(); @@ -3024,7 +3052,6 @@ public class DefaultCodegen implements CodegenConfig { // referenced models here, component that refs another component which is a model // if a component references a schema which is not a generated model, the refed schema will be loaded into // schema by unaliasSchema and one of the above code paths will be taken - ; } if (schema.get$ref() != null) { m.setRef(schema.get$ref()); @@ -3432,15 +3459,15 @@ public class DefaultCodegen implements CodegenConfig { break; } currentSchemaName = queue.remove(0); - MappedModel mm = new MappedModel(currentSchemaName, toModelName(currentSchemaName)); - descendentSchemas.add(mm); Schema cs = schemas.get(currentSchemaName); Map vendorExtensions = cs.getExtensions(); - if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { - String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); - mm = new MappedModel(xDiscriminatorValue, toModelName(currentSchemaName)); - descendentSchemas.add(mm); - } + String mappingName = + Optional.ofNullable(vendorExtensions) + .map(ve -> ve.get("x-discriminator-value")) + .map(discriminatorValue -> (String) discriminatorValue) + .orElse(currentSchemaName); + MappedModel mm = new MappedModel(mappingName, toModelName(currentSchemaName)); + descendentSchemas.add(mm); } return descendentSchemas; } @@ -3490,10 +3517,11 @@ public class DefaultCodegen implements CodegenConfig { // for schemas that allOf inherit from this schema, add those descendants to this discriminator map List otherDescendants = getAllOfDescendants(schemaName, openAPI); for (MappedModel otherDescendant : otherDescendants) { - // add only if the mapping names are not the same + // add only if the mapping names are not the same and the model names are not the same boolean matched = false; for (MappedModel uniqueDescendant : uniqueDescendants) { - if (uniqueDescendant.getMappingName().equals(otherDescendant.getMappingName())) { + if (uniqueDescendant.getMappingName().equals(otherDescendant.getMappingName()) + || (uniqueDescendant.getModelName().equals(otherDescendant.getModelName()))) { matched = true; break; } @@ -3672,6 +3700,8 @@ public class DefaultCodegen implements CodegenConfig { property.isUri = true; } else if (ModelUtils.isEmailSchema(p)) { property.isEmail = true; + } else if (ModelUtils.isPasswordSchema(p)) { + property.isPassword = true; } else if (ModelUtils.isDateSchema(p)) { // date format property.setIsString(false); // for backward compatibility with 2.x property.isDate = true; @@ -3764,6 +3794,18 @@ public class DefaultCodegen implements CodegenConfig { return cpc; } + Schema original = null; + // check if it's allOf (only 1 sub schema) with or without default/nullable/etc set in the top level + if (ModelUtils.isAllOf(p) && p.getAllOf().size() == 1 && !(this instanceof PythonClientCodegen)) { + if (p.getAllOf().get(0) instanceof Schema) { + original = p; + p = (Schema) p.getAllOf().get(0); + } else { + LOGGER.error("Unknown type in allOf schema. Please report the issue via openapi-generator's Github issue tracker."); + } + + } + CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY); if (p.equals(trueSchema)) { property.setIsBooleanSchemaTrue(true); @@ -3920,7 +3962,7 @@ public class DefaultCodegen implements CodegenConfig { } property.baseType = getSchemaType(p); if (p.getXml() != null) { - property.isXmlWrapped = p.getXml().getWrapped() == null ? false : p.getXml().getWrapped(); + property.isXmlWrapped = p.getXml().getWrapped() != null && p.getXml().getWrapped(); property.xmlPrefix = p.getXml().getPrefix(); property.xmlNamespace = p.getXml().getNamespace(); property.xmlName = p.getXml().getName(); @@ -3957,6 +3999,25 @@ public class DefaultCodegen implements CodegenConfig { property.isModel = (ModelUtils.isComposedSchema(referencedSchema) || ModelUtils.isObjectSchema(referencedSchema)) && ModelUtils.isModel(referencedSchema); } + // restore original schema with default value, nullable, readonly etc + if (original != null) { + p = original; + // evaluate common attributes if defined in the top level + if (p.getNullable() != null) { + property.isNullable = p.getNullable(); + } else if (p.getExtensions() != null && p.getExtensions().containsKey("x-nullable")) { + property.isNullable = (Boolean) p.getExtensions().get("x-nullable"); + } + + if (p.getReadOnly() != null) { + property.isReadOnly = p.getReadOnly(); + } + + if (p.getWriteOnly() != null) { + property.isWriteOnly = p.getWriteOnly(); + } + } + // set the default value property.defaultValue = toDefaultValue(property, p); property.defaultValueWithParam = toDefaultValueWithParam(name, p); @@ -4699,6 +4760,8 @@ public class DefaultCodegen implements CodegenConfig { } else if (ModelUtils.isStringSchema(responseSchema)) { if (ModelUtils.isEmailSchema(responseSchema)) { r.isEmail = true; + } else if (ModelUtils.isPasswordSchema(responseSchema)) { + r.isPassword = true; } else if (ModelUtils.isUUIDSchema(responseSchema)) { r.isUuid = true; } else if (ModelUtils.isByteArraySchema(responseSchema)) { @@ -5009,7 +5072,7 @@ public class DefaultCodegen implements CodegenConfig { // the default value is false // https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterexplode - codegenParameter.isExplode = parameter.getExplode() == null ? false : parameter.getExplode(); + codegenParameter.isExplode = parameter.getExplode() != null && parameter.getExplode(); // TODO revise collectionFormat, default collection format in OAS 3 appears to multi at least for query parameters // https://swagger.io/docs/specification/serialization/ @@ -5038,7 +5101,6 @@ public class DefaultCodegen implements CodegenConfig { if (ModelUtils.isShortSchema(parameterSchema)) { // int32/short format codegenParameter.isShort = true; } else { // unbounded integer - ; } } } else if (ModelUtils.isTypeObjectSchema(parameterSchema)) { @@ -5050,7 +5112,6 @@ public class DefaultCodegen implements CodegenConfig { } addVarsRequiredVarsAdditionalProps(parameterSchema, codegenParameter); } else if (ModelUtils.isNullType(parameterSchema)) { - ; } else if (ModelUtils.isAnyType(parameterSchema)) { // any schema with no type set, composed schemas often do this if (ModelUtils.isMapSchema(parameterSchema)) { // for map parameter @@ -5078,7 +5139,6 @@ public class DefaultCodegen implements CodegenConfig { } } else { // referenced schemas - ; } CodegenProperty codegenProperty = fromProperty(parameter.getName(), parameterSchema, false); @@ -5563,6 +5623,10 @@ public class DefaultCodegen implements CodegenConfig { * @param modelName model name */ protected void addImport(ComposedSchema composed, Schema childSchema, CodegenModel model, String modelName ) { + if (composed == null || childSchema == null) { + return; + } + // import only if it's not allOf composition schema (without discriminator) if (!(composed.getAllOf() != null && childSchema.getDiscriminator() == null)) { addImport(model, modelName); @@ -5660,6 +5724,7 @@ public class DefaultCodegen implements CodegenConfig { for (CodegenProperty var : cm.vars) { // create a map of codegen properties for lookup later varsMap.put(var.baseName, var); + var.isOverridden = false; } } } @@ -5684,6 +5749,10 @@ public class DefaultCodegen implements CodegenConfig { cp = fromProperty(key, prop, mandatory.contains(key)); } + if (cm != null && cm.allVars == vars && cp.isOverridden == null) { // processing allVars and it's a parent property + cp.isOverridden = true; + } + vars.add(cp); m.setHasVars(true); @@ -6247,6 +6316,8 @@ public class DefaultCodegen implements CodegenConfig { } if (Boolean.TRUE.equals(property.isEmail) && Boolean.TRUE.equals(property.isString)) { parameter.isEmail = true; + } else if (Boolean.TRUE.equals(property.isPassword) && Boolean.TRUE.equals(property.isString)) { + parameter.isPassword = true; } else if (Boolean.TRUE.equals(property.isUuid) && Boolean.TRUE.equals(property.isString)) { parameter.isUuid = true; } else if (Boolean.TRUE.equals(property.isByteArray)) { @@ -6762,6 +6833,8 @@ public class DefaultCodegen implements CodegenConfig { } else if (ModelUtils.isStringSchema(ps)) { if (ModelUtils.isEmailSchema(ps)) { codegenParameter.isEmail = true; + } else if (ModelUtils.isPasswordSchema(ps)) { + codegenParameter.isPassword = true; } else if (ModelUtils.isUUIDSchema(ps)) { codegenParameter.isUuid = true; } else if (ModelUtils.isByteArraySchema(ps)) { @@ -6806,7 +6879,6 @@ public class DefaultCodegen implements CodegenConfig { if (ModelUtils.isShortSchema(ps)) { // int32/short format codegenParameter.isShort = true; } else { // unbounded integer - ; } } } else if (ModelUtils.isTypeObjectSchema(ps)) { @@ -6814,10 +6886,8 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.isFreeFormObject = true; } } else if (ModelUtils.isNullType(ps)) { - ; } else if (ModelUtils.isAnyType(ps)) { // any schema with no type set, composed schemas often do this - ; } else if (ModelUtils.isArraySchema(ps)) { Schema inner = getSchemaItems((ArraySchema) ps); CodegenProperty arrayInnerProperty = fromProperty("inner", inner, false); @@ -6858,7 +6928,6 @@ public class DefaultCodegen implements CodegenConfig { } } else { // referenced schemas - ; } if (Boolean.TRUE.equals(codegenProperty.isModel)) { @@ -7701,9 +7770,7 @@ public class DefaultCodegen implements CodegenConfig { CodegenModel cm = new CodegenModel(); cm.setDiscriminator(createDiscriminator("", cs, openAPI)); - if (!this.getLegacyDiscriminatorBehavior()) { - cm.addDiscriminatorMappedModelsImports(); - } + for (Schema o : Optional.ofNullable(cs.getOneOf()).orElse(Collections.emptyList())) { if (o.get$ref() == null) { if (cm.discriminator != null && o.get$ref() == null) { @@ -7762,9 +7829,9 @@ public class DefaultCodegen implements CodegenConfig { return exceptions; } - private String name; - private String removeCharRegEx; - private List exceptions; + private final String name; + private final String removeCharRegEx; + private final List exceptions; @Override public boolean equals(Object o) { @@ -7936,7 +8003,7 @@ public class DefaultCodegen implements CodegenConfig { } private CodegenComposedSchemas getComposedSchemas(Schema schema) { - if (!(schema instanceof ComposedSchema) && schema.getNot()==null) { + if (!(schema instanceof ComposedSchema) && schema.getNot() == null) { return null; } Schema notSchema = schema.getNot(); 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 9646e555663..78d3ac40920 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 @@ -820,6 +820,11 @@ public class DefaultGenerator implements Generator { bundle.put("hasServers", true); } + boolean hasOperationServers = allOperations != null && allOperations.stream() + .flatMap(om -> om.getOperations().getOperation().stream()) + .anyMatch(o -> o.servers != null && !o.servers.isEmpty()); + bundle.put("hasOperationServers", hasOperationServers); + if (openAPI.getExternalDocs() != null) { bundle.put("externalDocs", openAPI.getExternalDocs()); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java index d5e8f7faa1f..55dbcbac3d5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java @@ -247,6 +247,8 @@ public interface IJsonSchemaValidationProperties { ; } else if (ModelUtils.isEmailSchema(p)) { ; + } else if (ModelUtils.isPasswordSchema(p)) { + ; } else if (ModelUtils.isDateSchema(p)) { ; } else if (ModelUtils.isDateTimeSchema(p)) { 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 f8b67f47cd7..1d11972b44d 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 @@ -224,7 +224,7 @@ public class InlineModelResolver { } if (m.getAllOf() != null && !m.getAllOf().isEmpty()) { - // check to ensure at least of the allOf item is model + // check to ensure at least one of the allOf item is model for (Schema inner : m.getAllOf()) { if (isModelNeeded(ModelUtils.getReferencedSchema(openAPI, inner), visitedSchemas)) { return true; @@ -385,6 +385,7 @@ public class InlineModelResolver { } } m.setAnyOf(newAnyOf); + } if (m.getOneOf() != null) { List newOneOf = new ArrayList(); @@ -541,15 +542,15 @@ public class InlineModelResolver { * allOf: * - $ref: '#/components/schemas/Animal' * - type: object - * properties: - * name: - * type: string - * age: - * type: string + * properties: + * name: + * type: string + * age: + * type: string * - type: object - * properties: - * breed: - * type: string + * properties: + * breed: + * type: string * * @param key a unique name ofr the composed schema. * @param children the list of nested schemas within a composed schema (allOf, anyOf, oneOf). @@ -577,6 +578,8 @@ public class InlineModelResolver { // instead of inline. String innerModelName = resolveModelName(component.getTitle(), key); Schema innerModel = modelFromProperty(openAPI, component, innerModelName); + // Recurse to create $refs for inner models + gatherInlineModels(innerModel, innerModelName); String existing = matchGenerated(innerModel); if (existing == null) { innerModelName = addSchemas(innerModelName, innerModel); @@ -604,13 +607,17 @@ public class InlineModelResolver { List modelNames = new ArrayList(models.keySet()); for (String modelName : modelNames) { Schema model = models.get(modelName); - if (ModelUtils.isComposedSchema(model)) { + if (ModelUtils.isAnyOf(model)) { // contains anyOf only + gatherInlineModels(model, modelName); + } else if (ModelUtils.isOneOf(model)) { // contains oneOf only + gatherInlineModels(model, modelName); + } else if (ModelUtils.isComposedSchema(model)) { ComposedSchema m = (ComposedSchema) model; // inline child schemas flattenComposedChildren(modelName + "_allOf", m.getAllOf()); flattenComposedChildren(modelName + "_anyOf", m.getAnyOf()); flattenComposedChildren(modelName + "_oneOf", m.getOneOf()); - } else if (model instanceof Schema) { + } else { gatherInlineModels(model, modelName); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java index 3e883e47b18..6b98b0d5e24 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java @@ -65,6 +65,7 @@ public class OpenAPINormalizer { // when set to true, oneOf/anyOf schema with only one sub-schema is simplified to just the sub-schema // and if sub-schema contains "null", remove it and set nullable to true instead + // and if sub-schema contains enum of "null", remove it and set nullable to true instead final String SIMPLIFY_ONEOF_ANYOF = "SIMPLIFY_ONEOF_ANYOF"; boolean simplifyOneOfAnyOf; @@ -76,6 +77,16 @@ public class OpenAPINormalizer { final String SET_TAGS_FOR_ALL_OPERATIONS = "SET_TAGS_FOR_ALL_OPERATIONS"; String setTagsForAllOperations; + // when set to true, auto fix integer with maximum value 4294967295 (2^32-1) or long with 18446744073709551615 (2^64-1) + // by adding x-unsigned to the schema + final String ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE = "ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE"; + boolean addUnsignedToIntegerWithInvalidMaxValue; + + // when set to true, refactor schema with allOf and properties in the same level to a schema with allOf only and + // the allOf contains a new schema containing the properties in the top level + final String REFACTOR_ALLOF_WITH_PROPERTIES_ONLY = "REFACTOR_ALLOF_WITH_PROPERTIES_ONLY"; + boolean refactorAllOfWithPropertiesOnly; + // ============= end of rules ============= /** @@ -132,6 +143,13 @@ public class OpenAPINormalizer { setTagsForAllOperations = rules.get(SET_TAGS_FOR_ALL_OPERATIONS); } + if (enableAll || "true".equalsIgnoreCase(rules.get(ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE))) { + addUnsignedToIntegerWithInvalidMaxValue = true; + } + + if (enableAll || "true".equalsIgnoreCase(rules.get(REFACTOR_ALLOF_WITH_PROPERTIES_ONLY))) { + refactorAllOfWithPropertiesOnly = true; + } } /** @@ -333,6 +351,15 @@ public class OpenAPINormalizer { normalizeSchema(schema.getItems(), visitedSchemas); } else if (schema.getAdditionalProperties() instanceof Schema) { // map normalizeSchema((Schema) schema.getAdditionalProperties(), visitedSchemas); + } else if (ModelUtils.isOneOf(schema)) { // oneOf + return normalizeOneOf(schema, visitedSchemas); + } else if (ModelUtils.isAnyOf(schema)) { // anyOf + return normalizeAnyOf(schema, visitedSchemas); + } else if (ModelUtils.isAllOfWithProperties(schema)) { // allOf with properties + schema = normalizeAllOfWithProperties(schema, visitedSchemas); + normalizeSchema(schema, visitedSchemas); + } else if (ModelUtils.isAllOf(schema)) { // allOf + return normalizeAllOf(schema, visitedSchemas); } else if (ModelUtils.isComposedSchema(schema)) { // composed schema ComposedSchema cs = (ComposedSchema) schema; @@ -361,12 +388,12 @@ public class OpenAPINormalizer { } return cs; - } else if (schema.getNot() != null) {// not schema - normalizeSchema(schema.getNot(), visitedSchemas); } else if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { normalizeProperties(schema.getProperties(), visitedSchemas); } else if (schema instanceof BooleanSchema) { normalizeBooleanSchema(schema, visitedSchemas); + } else if (schema instanceof IntegerSchema) { + normalizeIntegerSchema(schema, visitedSchemas); } else if (schema instanceof Schema) { normalizeSchemaWithOnlyProperties(schema, visitedSchemas); } else { @@ -380,6 +407,10 @@ public class OpenAPINormalizer { processSimplifyBooleanEnum(schema); } + private void normalizeIntegerSchema(Schema schema, Set visitedSchemas) { + processAddUnsignedToIntegerWithInvalidMaxValue(schema); + } + private void normalizeSchemaWithOnlyProperties(Schema schema, Set visitedSchemas) { // normalize non-composed schema (e.g. schema with only properties) } @@ -408,6 +439,20 @@ public class OpenAPINormalizer { return schema; } + private Schema normalizeAllOfWithProperties(Schema schema, Set visitedSchemas) { + for (Object item : schema.getAllOf()) { + if (!(item instanceof Schema)) { + throw new RuntimeException("Error! allOf schema is not of the type Schema: " + item); + } + // normalize allOf sub schemas one by one + normalizeSchema((Schema) item, visitedSchemas); + } + // process rules here + schema = processRefactorAllOfWithPropertiesOnly(schema); + + return schema; + } + private Schema normalizeOneOf(Schema schema, Set visitedSchemas) { for (Object item : schema.getOneOf()) { if (item == null) { @@ -446,6 +491,10 @@ public class OpenAPINormalizer { } private Schema normalizeComplexComposedSchema(Schema schema, Set visitedSchemas) { + // loop through properties, if any + if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { + normalizeProperties(schema.getProperties(), visitedSchemas); + } processRemoveAnyOfOneOfAndKeepPropertiesOnly(schema); @@ -549,7 +598,7 @@ public class OpenAPINormalizer { /** * If the schema is anyOf and the sub-schemas are either string or enum of string, - * then simplify it to just string as many generators do not yet support anyOf. + * then simplify it to just enum of string as many generators do not yet support anyOf. * * @param schema Schema * @return Schema @@ -564,7 +613,7 @@ public class OpenAPINormalizer { return schema; } - Schema s0 = null, s1 = null; + Schema result = null, s0 = null, s1 = null; if (schema.getAnyOf().size() == 2) { s0 = ModelUtils.unaliasSchema(openAPI, (Schema) schema.getAnyOf().get(0)); s1 = ModelUtils.unaliasSchema(openAPI, (Schema) schema.getAnyOf().get(1)); @@ -575,18 +624,30 @@ public class OpenAPINormalizer { s0 = ModelUtils.getReferencedSchema(openAPI, s0); s1 = ModelUtils.getReferencedSchema(openAPI, s1); - // find the string schema (not enum) + // find the string schema (enum) if (s0 instanceof StringSchema && s1 instanceof StringSchema) { if (((StringSchema) s0).getEnum() != null) { // s0 is enum, s1 is string - return (StringSchema) s1; + result = (StringSchema) s0; } else if (((StringSchema) s1).getEnum() != null) { // s1 is enum, s0 is string - return (StringSchema) s0; + result = (StringSchema) s1; } else { // both are string - return schema; + result = schema; } } else { - return schema; + result = schema; } + + // set nullable + if (schema.getNullable() != null) { + result.setNullable(schema.getNullable()); + } + + // set default + if (schema.getDefault() != null) { + result.setDefault(schema.getDefault()); + } + + return result; } /** @@ -602,11 +663,22 @@ public class OpenAPINormalizer { } if (schema.getOneOf() != null && !schema.getOneOf().isEmpty()) { - // convert null sub-schema to `nullable: true` for (int i = 0; i < schema.getOneOf().size(); i++) { + // convert null sub-schema to `nullable: true` if (schema.getOneOf().get(i) == null || ((Schema) schema.getOneOf().get(i)).getType() == null) { schema.getOneOf().remove(i); schema.setNullable(true); + continue; + } + + // convert enum of null only to `nullable:true` + Schema oneOfElement = ModelUtils.getReferencedSchema(openAPI, (Schema) schema.getOneOf().get(i)); + if (oneOfElement.getEnum() != null && oneOfElement.getEnum().size() == 1) { + if ("null".equals(String.valueOf(oneOfElement.getEnum().get(0)))) { + schema.setNullable(true); + schema.getOneOf().remove(i); + continue; + } } } @@ -635,17 +707,28 @@ public class OpenAPINormalizer { } if (schema.getAnyOf() != null && !schema.getAnyOf().isEmpty()) { - // convert null sub-schema to `nullable: true` for (int i = 0; i < schema.getAnyOf().size(); i++) { + // convert null sub-schema to `nullable: true` if (schema.getAnyOf().get(i) == null || ((Schema) schema.getAnyOf().get(i)).getType() == null) { schema.getAnyOf().remove(i); schema.setNullable(true); + continue; + } + + // convert enum of null only to `nullable:true` + Schema anyOfElement = ModelUtils.getReferencedSchema(openAPI, (Schema) schema.getAnyOf().get(i)); + if (anyOfElement.getEnum() != null && anyOfElement.getEnum().size() == 1) { + if ("null".equals(String.valueOf(anyOfElement.getEnum().get(0)))) { + schema.setNullable(true); + schema.getAnyOf().remove(i); + continue; + } } } // if only one element left, simplify to just the element (schema) if (schema.getAnyOf().size() == 1) { - if (schema.getNullable()) { // retain nullable setting + if (Boolean.TRUE.equals(schema.getNullable())) { // retain nullable setting ((Schema) schema.getAnyOf().get(0)).setNullable(true); } return (Schema) schema.getAnyOf().get(0); @@ -675,5 +758,73 @@ public class OpenAPINormalizer { } } + /** + * If the schema is integer and the max value is invalid (out of bound) + * then add x-unsigned to use unsigned integer/long instead. + * + * @param schema Schema + * @return Schema + */ + private void processAddUnsignedToIntegerWithInvalidMaxValue(Schema schema) { + if (!addUnsignedToIntegerWithInvalidMaxValue && !enableAll) { + return; + } + + if (schema instanceof IntegerSchema) { + if (ModelUtils.isLongSchema(schema)) { + if ("18446744073709551615".equals(String.valueOf(schema.getMaximum())) && + "0".equals(String.valueOf(schema.getMinimum()))) { + schema.addExtension("x-unsigned", true); + } + } else { + if ("4294967295".equals(String.valueOf(schema.getMaximum())) && + "0".equals(String.valueOf(schema.getMinimum()))) { + schema.addExtension("x-unsigned", true); + } + } + } + } + + /* + * When set to true, refactor schema with allOf and properties in the same level to a schema with allOf only and + * the allOf contains a new schema containing the properties in the top level. + * + * @param schema Schema + * @return Schema + */ + private Schema processRefactorAllOfWithPropertiesOnly(Schema schema) { + if (!refactorAllOfWithPropertiesOnly && !enableAll) { + return schema; + } + + ObjectSchema os = new ObjectSchema(); + // set the properties, etc of the new schema to the properties of schema + os.setProperties(schema.getProperties()); + os.setRequired(schema.getRequired()); + os.setAdditionalProperties(schema.getAdditionalProperties()); + os.setNullable(schema.getNullable()); + os.setDescription(schema.getDescription()); + os.setDeprecated(schema.getDeprecated()); + os.setExample(schema.getExample()); + os.setExamples(schema.getExamples()); + os.setTitle(schema.getTitle()); + schema.getAllOf().add(os); // move new schema as a child schema of allOf + // clean up by removing properties, etc + schema.setProperties(null); + schema.setRequired(null); + schema.setAdditionalProperties(null); + schema.setNullable(null); + schema.setDescription(null); + schema.setDeprecated(null); + schema.setExample(null); + schema.setExamples(null); + schema.setTitle(null); + + // at this point the schema becomes a simple allOf (no properties) with an additional schema containing + // the properties + + return schema; + } + // ===================== end of rules ===================== } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index 33a13db3351..651a015111b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -70,6 +70,10 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co protected String packageCompany = "OpenAPI"; protected String packageCopyright = "No Copyright"; protected String packageAuthors = "OpenAPI"; + public static final String DATE_FORMAT = "dateFormat"; + protected String dateFormat = "yyyy'-'MM'-'dd"; + public static final String DATETIME_FORMAT = "dateTimeFormat"; + protected String dateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; protected String interfacePrefix = "I"; protected String enumNameSuffix = "Enum"; @@ -160,8 +164,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co "decimal", "int?", "int", + "uint", + "uint?", "long?", "long", + "ulong", + "ulong?", "float?", "float", "byte[]", @@ -197,8 +205,10 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co typeMapping.put("ByteArray", "byte[]"); typeMapping.put("boolean", "bool?"); typeMapping.put("integer", "int?"); - typeMapping.put("float", "float?"); + typeMapping.put("UnsignedInteger", "uint?"); + typeMapping.put("UnsignedLong", "ulong?"); typeMapping.put("long", "long?"); + typeMapping.put("float", "float?"); typeMapping.put("double", "double?"); typeMapping.put("number", "decimal?"); typeMapping.put("BigDecimal", "decimal?"); @@ -215,11 +225,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // nullable type nullableType = new HashSet<>( - Arrays.asList("decimal", "bool", "int", "float", "long", "double", "DateTime", "DateTimeOffset", "Guid") + Arrays.asList("decimal", "bool", "int", "uint", "long", "ulong", "float", "double", + "DateTime", "DateTimeOffset", "Guid") ); // value Types valueTypes = new HashSet<>( - Arrays.asList("decimal", "bool", "int", "float", "long", "double") + Arrays.asList("decimal", "bool", "int", "uint", "long", "ulong", "float", "double") ); this.setSortParamsByRequiredFlag(true); @@ -326,6 +337,20 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co additionalProperties.put(CodegenConstants.PACKAGE_PRODUCTNAME, packageProductName); } + // {{dateFormat}} + if (additionalProperties.containsKey(DATE_FORMAT)) { + setDateFormat((String) additionalProperties.get(DATE_FORMAT)); + } else { + additionalProperties.put(DATE_FORMAT, this.dateFormat); + } + + // {{dateTimeFormat}} + if (additionalProperties.containsKey(DATETIME_FORMAT)) { + setDateTimeFormat((String) additionalProperties.get(DATETIME_FORMAT)); + } else { + additionalProperties.put(DATETIME_FORMAT, this.dateTimeFormat); + } + // {{packageDescription}} if (additionalProperties.containsKey(CodegenConstants.PACKAGE_DESCRIPTION)) { setPackageDescription((String) additionalProperties.get(CodegenConstants.PACKAGE_DESCRIPTION)); @@ -527,14 +552,19 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } // fix incorrect data types for maps of maps - if (property.datatypeWithEnum.contains("List>") && property.items != null) { - property.datatypeWithEnum = property.datatypeWithEnum.replace("List>", property.items.datatypeWithEnum + ">"); + if (property.datatypeWithEnum.endsWith(", List>") && property.items != null) { + property.datatypeWithEnum = property.datatypeWithEnum.replace(", List>", ", " + property.items.datatypeWithEnum + ">"); property.dataType = property.datatypeWithEnum; } - if (property.datatypeWithEnum.contains("Dictionary>") && property.items != null) { - property.datatypeWithEnum = property.datatypeWithEnum.replace("Dictionary>", property.items.datatypeWithEnum + ">"); + if (property.datatypeWithEnum.endsWith(", Dictionary>") && property.items != null) { + property.datatypeWithEnum = property.datatypeWithEnum.replace(", Dictionary>", ", " + property.items.datatypeWithEnum + ">"); property.dataType = property.datatypeWithEnum; } + + // HOTFIX: https://github.com/OpenAPITools/openapi-generator/issues/14944 + if (property.datatypeWithEnum.equals("decimal")) { + property.isDecimal = true; + } } /** Mitigates https://github.com/OpenAPITools/openapi-generator/issues/13709 */ @@ -1262,6 +1292,14 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co this.packageProductName = packageProductName; } + public void setDateFormat(String dateFormat) { + this.dateFormat = dateFormat; + } + + public void setDateTimeFormat(String dateTimeFormat) { + this.dateTimeFormat = dateTimeFormat; + } + public void setPackageDescription(String packageDescription) { this.packageDescription = packageDescription; } @@ -1334,7 +1372,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // Per: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/enum // The approved types for an enum are byte, sbyte, short, ushort, int, uint, long, or ulong. // but we're not supporting unsigned integral types or shorts. - if (datatype.startsWith("int") || datatype.startsWith("long") || datatype.startsWith("byte")) { + if (datatype.startsWith("int") || datatype.startsWith("uint") || + datatype.startsWith("long") || datatype.startsWith("ulong") || + datatype.startsWith("byte")) { return value; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index 9ddfc6e42c9..e542f21b74f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -555,8 +555,8 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { public CodegenProperty fromProperty(String name, Schema p, boolean required) { final CodegenProperty property = super.fromProperty(name, p, required); - // Handle composed properties - if (ModelUtils.isComposedSchema(p)) { + // Handle composed properties and it's NOT allOf with a single ref only + if (ModelUtils.isComposedSchema(p) && !(ModelUtils.isAllOf(p) && p.getAllOf().size() == 1)) { ComposedSchema composed = (ComposedSchema) p; // Count the occurrences of allOf/anyOf/oneOf with exactly one child element 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 a72ca4a6f35..9e7c78f8db4 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 @@ -145,8 +145,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege "float32", "float64") ); - importMapping = new HashMap<>(); - cliOptions.clear(); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Go package name (convention: lowercase).") .defaultValue("openapi")); @@ -225,7 +223,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege @Override protected boolean isReservedWord(String word) { - return word != null && reservedWords.contains(word); + return word != null && (reservedWords.contains(word) || reservedWordsMappings().containsKey(word)); } @Override @@ -407,7 +405,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege public String getSchemaType(Schema p) { String openAPIType = super.getSchemaType(p); String ref = p.get$ref(); - String type = null; + String type; if (ref != null && !ref.isEmpty()) { type = toModelName(openAPIType); 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 4a4c1af61de..662a3d68e80 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 @@ -1051,7 +1051,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code schema = ModelUtils.getReferencedSchema(this.openAPI, schema); if (ModelUtils.isArraySchema(schema)) { if (schema.getDefault() == null) { - if (cp.isNullable || containerDefaultToNull) { // nullable or containerDefaultToNull set to true + // nullable, optional or containerDefaultToNull set to true + if (cp.isNullable || !cp.required || containerDefaultToNull) { return null; } else { if (ModelUtils.isSet(schema)) { @@ -2286,6 +2287,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code operation.allParams.add(p); } } + operation.hasParams = !operation.allParams.isEmpty(); } private boolean shouldBeImplicitHeader(CodegenParameter parameter) { 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 023a2b412fe..3a06a5b1127 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 @@ -44,7 +44,7 @@ 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' or 'jackson'"; + public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson' or 'jackson or 'kotlinx_serialization'"; public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson, jackson, kotlinx_serialization} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 779a71ccf60..89ac30bb52d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -25,10 +25,10 @@ import io.swagger.v3.oas.models.parameters.Parameter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenConstants.ENUM_PROPERTY_NAMING_TYPE; import org.openapitools.codegen.CodegenConstants.MODEL_PROPERTY_NAMING_TYPE; import org.openapitools.codegen.CodegenConstants.PARAM_NAMING_TYPE; -import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; @@ -46,7 +46,8 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen.ParameterExpander.ParamStyle.*; +import static org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen.ParameterExpander.ParamStyle.form; +import static org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen.ParameterExpander.ParamStyle.simple; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -392,10 +393,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp setParamNaming((String) additionalProperties.get(CodegenConstants.PARAM_NAMING)); } - if (additionalProperties.containsKey(CodegenConstants.SUPPORTS_ES6)) { - setSupportsES6(Boolean.valueOf(additionalProperties.get(CodegenConstants.SUPPORTS_ES6).toString())); - additionalProperties.put("supportsES6", getSupportsES6()); - } + setSupportsES6(convertPropertyToBooleanAndWriteBack(CodegenConstants.SUPPORTS_ES6)); if (additionalProperties.containsKey(NULL_SAFE_ADDITIONAL_PROPS)) { setNullSafeAdditionalProps(Boolean.valueOf(additionalProperties.get(NULL_SAFE_ADDITIONAL_PROPS).toString())); @@ -839,7 +837,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp if ("number".equals(datatype) || "boolean".equals(datatype)) { return value; } else { - return "\'" + escapeText(value) + "\'"; + return "'" + escapeText(value) + "'"; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index 153d9b4b471..4960f7b9219 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -123,8 +123,10 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { typeMapping.put("boolean", "bool"); typeMapping.put("integer", "int"); - typeMapping.put("float", "float"); typeMapping.put("long", "long"); + typeMapping.put("UnsignedInteger", "uint"); + typeMapping.put("UnsignedLong", "ulong"); + typeMapping.put("float", "float"); typeMapping.put("double", "double"); typeMapping.put("number", "decimal"); typeMapping.put("decimal", "decimal"); @@ -789,7 +791,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { } // number - if (datatype.startsWith("int") || datatype.startsWith("long") || + if (datatype.startsWith("int") || datatype.startsWith("uint") || + datatype.startsWith("ulong") || datatype.startsWith("long") || datatype.startsWith("double") || datatype.startsWith("float")) { String varName = "NUMBER_" + value; varName = varName.replaceAll("-", "MINUS_"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java deleted file mode 100644 index d9b2f5d5c22..00000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import org.openapitools.codegen.CliOption; -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.openapitools.codegen.meta.features.DocumentationFeature; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; - -public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen { - private final Logger LOGGER = LoggerFactory.getLogger(CSharpDotNet2ClientCodegen.class); - - public static final String CLIENT_PACKAGE = "clientPackage"; - protected String clientPackage = "Org.OpenAPITools.Client"; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; - - public CSharpDotNet2ClientCodegen() { - super(); - - modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.DEPRECATED) - .build(); - - // clear import mapping (from default generator) as C# (2.0) does not use it - // at the moment - importMapping.clear(); - - modelTemplateFiles.put("model.mustache", ".cs"); - apiTemplateFiles.put("api.mustache", ".cs"); - - setApiPackage(packageName + ".Api"); - setModelPackage(packageName + ".Model"); - setClientPackage(packageName + ".Client"); - setSourceFolder("src" + File.separator + "main" + File.separator + "CsharpDotNet2"); - - modelDocTemplateFiles.put("model_doc.mustache", ".md"); - apiDocTemplateFiles.put("api_doc.mustache", ".md"); - - cliOptions.clear(); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, - "C# package name (convention: Camel.Case).") - .defaultValue(packageName)); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, - "C# package version.") - .defaultValue(packageVersion)); - cliOptions.add(new CliOption(CLIENT_PACKAGE, - "C# client package name (convention: Camel.Case).") - .defaultValue(clientPackage)); - } - - @Override - public void processOpts() { - LOGGER.warn("Per Microsoft Product Lifecycle (https://support.microsoft.com/en-us/lifecycle/search?sort=PN&alpha=.NET%20Framework&Filter=FilterNO), support for .NET Framework 2.0 ended in 2011 so there may be security issues using the auto-generated C# 2.0 source code."); - - super.processOpts(); - - if (additionalProperties.containsKey(CLIENT_PACKAGE)) { - setClientPackage((String) additionalProperties.get(CLIENT_PACKAGE)); - } else { - additionalProperties.put(CLIENT_PACKAGE, getClientPackage()); - } - - final String clientPackage = getClientPackage(); - final String clientPackagePath = clientPackage.replace(".", java.io.File.separator); - - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - supportingFiles.add(new SupportingFile("Configuration.mustache", - sourceFolder + File.separator + clientPackagePath, "Configuration.cs")); - supportingFiles.add(new SupportingFile("ApiClient.mustache", - sourceFolder + File.separator + clientPackagePath, "ApiClient.cs")); - supportingFiles.add(new SupportingFile("ApiException.mustache", - sourceFolder + File.separator + clientPackagePath, "ApiException.cs")); - supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config")); - supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh")); - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); - } - - @Override - public String apiPackage() { - return packageName + ".Api"; - } - - @Override - public String modelPackage() { - return packageName + ".Model"; - } - - public String getClientPackage() { - return clientPackage; - } - - public void setClientPackage(String clientPackage) { - this.clientPackage = clientPackage; - } - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "csharp-dotnet2"; - } - - @Override - public String getHelp() { - return "Generates a C# .Net 2.0 client library (beta)."; - } - - @Override - public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar); - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); - } - - @Override - public String apiDocFileFolder() { - return outputFolder + File.separator + apiDocPath.replace('/', File.separatorChar); - } - - @Override - public String modelDocFileFolder() { - return outputFolder + File.separator + modelDocPath.replace('/', File.separatorChar); - } - -} 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 184df911737..6f2e45208ef 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 @@ -61,6 +61,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { protected static final String RESTSHARP = "restsharp"; protected static final String HTTPCLIENT = "httpclient"; protected static final String GENERICHOST = "generichost"; + protected static final String UNITY_WEB_REQUEST = "unityWebRequest"; // Project Variable, determined from target framework. Not intended to be user-settable. protected static final String TARGET_FRAMEWORK_IDENTIFIER = "targetFrameworkIdentifier"; @@ -100,6 +101,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { protected boolean supportsRetry = Boolean.TRUE; protected boolean supportsAsync = Boolean.TRUE; protected boolean netStandard = Boolean.FALSE; + protected boolean supportsFileParameters = Boolean.TRUE; protected boolean validatable = Boolean.TRUE; protected Map regexModifiers; @@ -115,6 +117,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { protected boolean needsCustomHttpMethod = false; protected boolean needsUriBuilder = false; + // skip generation of getter for oneOf/anyOf sub-schemas to avoid duplicate getter + // when the subschemas are of the same type but with different constraints (e.g. array of string) + protected boolean skipOneOfAnyOfGetter = false; + public CSharpNetCoreClientCodegen() { super(); @@ -151,8 +157,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { typeMapping.put("ByteArray", "byte[]"); typeMapping.put("boolean", "bool"); typeMapping.put("integer", "int"); - typeMapping.put("float", "float"); typeMapping.put("long", "long"); + typeMapping.put("UnsignedInteger", "uint"); + typeMapping.put("UnsignedLong", "ulong"); + typeMapping.put("float", "float"); typeMapping.put("double", "double"); typeMapping.put("number", "decimal"); typeMapping.put("decimal", "decimal"); @@ -215,6 +223,14 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { CodegenConstants.PACKAGE_TAGS_DESC, this.packageTags); + addOption(DATE_FORMAT, + "The default Date format (only `generichost` library supports this option).", + this.dateFormat); + + addOption(DATETIME_FORMAT, + "The default DateTime format (only `generichost` library supports this option).", + this.dateTimeFormat); + CliOption framework = new CliOption( CodegenConstants.DOTNET_FRAMEWORK, CodegenConstants.DOTNET_FRAMEWORK_DESC @@ -309,12 +325,16 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { addSwitch(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC, - this.caseInsensitiveResponseHeaders); + this.useOneOfDiscriminatorLookup); addSwitch(CodegenConstants.CASE_INSENSITIVE_RESPONSE_HEADERS, CodegenConstants.CASE_INSENSITIVE_RESPONSE_HEADERS_DESC, this.caseInsensitiveResponseHeaders); + addSwitch(CodegenConstants.SKIP_ONEOF_ANYOF_GETTER, + CodegenConstants.SKIP_ONEOF_ANYOF_GETTER_DESC, + this.skipOneOfAnyOfGetter); + regexModifiers = new HashMap<>(); regexModifiers.put('i', "IgnoreCase"); regexModifiers.put('m', "Multiline"); @@ -325,6 +345,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { + "(Experimental. Subject to breaking changes without notice.)"); supportedLibraries.put(HTTPCLIENT, "HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) " + "(Experimental. Subject to breaking changes without notice.)"); + supportedLibraries.put(UNITY_WEB_REQUEST, "UnityWebRequest (...) " + + "(Experimental. Subject to breaking changes without notice.)"); supportedLibraries.put(RESTSHARP, "RestSharp (https://github.com/restsharp/RestSharp)"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "HTTP library template (sub-template) to use"); @@ -701,6 +723,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { setLibrary(HTTPCLIENT); additionalProperties.put("useHttpClient", true); needsUriBuilder = true; + } else if (UNITY_WEB_REQUEST.equals(getLibrary())) { + setLibrary(UNITY_WEB_REQUEST); + additionalProperties.put("useUnityWebRequest", true); + needsUriBuilder = true; } else { throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only restsharp, httpclient, and generichost are supported."); } @@ -780,6 +806,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { syncBooleanProperty(additionalProperties, CodegenConstants.OPTIONAL_METHOD_ARGUMENT, this::setOptionalMethodArgumentFlag, optionalMethodArgumentFlag); syncBooleanProperty(additionalProperties, CodegenConstants.NON_PUBLIC_API, this::setNonPublicApi, isNonPublicApi()); syncBooleanProperty(additionalProperties, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup, this.useOneOfDiscriminatorLookup); + syncBooleanProperty(additionalProperties, CodegenConstants.SKIP_ONEOF_ANYOF_GETTER, this::setSkipOneOfAnyOfGetter, this.skipOneOfAnyOfGetter); + syncBooleanProperty(additionalProperties, "supportsFileParameters", this::setSupportsFileParameters, this.supportsFileParameters); final String testPackageName = testPackageName(); String packageFolder = sourceFolder + File.separator + packageName; @@ -816,6 +844,20 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { addGenericHostSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir); additionalProperties.put("apiDocPath", apiDocPath + File.separatorChar + "apis"); additionalProperties.put("modelDocPath", modelDocPath + File.separatorChar + "models"); + } else if (UNITY_WEB_REQUEST.equals(getLibrary())) { + additionalProperties.put(CodegenConstants.VALIDATABLE, false); + setValidatable(false); + setSupportsRetry(false); + setSupportsAsync(true); + // Some consoles and tvOS do not support either Application.persistentDataPath or will refuse to + // compile/link if you even reference GetTempPath as well. + additionalProperties.put("supportsFileParameters", false); + setSupportsFileParameters(false); + + addSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir, authPackageDir); + + supportingFiles.add(new SupportingFile("ConnectionException.mustache", clientPackageDir, "ConnectionException.cs")); + supportingFiles.add(new SupportingFile("UnexpectedResponseException.mustache", clientPackageDir, "UnexpectedResponseException.cs")); } else { //restsharp addSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir, authPackageDir); additionalProperties.put("apiDocPath", apiDocPath); @@ -827,6 +869,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { supportingFiles.add(new SupportingFile("auth/OAuthFlow.mustache", authPackageDir, "OAuthFlow.cs")); } } + + // include the spec in the output + supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); + } public void setClientPackage(String clientPackage) { @@ -911,14 +957,24 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); - supportingFiles.add(new SupportingFile("Solution.mustache", "", packageName + ".sln")); - supportingFiles.add(new SupportingFile("netcore_project.mustache", packageFolder, packageName + ".csproj")); - - if (Boolean.FALSE.equals(excludeTests.get())) { - supportingFiles.add(new SupportingFile("netcore_testproject.mustache", testPackageFolder, testPackageName + ".csproj")); + if (UNITY_WEB_REQUEST.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("asmdef.mustache", packageFolder, packageName + ".asmdef")); + } else { + supportingFiles.add(new SupportingFile("Solution.mustache", "", packageName + ".sln")); + supportingFiles.add(new SupportingFile("netcore_project.mustache", packageFolder, packageName + ".csproj")); } - supportingFiles.add(new SupportingFile("appveyor.mustache", "", "appveyor.yml")); + if (Boolean.FALSE.equals(excludeTests.get())) { + if (UNITY_WEB_REQUEST.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("asmdef_test.mustache", testPackageFolder, testPackageName + ".asmdef")); + } else { + supportingFiles.add(new SupportingFile("netcore_testproject.mustache", testPackageFolder, testPackageName + ".csproj")); + } + } + + if (!UNITY_WEB_REQUEST.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("appveyor.mustache", "", "appveyor.yml")); + } supportingFiles.add(new SupportingFile("AbstractOpenAPISchema.mustache", modelPackageDir, "AbstractOpenAPISchema.cs")); } @@ -1048,6 +1104,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { this.supportsAsync = supportsAsync; } + public void setSupportsFileParameters(Boolean supportsFileParameters) { + this.supportsFileParameters = supportsFileParameters; + } + public void setSupportsRetry(Boolean supportsRetry) { this.supportsRetry = supportsRetry; } @@ -1127,6 +1187,14 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { return this.useOneOfDiscriminatorLookup; } + public void setSkipOneOfAnyOfGetter(boolean skipOneOfAnyOfGetter) { + this.skipOneOfAnyOfGetter = skipOneOfAnyOfGetter; + } + + public boolean getSkipOneOfAnyOfGetter() { + return this.skipOneOfAnyOfGetter; + } + @Override public String toEnumVarName(String value, String datatype) { if (value.length() == 0) { @@ -1139,7 +1207,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { } // number - if (datatype.startsWith("int") || datatype.startsWith("long") || + if (datatype.startsWith("int") || datatype.startsWith("uint") || + datatype.startsWith("long") || datatype.startsWith("ulong") || datatype.startsWith("double") || datatype.startsWith("float")) { String varName = "NUMBER_" + value; varName = varName.replaceAll("-", "MINUS_"); @@ -1593,4 +1662,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { // process 'additionalProperties' setAddProps(schema, m); } + + @Override + public Map postProcessSupportingFileData(Map objs) { + generateYAMLSpecFile(objs); + return objs; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 4cc8fddad64..6d127c990f5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -337,12 +337,6 @@ public class DartDioClientCodegen extends AbstractDartCodegen { objs = super.postProcessModels(objs); List models = objs.getModels(); ProcessUtils.addIndexToProperties(models, 1); - - for (ModelMap mo : models) { - CodegenModel cm = mo.getModel(); - cm.imports = rewriteImports(cm.imports, true); - cm.vendorExtensions.put("x-has-vars", !cm.vars.isEmpty()); - } return objs; } @@ -583,6 +577,16 @@ public class DartDioClientCodegen extends AbstractDartCodegen { adaptToDartInheritance(objs); syncRootTypesWithInnerVars(objs); } + + // loop through models to update the imports + for (ModelsMap entry : objs.values()) { + for (ModelMap mo : entry.getModels()) { + CodegenModel cm = mo.getModel(); + cm.imports = rewriteImports(cm.imports, true); + cm.vendorExtensions.put("x-has-vars", !cm.vars.isEmpty()); + } + } + return objs; } @@ -730,6 +734,10 @@ public class DartDioClientCodegen extends AbstractDartCodegen { resultImports.add(i); } else if (importMapping().containsKey(modelImport)) { resultImports.add(importMapping().get(modelImport)); + } else if (modelImport.startsWith("dart:")) { // import dart:* directly + resultImports.add(modelImport); + } else if (modelImport.startsWith("package:")) { // e.g. package:openapi/src/model/child.dart + resultImports.add(modelImport); } else { resultImports.add("package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/" + underscore(modelImport) + ".dart"); } 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 c9f45740d3a..ad4aa914a21 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 @@ -71,6 +71,7 @@ public class GoClientCodegen extends AbstractGoCodegen { .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) .securityFeatures(EnumSet.of( SecurityFeature.BasicAuth, + SecurityFeature.BearerToken, SecurityFeature.ApiKey, SecurityFeature.OAuth2_Implicit )) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java index 4bb58c88e50..b6dd22cbfd3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java @@ -50,6 +50,8 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen imp // Use standard types typeMapping.put("DateTime", "java.util.Date"); + typeMapping.put("binary", "java.io.InputStream"); + typeMapping.put("file", "java.io.InputStream"); // Updated template directory embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf-cdi"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java index 9e8d2140fdc..cdf8b8a1fcf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java @@ -13,12 +13,20 @@ import org.openapitools.codegen.meta.Stability; public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { public static final String OPT_CONFIGURE_AUTH = "configureAuth"; + public static final String OPT_CONFIGURE_AUTH_FILTER_PATTERN = "configureAuthFilterPattern"; + public static final String OPT_CONFIGURE_CLIENT_ID = "configureClientId"; public static final String ADDITIONAL_CLIENT_TYPE_ANNOTATIONS = "additionalClientTypeAnnotations"; + public static final String AUTHORIZATION_FILTER_PATTERN = "authorizationFilterPattern"; + public static final String BASE_PATH_SEPARATOR = "basePathSeparator"; + public static final String CLIENT_ID = "clientId"; public static final String NAME = "java-micronaut-client"; protected boolean configureAuthorization; protected List additionalClientTypeAnnotations; + protected String authorizationFilterPattern; + protected String basePathSeparator = "-"; + protected String clientId; public JavaMicronautClientCodegen() { super(); @@ -33,6 +41,9 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { cliOptions.add(CliOption.newBoolean(OPT_CONFIGURE_AUTH, "Configure all the authorization methods as specified in the file", configureAuthorization)); cliOptions.add(CliOption.newString(ADDITIONAL_CLIENT_TYPE_ANNOTATIONS, "Additional annotations for client type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); + cliOptions.add(CliOption.newString(AUTHORIZATION_FILTER_PATTERN, "Configure the authorization filter pattern for the client. Generally defined when generating clients from multiple specification files")); + cliOptions.add(CliOption.newString(BASE_PATH_SEPARATOR, "Configure the separator to use between the application name and base path when referencing the property").defaultValue(basePathSeparator)); + cliOptions.add(CliOption.newString(CLIENT_ID, "Configure the service ID for the Client")); } @Override @@ -66,6 +77,14 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { // Write property that is present in server writePropertyBack(OPT_USE_AUTH, true); + writePropertyBack(OPT_CONFIGURE_AUTH_FILTER_PATTERN, false); + writePropertyBack(OPT_CONFIGURE_CLIENT_ID, false); + + if(additionalProperties.containsKey(BASE_PATH_SEPARATOR)) { + basePathSeparator = additionalProperties.get(BASE_PATH_SEPARATOR).toString(); + } + writePropertyBack(BASE_PATH_SEPARATOR, basePathSeparator); + final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); // Authorization files @@ -79,6 +98,12 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { supportingFiles.add(new SupportingFile("client/auth/configuration/ApiKeyAuthConfiguration.mustache", authConfigurationFolder, "ApiKeyAuthConfiguration.java")); supportingFiles.add(new SupportingFile("client/auth/configuration/ConfigurableAuthorization.mustache", authConfigurationFolder, "ConfigurableAuthorization.java")); supportingFiles.add(new SupportingFile("client/auth/configuration/HttpBasicAuthConfiguration.mustache", authConfigurationFolder, "HttpBasicAuthConfiguration.java")); + + if (additionalProperties.containsKey(AUTHORIZATION_FILTER_PATTERN)) { + String pattern = additionalProperties.get(AUTHORIZATION_FILTER_PATTERN).toString(); + this.setAuthorizationFilterPattern(pattern); + additionalProperties.put(AUTHORIZATION_FILTER_PATTERN, authorizationFilterPattern); + } } if (additionalProperties.containsKey(ADDITIONAL_CLIENT_TYPE_ANNOTATIONS)) { @@ -87,6 +112,18 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { additionalProperties.put(ADDITIONAL_CLIENT_TYPE_ANNOTATIONS, additionalClientTypeAnnotations); } + if (additionalProperties.containsKey(CLIENT_ID)) { + String id = additionalProperties.get(CLIENT_ID).toString(); + this.setClientId(id); + additionalProperties.put(CLIENT_ID, clientId); + } + + if (additionalProperties.containsKey(BASE_PATH_SEPARATOR)) { + String separator = additionalProperties.get(BASE_PATH_SEPARATOR).toString(); + this.setBasePathSeparator(separator); + additionalProperties.put(BASE_PATH_SEPARATOR, basePathSeparator); + } + // Api file apiTemplateFiles.clear(); apiTemplateFiles.put("client/api.mustache", ".java"); @@ -109,4 +146,18 @@ public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { public void setAdditionalClientTypeAnnotations(final List additionalClientTypeAnnotations) { this.additionalClientTypeAnnotations = additionalClientTypeAnnotations; } + + public void setAuthorizationFilterPattern(final String pattern) { + writePropertyBack(OPT_CONFIGURE_AUTH_FILTER_PATTERN, true); + this.authorizationFilterPattern = pattern; + } + + public void setClientId(final String id) { + writePropertyBack(OPT_CONFIGURE_CLIENT_ID, true); + this.clientId = id; + } + + public void setBasePathSeparator(final String separator) { + this.basePathSeparator = separator; + } } 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 994b4b052cc..447e1c1f889 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 @@ -74,6 +74,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { public static final String ROOM_MODEL_PACKAGE = "roomModelPackage"; public static final String OMIT_GRADLE_PLUGIN_VERSIONS = "omitGradlePluginVersions"; public static final String OMIT_GRADLE_WRAPPER = "omitGradleWrapper"; + public static final String USE_SETTINGS_GRADLE = "useSettingsGradle"; public static final String IDEA = "idea"; public static final String DATE_LIBRARY = "dateLibrary"; @@ -238,6 +239,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines adapter with the retrofit2 library.")); cliOptions.add(CliOption.newBoolean(OMIT_GRADLE_PLUGIN_VERSIONS, "Whether to declare Gradle plugin versions in build files.")); cliOptions.add(CliOption.newBoolean(OMIT_GRADLE_WRAPPER, "Whether to omit Gradle wrapper for creating a sub project.")); + cliOptions.add(CliOption.newBoolean(USE_SETTINGS_GRADLE, "Whether the project uses settings.gradle.")); cliOptions.add(CliOption.newBoolean(IDEA, "Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.")); cliOptions.add(CliOption.newBoolean(MOSHI_CODE_GEN, "Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 266cb6ccbad..2be4589572a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -66,6 +66,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen public static final String GRADLE_BUILD_FILE = "gradleBuildFile"; public static final String SERVICE_INTERFACE = "serviceInterface"; public static final String SERVICE_IMPLEMENTATION = "serviceImplementation"; + public static final String SKIP_DEFAULT_INTERFACE = "skipDefaultInterface"; public static final String REACTIVE = "reactive"; public static final String INTERFACE_ONLY = "interfaceOnly"; public static final String DELEGATE_PATTERN = "delegatePattern"; @@ -79,6 +80,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen private String serverPort = "8080"; private String title = "OpenAPI Kotlin Spring"; private boolean useBeanValidation = true; + private boolean skipDefaultInterface = false; private boolean exceptionHandler = true; private boolean gradleBuildFile = true; private boolean useSwaggerUI = true; @@ -153,6 +155,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen addSwitch(SERVICE_IMPLEMENTATION, "generate stub service implementations that extends service " + "interfaces. If this is set to true service interfaces will also be generated", serviceImplementation); addSwitch(USE_BEANVALIDATION, "Use BeanValidation API annotations to validate data types", useBeanValidation); + addSwitch(SKIP_DEFAULT_INTERFACE, "Whether to skip generation of default implementations for interfaces", skipDefaultInterface); addSwitch(REACTIVE, "use coroutines for reactive behavior", reactive); addSwitch(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.", interfaceOnly); addSwitch(DELEGATE_PATTERN, "Whether to generate the server files using the delegate pattern", delegatePattern); @@ -334,6 +337,10 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen this.useBeanValidation = useBeanValidation; } + public void setSkipDefaultInterface(boolean skipDefaultInterface) { + this.skipDefaultInterface = skipDefaultInterface; + } + public boolean isReactive() { return reactive; } @@ -492,6 +499,11 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen } writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + if (additionalProperties.containsKey(SKIP_DEFAULT_INTERFACE)) { + this.setSkipDefaultInterface(convertPropertyToBoolean(SKIP_DEFAULT_INTERFACE)); + } + writePropertyBack(SKIP_DEFAULT_INTERFACE, skipDefaultInterface); + if (additionalProperties.containsKey(REACTIVE) && library.equals(SPRING_BOOT)) { this.setReactive(convertPropertyToBoolean(REACTIVE)); // spring webflux doesn't support @ControllerAdvice diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 3eecc392a80..d1184714668 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -2438,8 +2438,17 @@ public class PythonClientCodegen extends AbstractPythonCodegen { if (m.discriminator == null && innerSchema.getDiscriminator() != null) { LOGGER.debug("discriminator is set to null (not correctly set earlier): {}", m.name); m.setDiscriminator(createDiscriminator(m.name, innerSchema, this.openAPI)); + // directly include the function `addDiscriminatorMappedModelsImports` inline below + // as the function has been updated + //m.addDiscriminatorMappedModelsImports(); if (!this.getLegacyDiscriminatorBehavior()) { - m.addDiscriminatorMappedModelsImports(); + if (m.discriminator != null && m.discriminator.getMappedModels() != null) { + for (CodegenDiscriminator.MappedModel mm : m.discriminator.getMappedModels()) { + if (!"".equals(mm.getModelName())) { + m.getImports().add(mm.getModelName()); + } + } + } } modelDiscriminators++; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java index 5f29c5c909a..4c83af570fa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java @@ -47,25 +47,28 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements public static final String PACKAGE_URL = "packageUrl"; public static final String DEFAULT_LIBRARY = "urllib3"; public static final String RECURSION_LIMIT = "recursionLimit"; - public static final String ALLOW_STRING_IN_DATETIME_PARAMETERS = "allowStringInDateTimeParameters"; - public static final String FLOAT_STRICT_TYPE = "floatStrictType"; public static final String DATETIME_FORMAT = "datetimeFormat"; public static final String DATE_FORMAT = "dateFormat"; + public static final String MAP_NUMBER_TO = "mapNumberTo"; protected String packageUrl; protected String apiDocPath = "docs" + File.separator; protected String modelDocPath = "docs" + File.separator; protected boolean hasModelsToImport = Boolean.FALSE; protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup - protected boolean allowStringInDateTimeParameters = false; // use StrictStr instead of datetime in parameters - protected boolean floatStrictType = true; protected String datetimeFormat = "%Y-%m-%dT%H:%M:%S.%f%z"; protected String dateFormat = "%Y-%m-%d"; + protected String mapNumberTo = "Union[StrictFloat, StrictInt]"; protected Map regexModifiers; private String testFolder; + // map of set (model imports) + private HashMap> circularImports = new HashMap<>(); + // map of codegen models + private HashMap codegenModelMap = new HashMap<>(); + public PythonNextgenClientCodegen() { super(); @@ -110,11 +113,15 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements typeMapping.put("array", "List"); typeMapping.put("set", "List"); typeMapping.put("map", "Dict"); - typeMapping.put("file", "str"); typeMapping.put("decimal", "decimal.Decimal"); + typeMapping.put("file", "bytearray"); + typeMapping.put("binary", "bytearray"); + typeMapping.put("ByteArray", "bytearray"); languageSpecificPrimitives.remove("file"); languageSpecificPrimitives.add("decimal.Decimal"); + languageSpecificPrimitives.add("bytearray"); + languageSpecificPrimitives.add("none_type"); supportsInheritance = true; modelPackage = "models"; @@ -172,10 +179,8 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC) .defaultValue(Boolean.FALSE.toString())); cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); - cliOptions.add(new CliOption(ALLOW_STRING_IN_DATETIME_PARAMETERS, "Allow string as input to datetime/date parameters for backward compartibility.") - .defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(FLOAT_STRICT_TYPE, "Use strict type for float, i.e. StrictFloat or confloat(strict=true, ...)") - .defaultValue(Boolean.TRUE.toString())); + cliOptions.add(new CliOption(MAP_NUMBER_TO, "Map number to Union[StrictFloat, StrictInt], StrictStr or float.") + .defaultValue("Union[StrictFloat, StrictInt]")); cliOptions.add(new CliOption(DATETIME_FORMAT, "datetime format for query parameters") .defaultValue("%Y-%m-%dT%H:%M:%S%z")); cliOptions.add(new CliOption(DATE_FORMAT, "date format for query parameters") @@ -278,12 +283,8 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, useOneOfDiscriminatorLookup); } - if (additionalProperties.containsKey(ALLOW_STRING_IN_DATETIME_PARAMETERS)) { - setAllowStringInDateTimeParameters(convertPropertyToBooleanAndWriteBack(ALLOW_STRING_IN_DATETIME_PARAMETERS)); - } - - if (additionalProperties.containsKey(FLOAT_STRICT_TYPE)) { - setFloatStrictType(convertPropertyToBooleanAndWriteBack(FLOAT_STRICT_TYPE)); + if (additionalProperties.containsKey(MAP_NUMBER_TO)) { + setMapNumberTo(String.valueOf(additionalProperties.get(MAP_NUMBER_TO))); } if (additionalProperties.containsKey(DATETIME_FORMAT)) { @@ -321,6 +322,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements supportingFiles.add(new SupportingFile("github-workflow.mustache", ".github/workflows", "python.yml")); supportingFiles.add(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml")); supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py")); + supportingFiles.add(new SupportingFile("pyproject.mustache", "", "pyproject.toml")); } supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py")); supportingFiles.add(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py")); @@ -411,6 +413,8 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements * @param typingImports typing imports * @param pydantic pydantic imports * @param datetimeImports datetime imports + * @param modelImports model imports + * @param classname class name * @return pydantic type * */ @@ -418,12 +422,13 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements Set typingImports, Set pydanticImports, Set datetimeImports, - Set modelImports) { + Set modelImports, + String classname) { if (cp == null) { // if codegen parameter (e.g. map/dict of undefined type) is null, default to string - LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to string (StrictStr in Pydantic)"); - pydanticImports.add("StrictStr"); - return "StrictStr"; + LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any."); + typingImports.add("Any"); + return "Any"; } if (cp.isArray) { @@ -439,11 +444,12 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements } pydanticImports.add("conlist"); return String.format(Locale.ROOT, "conlist(%s%s)", - getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports), + getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, classname), constraints); } else if (cp.isMap) { typingImports.add("Dict"); - return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports)); + return String.format(Locale.ROOT, "Dict[str, %s]", + getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, classname)); } else if (cp.isString || cp.isBinary || cp.isByteArray) { if (cp.hasValidation) { List fieldCustomization = new ArrayList<>(); @@ -474,34 +480,59 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements } else if (cp.isNumber || cp.isFloat || cp.isDouble) { if (cp.hasValidation) { List fieldCustomization = new ArrayList<>(); + List intFieldCustomization = new ArrayList<>(); + // e.g. confloat(ge=10, le=100, strict=True) if (cp.getMaximum() != null) { if (cp.getExclusiveMaximum()) { - fieldCustomization.add("gt=" + cp.getMaximum()); + fieldCustomization.add("lt=" + cp.getMaximum()); + intFieldCustomization.add("lt=" + Math.ceil(Double.valueOf(cp.getMaximum()))); // e.g. < 7.59 becomes < 8 } else { - fieldCustomization.add("ge=" + cp.getMaximum()); + fieldCustomization.add("le=" + cp.getMaximum()); + intFieldCustomization.add("le=" + Math.floor(Double.valueOf(cp.getMaximum()))); // e.g. <= 7.59 becomes <= 7 } } if (cp.getMinimum() != null) { if (cp.getExclusiveMinimum()) { - fieldCustomization.add("lt=" + cp.getMinimum()); + fieldCustomization.add("gt=" + cp.getMinimum()); + intFieldCustomization.add("gt=" + Math.floor(Double.valueOf(cp.getMinimum()))); // e.g. > 7.59 becomes > 7 } else { - fieldCustomization.add("le=" + cp.getMinimum()); + fieldCustomization.add("ge=" + cp.getMinimum()); + intFieldCustomization.add("ge=" + Math.ceil(Double.valueOf(cp.getMinimum()))); // e.g. >= 7.59 becomes >= 8 } } if (cp.getMultipleOf() != null) { fieldCustomization.add("multiple_of=" + cp.getMultipleOf()); } - if (floatStrictType) { + if ("Union[StrictFloat, StrictInt]".equals(mapNumberTo)) { fieldCustomization.add("strict=True"); + intFieldCustomization.add("strict=True"); + pydanticImports.add("confloat"); + pydanticImports.add("conint"); + typingImports.add("Union"); + return String.format(Locale.ROOT, "Union[%s(%s), %s(%s)]", "confloat", + StringUtils.join(fieldCustomization, ", "), + "conint", + StringUtils.join(intFieldCustomization, ", ") + ); + } else if ("StrictFloat".equals(mapNumberTo)) { + fieldCustomization.add("strict=True"); + pydanticImports.add("confloat"); + return String.format(Locale.ROOT, "%s(%s)", "confloat", + StringUtils.join(fieldCustomization, ", ")); + } else { // float + pydanticImports.add("confloat"); + return String.format(Locale.ROOT, "%s(%s)", "confloat", + StringUtils.join(fieldCustomization, ", ")); } - - pydanticImports.add("confloat"); - return String.format(Locale.ROOT, "%s(%s)", "confloat", - StringUtils.join(fieldCustomization, ", ")); } else { - if (floatStrictType) { + if ("Union[StrictFloat, StrictInt]".equals(mapNumberTo)) { + typingImports.add("Union"); + pydanticImports.add("StrictFloat"); + pydanticImports.add("StrictInt"); + return "Union[StrictFloat, StrictInt]"; + } else if ("StrictFloat".equals(mapNumberTo)) { pydanticImports.add("StrictFloat"); return "StrictFloat"; } else { @@ -601,13 +632,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements datetimeImports.add("datetime"); } - if (allowStringInDateTimeParameters) { - pydanticImports.add("StrictStr"); - typingImports.add("Union"); - return String.format(Locale.ROOT, "Union[StrictStr, %s]", cp.dataType); - } else { - return cp.dataType; - } + return cp.dataType; } else if (cp.isUuid) { return cp.dataType; } else if (cp.isFreeFormObject) { // type: object @@ -625,7 +650,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements CodegenMediaType cmt = contents.get(key); // TODO process the first one only at the moment if (cmt != null) - return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports); + return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports, classname); } throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp); } else { @@ -640,6 +665,8 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements * @param typingImports typing imports * @param pydantic pydantic imports * @param datetimeImports datetime imports + * @param modelImports model imports + * @param classname class name * @return pydantic type * */ @@ -647,12 +674,13 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements Set typingImports, Set pydanticImports, Set datetimeImports, - Set modelImports) { + Set modelImports, + String classname) { if (cp == null) { // if codegen property (e.g. map/dict of undefined type) is null, default to string - LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to string (StrictStr in Pydantic)"); - pydanticImports.add("StrictStr"); - return "StrictStr"; + LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any."); + typingImports.add("Any"); + return "Any"; } if (cp.isEnum) { @@ -687,11 +715,11 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements pydanticImports.add("conlist"); typingImports.add("List"); // for return type return String.format(Locale.ROOT, "conlist(%s%s)", - getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports), + getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, classname), constraints); } else if (cp.isMap) { typingImports.add("Dict"); - return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports)); + return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, classname)); } else if (cp.isString) { if (cp.hasValidation) { List fieldCustomization = new ArrayList<>(); @@ -722,34 +750,59 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements } else if (cp.isNumber || cp.isFloat || cp.isDouble) { if (cp.hasValidation) { List fieldCustomization = new ArrayList<>(); + List intFieldCustomization = new ArrayList<>(); + // e.g. confloat(ge=10, le=100, strict=True) if (cp.getMaximum() != null) { if (cp.getExclusiveMaximum()) { fieldCustomization.add("lt=" + cp.getMaximum()); + intFieldCustomization.add("lt=" + (int) Math.ceil(Double.valueOf(cp.getMaximum()))); // e.g. < 7.59 => < 8 } else { fieldCustomization.add("le=" + cp.getMaximum()); + intFieldCustomization.add("le=" + (int) Math.floor(Double.valueOf(cp.getMaximum()))); // e.g. <= 7.59 => <= 7 } } if (cp.getMinimum() != null) { if (cp.getExclusiveMinimum()) { fieldCustomization.add("gt=" + cp.getMinimum()); + intFieldCustomization.add("gt=" + (int) Math.floor(Double.valueOf(cp.getMinimum()))); // e.g. > 7.59 => > 7 } else { fieldCustomization.add("ge=" + cp.getMinimum()); + intFieldCustomization.add("ge=" + (int) Math.ceil(Double.valueOf(cp.getMinimum()))); // e.g. >= 7.59 => >= 8 } } if (cp.getMultipleOf() != null) { fieldCustomization.add("multiple_of=" + cp.getMultipleOf()); } - if (floatStrictType) { + if ("Union[StrictFloat, StrictInt]".equals(mapNumberTo)) { fieldCustomization.add("strict=True"); + intFieldCustomization.add("strict=True"); + pydanticImports.add("confloat"); + pydanticImports.add("conint"); + typingImports.add("Union"); + return String.format(Locale.ROOT, "Union[%s(%s), %s(%s)]", "confloat", + StringUtils.join(fieldCustomization, ", "), + "conint", + StringUtils.join(intFieldCustomization, ", ") + ); + } else if ("StrictFloat".equals(mapNumberTo)) { + fieldCustomization.add("strict=True"); + pydanticImports.add("confloat"); + return String.format(Locale.ROOT, "%s(%s)", "confloat", + StringUtils.join(fieldCustomization, ", ")); + } else { // float + pydanticImports.add("confloat"); + return String.format(Locale.ROOT, "%s(%s)", "confloat", + StringUtils.join(fieldCustomization, ", ")); } - - pydanticImports.add("confloat"); - return String.format(Locale.ROOT, "%s(%s)", "confloat", - StringUtils.join(fieldCustomization, ", ")); } else { - if (floatStrictType) { + if ("Union[StrictFloat, StrictInt]".equals(mapNumberTo)) { + typingImports.add("Union"); + pydanticImports.add("StrictFloat"); + pydanticImports.add("StrictInt"); + return "Union[StrictFloat, StrictInt]"; + } else if ("StrictFloat".equals(mapNumberTo)) { pydanticImports.add("StrictFloat"); return "StrictFloat"; } else { @@ -859,10 +912,24 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements typingImports.add("Any"); return "Dict[str, Any]"; } else if (!cp.isPrimitiveType || cp.isModel) { // model - if (!cp.isCircularReference) { - // skip import if it's a circular reference + // skip import if it's a circular reference + if (classname == null) { + // for parameter model, import directly hasModelsToImport = true; modelImports.add(cp.dataType); + } else { + if (circularImports.containsKey(cp.dataType)) { + if (circularImports.get(cp.dataType).contains(classname)) { + // cp.dataType import map of set contains this model (classname), don't import + LOGGER.debug("Skipped importing {} in {} due to circular import.", cp.dataType, classname); + } else { + // not circular import, so ok to import it + hasModelsToImport = true; + modelImports.add(cp.dataType); + } + } else { + LOGGER.error("Failed to look up {} from the imports (map of set) of models.", cp.dataType); + } } return cp.dataType; } else { @@ -884,7 +951,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements List params = operation.allParams; for (CodegenParameter param : params) { - String typing = getPydanticType(param, typingImports, pydanticImports, datetimeImports, modelImports); + String typing = getPydanticType(param, typingImports, pydanticImports, datetimeImports, modelImports, null); List fields = new ArrayList<>(); String firstField = ""; @@ -936,7 +1003,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements // update typing import for operation return type if (!StringUtils.isEmpty(operation.returnType)) { String typing = getPydanticType(operation.returnProperty, typingImports, - new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports); + new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports, null); } } @@ -996,6 +1063,18 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements @Override public Map postProcessAllModels(Map objs) { final Map processed = super.postProcessAllModels(objs); + + for (Map.Entry entry : objs.entrySet()) { + // create hash map of codegen model + CodegenModel cm = ModelUtils.getModelByName(entry.getKey(), objs); + codegenModelMap.put(cm.classname, ModelUtils.getModelByName(entry.getKey(), objs)); + } + + // create circular import + for (String m : codegenModelMap.keySet()) { + createImportMapOfSet(m, codegenModelMap); + } + for (Map.Entry entry : processed.entrySet()) { entry.setValue(postProcessModelsMap(entry.getValue())); } @@ -1003,6 +1082,99 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements return processed; } + /** + * Update circularImports with the model name (key) and its imports gathered recursively + * + * @param modelName model name + * @param codegenModelMap a map of CodegenModel + */ + void createImportMapOfSet(String modelName, Map codegenModelMap) { + HashSet imports = new HashSet<>(); + circularImports.put(modelName, imports); + + CodegenModel cm = codegenModelMap.get(modelName); + + if (cm == null) { + LOGGER.warn("Failed to lookup model in createImportMapOfSet: " + modelName); + return; + } + + List codegenProperties = null; + if (cm.oneOf != null && !cm.oneOf.isEmpty()) { // oneOf + codegenProperties = cm.getComposedSchemas().getOneOf(); + } else if (cm.anyOf != null && !cm.anyOf.isEmpty()) { // anyOF + codegenProperties = cm.getComposedSchemas().getAnyOf(); + } else { // typical model + codegenProperties = cm.vars; + } + + for (CodegenProperty cp : codegenProperties) { + String modelNameFromDataType = getModelNameFromDataType(cp); + if (modelNameFromDataType != null) { // model + imports.add(modelNameFromDataType); // update import + // go through properties or sub-schemas of the model recursively to identify more (model) import if any + updateImportsFromCodegenModel(modelNameFromDataType, codegenModelMap.get(modelNameFromDataType), imports); + } + } + } + + /** + * Update set of imports from codegen model recursivly + * + * @param modelName model name + * @param cm codegen model + * @param imports set of imports + */ + public void updateImportsFromCodegenModel(String modelName, CodegenModel cm, Set imports) { + if (cm == null) { + LOGGER.warn("Failed to lookup model in createImportMapOfSet " + modelName); + return; + } + + List codegenProperties = null; + if (cm.oneOf != null && !cm.oneOf.isEmpty()) { // oneOfValidationError + codegenProperties = cm.getComposedSchemas().getOneOf(); + } else if (cm.anyOf != null && !cm.anyOf.isEmpty()) { // anyOF + codegenProperties = cm.getComposedSchemas().getAnyOf(); + } else { // typical model + codegenProperties = cm.vars; + } + + for (CodegenProperty cp : codegenProperties) { + String modelNameFromDataType = getModelNameFromDataType(cp); + if (modelNameFromDataType != null) { // model + if (modelName.equals(modelNameFromDataType)) { // self referencing + continue; + } else if (imports.contains(modelNameFromDataType)) { // circular import + continue; + } else { + imports.add(modelNameFromDataType); // update import + // go through properties of the model recursively to identify more (model) import if any + updateImportsFromCodegenModel(modelNameFromDataType, codegenModelMap.get(modelNameFromDataType), imports); + } + } + } + } + + /** + * Returns the model name (if any) from data type of codegen property. + * Returns null if it's not a model. + * + * @param cp Codegen property + * @return model name + */ + private String getModelNameFromDataType(CodegenProperty cp) { + if (cp.isArray) { + return getModelNameFromDataType(cp.items); + } else if (cp.isMap) { + return getModelNameFromDataType(cp.items); + } else if (!cp.isPrimitiveType || cp.isModel) { + return cp.dataType; + } else { + return null; + } + } + private ModelsMap postProcessModelsMap(ModelsMap objs) { // process enum in models objs = postProcessModelsEnum(objs); @@ -1057,7 +1229,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements //loop through properties/schemas to set up typing, pydantic for (CodegenProperty cp : codegenProperties) { - String typing = getPydanticType(cp, typingImports, pydanticImports, datetimeImports, modelImports); + String typing = getPydanticType(cp, typingImports, pydanticImports, datetimeImports, modelImports, model.classname); List fields = new ArrayList<>(); String firstField = ""; @@ -1214,7 +1386,8 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements } } - vendorExtensions.put("x-regex", regex); + vendorExtensions.put("x-regex", regex.replace("\"", "\\\"")); + vendorExtensions.put("x-pattern", pattern.replace("\"", "\\\"")); vendorExtensions.put("x-modifiers", modifiers); } } @@ -1408,12 +1581,14 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements return "var_" + name; } - public void setAllowStringInDateTimeParameters(boolean allowStringInDateTimeParameters) { - this.allowStringInDateTimeParameters = allowStringInDateTimeParameters; - } - - public void setFloatStrictType(boolean floatStrictType) { - this.floatStrictType = floatStrictType; + public void setMapNumberTo(String mapNumberTo) { + if ("Union[StrictFloat, StrictInt]".equals(mapNumberTo) + || "StrictFloat".equals(mapNumberTo) + || "float".equals(mapNumberTo)) { + this.mapNumberTo = mapNumberTo; + } else { + throw new IllegalArgumentException("mapNumberTo value must be Union[StrictFloat, StrictInt], StrictStr or float"); + } } public void setDatetimeFormat(String datetimeFormat) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 2aeefdbac00..fd7c018a1db 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -241,7 +241,7 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon discriminatorVars.add(mas); } // TODO: figure out how to properly have the original property type that didn't go through toVarName - String vendorExtensionTagName = cm.discriminator.getPropertyName().replace("_", ""); + String vendorExtensionTagName = cm.discriminator.getPropertyName(); cm.vendorExtensions.put("x-tag-name", vendorExtensionTagName); cm.vendorExtensions.put("x-mapped-models", discriminatorVars); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 6f4ba5b519e..78546738da1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -65,6 +65,7 @@ import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.templating.mustache.SplitStringLambda; +import org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda; import org.openapitools.codegen.templating.mustache.TrimWhitespaceLambda; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; @@ -96,6 +97,7 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String SINGLE_CONTENT_TYPES = "singleContentTypes"; public static final String VIRTUAL_SERVICE = "virtualService"; public static final String SKIP_DEFAULT_INTERFACE = "skipDefaultInterface"; + public static final String GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS = "generatedConstructorWithRequiredArgs"; public static final String ASYNC = "async"; public static final String REACTIVE = "reactive"; @@ -109,6 +111,7 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String HATEOAS = "hateoas"; public static final String RETURN_SUCCESS_CODE = "returnSuccessCode"; public static final String UNHANDLED_EXCEPTION_HANDLING = "unhandledException"; + public static final String USE_RESPONSE_ENTITY = "useResponseEntity"; public static final String USE_SPRING_BOOT3 = "useSpringBoot3"; public static final String REQUEST_MAPPING_OPTION = "requestMappingMode"; public static final String USE_REQUEST_MAPPING_ON_CONTROLLER = "useRequestMappingOnController"; @@ -156,7 +159,9 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean unhandledException = false; protected boolean useSpringController = false; protected boolean useSwaggerUI = true; + protected boolean useResponseEntity = true; protected boolean useSpringBoot3 = false; + protected boolean generatedConstructorWithRequiredArgs = true; protected RequestMappingMode requestMappingMode = RequestMappingMode.controller; public SpringCodegen() { @@ -245,9 +250,16 @@ public class SpringCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(USE_SWAGGER_UI, "Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies", useSwaggerUI)); + cliOptions.add(CliOption.newBoolean(USE_RESPONSE_ENTITY, + "Use the `ResponseEntity` type to wrap return values of generated API methods. " + + "If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition", + useResponseEntity)); cliOptions.add(CliOption.newBoolean(USE_SPRING_BOOT3, "Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.", useSpringBoot3)); + cliOptions.add(CliOption.newBoolean(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS, + "Whether to generate constructors with required args for models", + generatedConstructorWithRequiredArgs)); supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application."); supportedLibraries.put(SPRING_CLOUD_LIBRARY, @@ -457,6 +469,11 @@ public class SpringCodegen extends AbstractJavaCodegen } writePropertyBack(SPRING_CONTROLLER, useSpringController); + if (additionalProperties.containsKey(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS)) { + this.generatedConstructorWithRequiredArgs = convertPropertyToBoolean(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS); + } + writePropertyBack(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS, generatedConstructorWithRequiredArgs); + if (additionalProperties.containsKey(RETURN_SUCCESS_CODE)) { this.setReturnSuccessCode(Boolean.parseBoolean(additionalProperties.get(RETURN_SUCCESS_CODE).toString())); } @@ -477,6 +494,13 @@ public class SpringCodegen extends AbstractJavaCodegen } additionalProperties.put(UNHANDLED_EXCEPTION_HANDLING, this.isUnhandledException()); + if (additionalProperties.containsKey(USE_RESPONSE_ENTITY)) { + this.setUseResponseEntity( + Boolean.parseBoolean(additionalProperties.get(USE_RESPONSE_ENTITY).toString())); + } + writePropertyBack(USE_RESPONSE_ENTITY, useResponseEntity); + additionalProperties.put("springHttpStatus", new SpringHttpStatusLambda()); + if (additionalProperties.containsKey(USE_SPRING_BOOT3)) { this.setUseSpringBoot3(convertPropertyToBoolean(USE_SPRING_BOOT3)); } @@ -493,6 +517,7 @@ public class SpringCodegen extends AbstractJavaCodegen } writePropertyBack(USE_SPRING_BOOT3, isUseSpringBoot3()); + typeMapping.put("file", "org.springframework.core.io.Resource"); importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource"); importMapping.put("Pageable", "org.springframework.data.domain.Pageable"); @@ -1018,6 +1043,10 @@ public class SpringCodegen extends AbstractJavaCodegen this.unhandledException = unhandledException; } + public void setUseResponseEntity(boolean useResponseEntity) { + this.useResponseEntity = useResponseEntity; + } + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index d2e050e3162..dbfc9045ec7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -143,7 +143,8 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig "URL", "AnyObject", "Any", - "Decimal") + "Decimal", + "AnyCodable") // from AnyCodable dependency ); defaultIncludes = new HashSet<>( Arrays.asList( @@ -721,11 +722,11 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig // FIXME parameter should not be assigned. Also declare it as "final" name = sanitizeName(name); - if (!StringUtils.isEmpty(modelNameSuffix)) { // set model suffix + if (!StringUtils.isEmpty(modelNameSuffix) && !isLanguageSpecificType(name)) { // set model suffix name = name + "_" + modelNameSuffix; } - if (!StringUtils.isEmpty(modelNamePrefix)) { // set model prefix + if (!StringUtils.isEmpty(modelNamePrefix) && !isLanguageSpecificType(name)) { // set model prefix name = modelNamePrefix + "_" + name; } @@ -1072,6 +1073,10 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig LOWERCASE_FIRST_LETTER); } + private Boolean isLanguageSpecificType(String name) { + return languageSpecificPrimitives.contains(name); + } + private String replaceSpecialCharacters(String name) { for (Map.Entry specialCharacters : specialCharReplacements.entrySet()) { String specialChar = specialCharacters.getKey(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java index 02cc055c6f4..5db48b7c5a9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java @@ -17,17 +17,12 @@ package org.openapitools.codegen.languages; +import com.github.curiousoddman.rgxgen.RgxGen; import com.google.common.collect.Sets; - import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.media.MediaType; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; -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 org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenConstants.ENUM_PROPERTY_NAMING_TYPE; @@ -41,19 +36,14 @@ import org.openapitools.codegen.model.OperationsMap; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.github.curiousoddman.rgxgen.RgxGen; -import com.github.curiousoddman.rgxgen.config.RgxGenOption; -import com.github.curiousoddman.rgxgen.config.RgxGenProperties; import java.io.File; import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; -import java.util.regex.Pattern; -import java.util.regex.Matcher; -import java.text.SimpleDateFormat; import java.util.*; -import java.util.stream.Collectors; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -62,21 +52,18 @@ import static org.openapitools.codegen.utils.StringUtils.underscore; import static org.openapitools.codegen.utils.OnceLogger.once; -public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenConfig { +public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(TypeScriptClientCodegen.class); - private static final String X_DISCRIMINATOR_TYPE = "x-discriminator-value"; - private static final String UNDEFINED_VALUE = "undefined"; - private static final String FRAMEWORK_SWITCH = "framework"; private static final String FRAMEWORK_SWITCH_DESC = "Specify the framework which should be used in the client code."; - private static final String[] FRAMEWORKS = { "fetch-api", "jquery" }; + private static final String[] FRAMEWORKS = {"fetch-api", "jquery"}; private static final String PLATFORM_SWITCH = "platform"; private static final String PLATFORM_SWITCH_DESC = "Specifies the platform the code should run on. The default is 'node' for the 'request' framework and 'browser' otherwise."; - private static final String[] PLATFORMS = { "browser", "node", "deno" }; + private static final String[] PLATFORMS = {"browser", "node", "deno"}; private static final String IMPORT_FILE_EXTENSION_SWITCH = "importFileExtension"; private static final String IMPORT_FILE_EXTENSION_SWITCH_DESC = "File extension to use with relative imports. Set it to '.js' or '.mjs' when using [ESM](https://nodejs.org/api/esm.html). Defaults to '.ts' when 'platform' is set to 'deno'."; - private static final String FILE_CONTENT_DATA_TYPE= "fileContentDataType"; + private static final String FILE_CONTENT_DATA_TYPE = "fileContentDataType"; private static final String FILE_CONTENT_DATA_TYPE_DESC = "Specifies the type to use for the content of a file - i.e. Blob (Browser, Deno) / Buffer (node)"; private static final String USE_RXJS_SWITCH = "useRxJS"; private static final String USE_RXJS_SWITCH_DESC = "Enable this to internally use rxjs observables. If disabled, a stub is used instead. This is required for the 'angular' framework."; @@ -86,28 +73,18 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo private static final String USE_OBJECT_PARAMS_SWITCH = "useObjectParameters"; private static final String USE_OBJECT_PARAMS_DESC = "Use aggregate parameter objects as function arguments for api operations instead of passing each parameter as a separate function argument."; - private final Map frameworkToHttpLibMap; // NPM Options - private static final String SNAPSHOT = "snapshot"; - @SuppressWarnings("squid:S5164") - protected static final ThreadLocal SNAPSHOT_SUFFIX_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmm", Locale.ROOT)); private static final String NPM_REPOSITORY = "npmRepository"; - private static final String NPM_NAME = "npmName"; - private static final String NPM_VERSION = "npmVersion"; // NPM Option Values protected String npmRepository = null; protected String snapshot = null; - protected String npmName = null; - protected String npmVersion = "1.0.0"; - protected String modelPropertyNaming = "camelCase"; protected ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.PascalCase; - protected HashSet languageGenericTypes; - private DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; - private DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; + private final DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; + private final DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; public TypeScriptClientCodegen() { super(); @@ -116,88 +93,23 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo this.frameworkToHttpLibMap.put("fetch-api", "isomorphic-fetch"); this.frameworkToHttpLibMap.put("jquery", "jquery"); - this.generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.EXPERIMENTAL).build(); outputFolder = "generated-code" + File.separator + "typescript"; embeddedTemplateDir = templateDir = "typescript"; - supportsInheritance = true; - // NOTE: TypeScript uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons. reservedWords.addAll(Arrays.asList( // local variable names used in API methods (endpoints) - "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred", - "requestOptions", "from", + "from", // Typescript reserved words - "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "constructor", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield")); + "constructor")); - languageSpecificPrimitives = new HashSet<>(Arrays.asList( - "string", - "String", - "boolean", - "Boolean", - "Double", - "Integer", - "Long", - "Float", - "Object", - "Array", - "Date", - "number", - "any", - "File", - "Error", - "Map", - "Set" - )); - - languageGenericTypes = new HashSet<>(Arrays.asList( - "Array" - )); - - instantiationTypes.put("array", "Array"); - - typeMapping = new HashMap<>(); - typeMapping.put("Array", "Array"); - typeMapping.put("array", "Array"); typeMapping.put("List", "Array"); - typeMapping.put("boolean", "boolean"); - typeMapping.put("string", "string"); - typeMapping.put("int", "number"); - typeMapping.put("float", "number"); - typeMapping.put("number", "number"); - typeMapping.put("long", "number"); - typeMapping.put("short", "number"); - typeMapping.put("char", "string"); - typeMapping.put("double", "number"); typeMapping.put("object", "any"); - typeMapping.put("integer", "number"); - typeMapping.put("Map", "any"); - typeMapping.put("map", "any"); - typeMapping.put("Set", "Set"); - typeMapping.put("set", "Set"); - typeMapping.put("date", "string"); typeMapping.put("DateTime", "Date"); - typeMapping.put("binary", "any"); - typeMapping.put("File", "any"); - typeMapping.put("file", "any"); - typeMapping.put("ByteArray", "string"); - typeMapping.put("UUID", "string"); - typeMapping.put("Error", "Error"); - typeMapping.put("AnyType", "any"); - - cliOptions.add(new CliOption(NPM_NAME, "The name under which you want to publish generated npm package." + - " Required to generate a full package")); - cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package. If not provided, using the version from the OpenAPI specification file.").defaultValue(this.getNpmVersion())); cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); - cliOptions.add(CliOption.newBoolean(SNAPSHOT, - "When setting this property to true, the version will be suffixed with -SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.get().toPattern(), - false)); - - cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase")); - cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue("false")); cliOptions.add(new CliOption(TypeScriptClientCodegen.FILE_CONTENT_DATA_TYPE, TypeScriptClientCodegen.FILE_CONTENT_DATA_TYPE_DESC).defaultValue("Buffer")); cliOptions.add(new CliOption(TypeScriptClientCodegen.USE_RXJS_SWITCH, TypeScriptClientCodegen.USE_RXJS_SWITCH_DESC).defaultValue("false")); cliOptions.add(new CliOption(TypeScriptClientCodegen.USE_OBJECT_PARAMS_SWITCH, TypeScriptClientCodegen.USE_OBJECT_PARAMS_DESC).defaultValue("false")); @@ -205,20 +117,23 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo cliOptions.add(new CliOption(TypeScriptClientCodegen.IMPORT_FILE_EXTENSION_SWITCH, TypeScriptClientCodegen.IMPORT_FILE_EXTENSION_SWITCH_DESC)); CliOption frameworkOption = new CliOption(TypeScriptClientCodegen.FRAMEWORK_SWITCH, TypeScriptClientCodegen.FRAMEWORK_SWITCH_DESC); - for (String option: TypeScriptClientCodegen.FRAMEWORKS) { + for (String option : TypeScriptClientCodegen.FRAMEWORKS) { frameworkOption.addEnum(option, option); } frameworkOption.defaultValue(FRAMEWORKS[0]); cliOptions.add(frameworkOption); CliOption platformOption = new CliOption(TypeScriptClientCodegen.PLATFORM_SWITCH, TypeScriptClientCodegen.PLATFORM_SWITCH_DESC); - for (String option: TypeScriptClientCodegen.PLATFORMS) { + for (String option : TypeScriptClientCodegen.PLATFORMS) { platformOption.addEnum(option, option); } platformOption.defaultValue(PLATFORMS[0]); cliOptions.add(platformOption); + // Set property naming to camelCase + supportModelPropertyNaming(CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.camelCase); + // Git supportingFiles.add(new SupportingFile(".gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); @@ -276,42 +191,12 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo this.npmVersion = npmVersion; } - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - - if (additionalProperties.containsKey(NPM_NAME)) { - - // If no npmVersion 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(NPM_VERSION)) { - this.setNpmVersion(additionalProperties.get(NPM_VERSION).toString()); - } else if (openAPI.getInfo() != null && openAPI.getInfo().getVersion() != null) { - this.setNpmVersion(openAPI.getInfo().getVersion()); - } - - if (additionalProperties.containsKey(SNAPSHOT) && Boolean.parseBoolean(additionalProperties.get(SNAPSHOT).toString())) { - if (npmVersion.toUpperCase(Locale.ROOT).matches("^.*-SNAPSHOT$")) { - this.setNpmVersion(npmVersion + "." + SNAPSHOT_SUFFIX_FORMAT.get().format(new Date())); - } else { - this.setNpmVersion(npmVersion + "-SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.get().format(new Date())); - } - } - additionalProperties.put(NPM_VERSION, npmVersion); - - } - } - @Override public Map postProcessSupportingFileData(Map objs) { final Object propFramework = additionalProperties.get(FRAMEWORK_SWITCH); Map frameworks = new HashMap<>(); - for (String framework: FRAMEWORKS) { + for (String framework : FRAMEWORKS) { frameworks.put(framework, framework.equals(propFramework)); } objs.put("framework", propFramework); @@ -333,7 +218,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo OperationMap operationsMap = operations.getOperations(); List operationList = operationsMap.getOperation(); - for (CodegenOperation operation: operationList) { + for (CodegenOperation operation : operationList) { List responses = operation.responses; operation.returnType = this.getReturnType(responses); } @@ -342,12 +227,13 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo /** * Returns the correct return type based on all 2xx HTTP responses defined for an operation. + * * @param responses all CodegenResponses defined for one operation * @return TypeScript return type */ private String getReturnType(List responses) { Set returnTypes = new HashSet<>(); - for (CodegenResponse response: responses) { + for (CodegenResponse response : responses) { if (response.is2xx) { if (response.dataType != null) { returnTypes.add(response.dataType); @@ -364,18 +250,21 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo return String.join(" | ", returnTypes); } - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - @Override public String toParamName(String name) { - // should be the same as variable name - return toVarName(name); + // sanitize name + name = sanitizeName(name); + + if ("_".equals(name)) { + name = "_u"; + } + + // if it's all upper case, do nothing + if (name.matches("^[A-Z_]*$")) { + return name; + } + + return super.toParamName(name); } @Override @@ -392,22 +281,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo return name; } - name = getNameUsingModelPropertyNaming(name); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public String toModelName(final String name) { - String fullModelName = name; - fullModelName = addPrefix(fullModelName, modelNamePrefix); - fullModelName = addSuffix(fullModelName, modelNameSuffix); - return toTypescriptTypeName(fullModelName, "Model"); + return super.toVarName(name); } @Override @@ -416,224 +290,6 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo return "../" + modelPackage() + "/" + toModelName(name); } - protected String addPrefix(String name, String prefix) { - if (!StringUtils.isEmpty(prefix)) { - name = prefix + "_" + name; - } - return name; - } - - protected String addSuffix(String name, String suffix) { - if (!StringUtils.isEmpty(suffix)) { - name = name + "_" + suffix; - } - - return name; - } - - protected String toTypescriptTypeName(final String name, String safePrefix) { - ArrayList exceptions = new ArrayList<>(Arrays.asList("\\|", " ")); - String sanName = sanitizeName(name, "(?![| ])\\W", exceptions); - - sanName = camelize(sanName); - - // model name cannot use reserved keyword, e.g. return - // this is unlikely to happen, because we have just camelized the name, while reserved words are usually all lowercase - if (isReservedWord(sanName)) { - String modelName = safePrefix + sanName; - LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", sanName, modelName); - return modelName; - } - - // model name starts with number - if (sanName.matches("^\\d.*")) { - String modelName = safePrefix + sanName; // e.g. 200Response => Model200Response - LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", sanName, - modelName); - return modelName; - } - - if (languageSpecificPrimitives.contains(sanName)) { - String modelName = safePrefix + sanName; - LOGGER.warn("{} (model name matches existing language type) cannot be used as a model name. Renamed to {}", - sanName, modelName); - return modelName; - } - - return sanName; - } - - @Override - public String toModelFilename(String name) { - // should be the same as the model name - return toModelName(name); - } - - @Override - protected String getParameterDataType(Parameter parameter, Schema p) { - // handle enums of various data types - Schema inner; - if (ModelUtils.isArraySchema(p)) { - ArraySchema mp1 = (ArraySchema) p; - inner = mp1.getItems(); - return this.getSchemaType(p) + "<" + this.getParameterDataType(parameter, inner) + ">"; - } else if (ModelUtils.isMapSchema(p)) { - inner = (Schema) p.getAdditionalProperties(); - return "{ [key: string]: " + this.getParameterDataType(parameter, inner) + "; }"; - } else if (ModelUtils.isStringSchema(p)) { - // Handle string enums - if (p.getEnum() != null) { - return enumValuesToEnumTypeUnion(p.getEnum(), "string"); - } - } else if (ModelUtils.isIntegerSchema(p)) { - // Handle integer enums - if (p.getEnum() != null) { - return numericEnumValuesToEnumTypeUnion(new ArrayList(p.getEnum())); - } - } else if (ModelUtils.isNumberSchema(p)) { - // Handle double enums - if (p.getEnum() != null) { - return numericEnumValuesToEnumTypeUnion(new ArrayList(p.getEnum())); - } - } - return this.getTypeDeclaration(p); - } - - /** - * Converts a list of strings to a literal union for representing enum values as a type. - * Example output: 'available' | 'pending' | 'sold' - * - * @param values list of allowed enum values - * @param dataType either "string" or "number" - * @return a literal union for representing enum values as a type - */ - protected String enumValuesToEnumTypeUnion(List values, String dataType) { - StringBuilder b = new StringBuilder(); - boolean isFirst = true; - for (String value : values) { - if (!isFirst) { - b.append(" | "); - } - b.append(toEnumValue(value, dataType)); - isFirst = false; - } - return b.toString(); - } - - /** - * Converts a list of numbers to a literal union for representing enum values as a type. - * Example output: 3 | 9 | 55 - * - * @param values a list of numbers - * @return a literal union for representing enum values as a type - */ - protected String numericEnumValuesToEnumTypeUnion(List values) { - List stringValues = new ArrayList<>(); - for (Number value : values) { - stringValues.add(value.toString()); - } - return enumValuesToEnumTypeUnion(stringValues, "number"); - } - - @Override - public String toDefaultValue(Schema p) { - if (ModelUtils.isBooleanSchema(p)) { - return UNDEFINED_VALUE; - } else if (ModelUtils.isDateSchema(p)) { - return UNDEFINED_VALUE; - } else if (ModelUtils.isDateTimeSchema(p)) { - return UNDEFINED_VALUE; - } else if (ModelUtils.isNumberSchema(p)) { - if (p.getDefault() != null) { - return p.getDefault().toString(); - } - return UNDEFINED_VALUE; - } else if (ModelUtils.isIntegerSchema(p)) { - if (p.getDefault() != null) { - return p.getDefault().toString(); - } - return UNDEFINED_VALUE; - } else if (ModelUtils.isStringSchema(p)) { - if (p.getDefault() != null) { - return "'" + (String) p.getDefault() + "'"; - } - return UNDEFINED_VALUE; - } else { - return UNDEFINED_VALUE; - } - - } - - @Override - protected boolean isReservedWord(String word) { - // NOTE: This differs from super's implementation in that TypeScript does _not_ want case insensitive matching. - return reservedWords.contains(word); - } - - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - String type = null; - if (ModelUtils.isComposedSchema(p)) { - return openAPIType; - } else if (typeMapping.containsKey(openAPIType)) { - type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type)) - return type; - } else - type = openAPIType; - return toModelName(type); - } - - @Override - public String toOperationId(String operationId) { - // throw exception if method name is empty - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method name (operationId) not allowed"); - } - - // method name cannot use reserved keyword, e.g. return - // append _ at the beginning, e.g. _return - if (isReservedWord(operationId)) { - return escapeReservedWord(camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER)); - } - - return camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); - } - - 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 getModelPropertyNaming() { - return this.modelPropertyNaming; - } - - public String getNameUsingModelPropertyNaming(String name) { - switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) { - case original: - return name; - case camelCase: - return camelize(name, LOWERCASE_FIRST_LETTER); - 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 toEnumValue(String value, String datatype) { if ("number".equals(datatype)) { @@ -643,11 +299,6 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo } } - @Override - public String toEnumDefaultValue(String value, String datatype) { - return datatype + "_" + value; - } - @Override public String toEnumVarName(String name, String datatype) { if (name.length() == 0) { @@ -683,10 +334,6 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo } } - protected ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() { - return enumPropertyNaming; - } - private String getNameUsingEnumPropertyNaming(String name) { switch (getEnumPropertyNaming()) { case original: @@ -704,17 +351,6 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo } } - @Override - public String toEnumName(CodegenProperty property) { - String enumName = toModelName(property.name) + "Enum"; - - if (enumName.matches("\\d.*")) { // starts with number - return "_" + enumName; - } else { - return enumName; - } - } - @Override public ModelsMap postProcessModels(ModelsMap objs) { // process enum in models @@ -759,53 +395,6 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo return tsImports; } - @Override - public Map postProcessAllModels(Map objs) { - Map result = super.postProcessAllModels(objs); - - for (ModelsMap entry : result.values()) { - for (ModelMap mo : entry.getModels()) { - CodegenModel cm = mo.getModel(); - if (cm.discriminator != null && cm.children != null) { - for (CodegenModel child : cm.children) { - this.setDiscriminatorValue(child, cm.discriminator.getPropertyName(), this.getDiscriminatorValue(child)); - } - } - } - } - return result; - } - - private void setDiscriminatorValue(CodegenModel model, String baseName, String value) { - for (CodegenProperty prop : model.allVars) { - if (prop.baseName.equals(baseName)) { - prop.discriminatorValue = value; - } - } - if (model.children != null) { - final boolean newDiscriminator = model.discriminator != null; - for (CodegenModel child : model.children) { - this.setDiscriminatorValue(child, baseName, newDiscriminator ? value : this.getDiscriminatorValue(child)); - } - } - } - - private String getDiscriminatorValue(CodegenModel model) { - return model.vendorExtensions.containsKey(X_DISCRIMINATOR_TYPE) ? - (String) model.vendorExtensions.get(X_DISCRIMINATOR_TYPE) : model.classname; - } - - @Override - public String escapeQuotationMark(String input) { - // remove ', " to avoid code injection - return input.replace("\"", "").replace("'", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - @Override public String getName() { return "typescript"; @@ -816,17 +405,10 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo return "Generates a TypeScript client library using Fetch API (beta)."; } - @Override public void processOpts() { super.processOpts(); - if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { - setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); - } - - convertPropertyToBooleanAndWriteBack(CodegenConstants.SUPPORTS_ES6); - // change package names apiPackage = this.apiPackage + ".apis"; testPackage = this.testPackage + ".tests"; @@ -836,8 +418,8 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo String httpLibName = this.getHttpLibForFramework(additionalProperties.get(FRAMEWORK_SWITCH).toString()); supportingFiles.add(new SupportingFile( - "http" + File.separator + httpLibName + ".mustache", - "http", httpLibName + ".ts" + "http" + File.separator + httpLibName + ".mustache", + "http", httpLibName + ".ts" )); Object propPlatform = additionalProperties.get(PLATFORM_SWITCH); @@ -847,7 +429,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo } Map platforms = new HashMap<>(); - for (String platform: PLATFORMS) { + for (String platform : PLATFORMS) { platforms.put(platform, platform.equals(propPlatform)); } additionalProperties.put("platforms", platforms); @@ -882,14 +464,6 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo } // NPM Settings - if (additionalProperties.containsKey(NPM_NAME)) { - setNpmName(additionalProperties.get(NPM_NAME).toString()); - } - - if (additionalProperties.containsKey(NPM_VERSION)) { - setNpmVersion(additionalProperties.get(NPM_VERSION).toString()); - } - if (additionalProperties.containsKey(NPM_REPOSITORY)) { setNpmRepository(additionalProperties.get(NPM_REPOSITORY).toString()); } @@ -908,7 +482,11 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo return this.getSchemaType(p) + "<" + this.getTypeDeclaration(unaliasSchema(inner)) + ">"; } else if (ModelUtils.isMapSchema(p)) { inner = getSchemaAdditionalProperties(p); - return "{ [key: string]: " + this.getTypeDeclaration(unaliasSchema(inner)) + "; }"; + String postfix = ""; + if (Boolean.TRUE.equals(inner.getNullable())) { + postfix = " | null"; + } + return "{ [key: string]: " + this.getTypeDeclaration(unaliasSchema(inner)) + postfix + "; }"; } else if (ModelUtils.isFileSchema(p)) { return "HttpFile"; } else if (ModelUtils.isBinarySchema(p)) { @@ -1413,9 +991,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo return example; } - /*** - * * Set the codegenParameter example value * We have a custom version of this function so we can invoke toExampleValue * @@ -1506,64 +1082,6 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo return cp; } - @Override - public String toAnyOfName(List names, ComposedSchema composedSchema) { - List types = getTypesFromSchemas(composedSchema.getAnyOf()); - - return String.join(" | ", types); - } - - @Override - public String toOneOfName(List names, ComposedSchema composedSchema) { - List types = getTypesFromSchemas(composedSchema.getOneOf()); - - return String.join(" | ", types); - } - - @Override - public String toAllOfName(List names, ComposedSchema composedSchema) { - List types = getTypesFromSchemas(composedSchema.getAllOf()); - - return String.join(" & ", types); - } - - /** - * Extracts the list of type names from a list of schemas. - * Excludes `AnyType` if there are other valid types extracted. - * - * @param schemas list of schemas - * @return list of types - */ - protected List getTypesFromSchemas(List schemas) { - List filteredSchemas = schemas.size() > 1 - ? schemas.stream().filter(schema -> !"AnyType".equals(super.getSchemaType(schema))).collect(Collectors.toList()) - : schemas; - - return filteredSchemas.stream().map(schema -> { - String schemaType = getSchemaType(schema); - if (ModelUtils.isArraySchema(schema)) { - ArraySchema ap = (ArraySchema) schema; - Schema inner = ap.getItems(); - schemaType = schemaType + "<" + getSchemaType(inner) + ">"; - } - return schemaType; - }).distinct().collect(Collectors.toList()); - } - - @Override - protected void addImport(CodegenModel m, String type) { - if (type == null) { - return; - } - - String[] parts = splitComposedType(type); - for (String s : parts) { - if (needToImport(s)) { - m.imports.add(s); - } - } - } - @Override protected void addImport(Set importsToBeAddedTo, String type) { if (type == null) { @@ -1584,9 +1102,6 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo * @return list of types */ protected String[] splitComposedType(String type) { - return type.replace(" ","").split("[|&<>]"); + return type.replace(" ", "").split("[|&<>]"); } - - @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.TYPESCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/SpringHttpStatusLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/SpringHttpStatusLambda.java new file mode 100644 index 00000000000..3808f78cbb3 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/SpringHttpStatusLambda.java @@ -0,0 +1,220 @@ +package org.openapitools.codegen.templating.mustache; + +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; + +import java.io.IOException; +import java.io.Writer; + +/** + * Returns the Spring {@code org.springframework.http.HttpStatus} enumeration for the given status text. + * It throws an IllegalArgumentException if the status text is handled by the Spring framework. + * + * Register: + *
    + * additionalProperties.put("springHttpStatus", new SpringHttpStatusLambda());
    + * 
    + * + * Use: + *
    + * {{#springHttpStatus}}{{statusCode}}{{/springHttpStatus}}
    + * 
    + */ +public class SpringHttpStatusLambda implements Mustache.Lambda { + + final static String HTTP_STATUS_PREFIX = "HttpStatus."; + + @Override + public void execute(Template.Fragment fragment, Writer writer) throws IOException { + final String httpCode = fragment.execute(); + switch (httpCode) { + case "202": + writer.write(HTTP_STATUS_PREFIX + "ACCEPTED"); + break; + case "208": + writer.write(HTTP_STATUS_PREFIX + "ALREADY_REPORTED"); + break; + case "502": + writer.write(HTTP_STATUS_PREFIX + "BAD_GATEWAY"); + break; + case "400": + writer.write(HTTP_STATUS_PREFIX + "BAD_REQUEST"); + break; + case "509": + writer.write(HTTP_STATUS_PREFIX + "BANDWIDTH_LIMIT_EXCEEDED"); + break; + case "409": + writer.write(HTTP_STATUS_PREFIX + "CONFLICT"); + break; + case "100": + writer.write(HTTP_STATUS_PREFIX + "CONTINUE"); + break; + case "201": + writer.write(HTTP_STATUS_PREFIX + "CREATED"); + break; + case "103": + writer.write(HTTP_STATUS_PREFIX + "EARLY_HINTS"); + break; + case "417": + writer.write(HTTP_STATUS_PREFIX + "EXPECTATION_FAILED"); + break; + case "424": + writer.write(HTTP_STATUS_PREFIX + "FAILED_DEPENDENCY"); + break; + case "403": + writer.write(HTTP_STATUS_PREFIX + "FORBIDDEN"); + break; + case "302": + writer.write(HTTP_STATUS_PREFIX + "FOUND"); + break; + case "504": + writer.write(HTTP_STATUS_PREFIX + "GATEWAY_TIMEOUT"); + break; + case "410": + writer.write(HTTP_STATUS_PREFIX + "GONE"); + break; + case "505": + writer.write(HTTP_STATUS_PREFIX + "HTTP_VERSION_NOT_SUPPORTED"); + break; + case "418": + writer.write(HTTP_STATUS_PREFIX + "I_AM_A_TEAPOT"); + break; + case "226": + writer.write(HTTP_STATUS_PREFIX + "IM_USED"); + break; + case "507": + writer.write(HTTP_STATUS_PREFIX + "INSUFFICIENT_STORAGE"); + break; + case "500": + writer.write(HTTP_STATUS_PREFIX + "INTERNAL_SERVER_ERROR"); + break; + case "411": + writer.write(HTTP_STATUS_PREFIX + "LENGTH_REQUIRED"); + break; + case "423": + writer.write(HTTP_STATUS_PREFIX + "LOCKED"); + break; + case "508": + writer.write(HTTP_STATUS_PREFIX + "LOOP_DETECTED"); + break; + case "405": + writer.write(HTTP_STATUS_PREFIX + "METHOD_NOT_ALLOWED"); + break; + case "301": + writer.write(HTTP_STATUS_PREFIX + "MOVED_PERMANENTLY"); + break; + case "207": + writer.write(HTTP_STATUS_PREFIX + "MULTI_STATUS"); + break; + case "300": + writer.write(HTTP_STATUS_PREFIX + "MULTIPLE_CHOICES"); + break; + case "511": + writer.write(HTTP_STATUS_PREFIX + "NETWORK_AUTHENTICATION_REQUIRED"); + break; + case "204": + writer.write(HTTP_STATUS_PREFIX + "NO_CONTENT"); + break; + case "203": + writer.write(HTTP_STATUS_PREFIX + "NON_AUTHORITATIVE_INFORMATION"); + break; + case "406": + writer.write(HTTP_STATUS_PREFIX + "NOT_ACCEPTABLE"); + break; + case "510": + writer.write(HTTP_STATUS_PREFIX + "NOT_EXTENDED"); + break; + case "404": + writer.write(HTTP_STATUS_PREFIX + "NOT_FOUND"); + break; + case "501": + writer.write(HTTP_STATUS_PREFIX + "NOT_IMPLEMENTED"); + break; + case "304": + writer.write(HTTP_STATUS_PREFIX + "NOT_MODIFIED"); + break; + case "": + case "200": + writer.write(HTTP_STATUS_PREFIX + "OK"); + break; + case "206": + writer.write(HTTP_STATUS_PREFIX + "PARTIAL_CONTENT"); + break; + case "413": + writer.write(HTTP_STATUS_PREFIX + "PAYLOAD_TOO_LARGE"); + break; + case "402": + writer.write(HTTP_STATUS_PREFIX + "PAYMENT_REQUIRED"); + break; + case "308": + writer.write(HTTP_STATUS_PREFIX + "PERMANENT_REDIRECT"); + break; + case "412": + writer.write(HTTP_STATUS_PREFIX + "PRECONDITION_FAILED"); + break; + case "428": + writer.write(HTTP_STATUS_PREFIX + "PRECONDITION_REQUIRED"); + break; + case "102": + writer.write(HTTP_STATUS_PREFIX + "PROCESSING"); + break; + case "407": + writer.write(HTTP_STATUS_PREFIX + "PROXY_AUTHENTICATION_REQUIRED"); + break; + case "431": + writer.write(HTTP_STATUS_PREFIX + "REQUEST_HEADER_FIELDS_TOO_LARGE"); + break; + case "408": + writer.write(HTTP_STATUS_PREFIX + "REQUEST_TIMEOUT"); + break; + case "416": + writer.write(HTTP_STATUS_PREFIX + "REQUESTED_RANGE_NOT_SATISFIABLE"); + break; + case "205": + writer.write(HTTP_STATUS_PREFIX + "RESET_CONTENT"); + break; + case "303": + writer.write(HTTP_STATUS_PREFIX + "SEE_OTHER"); + break; + case "503": + writer.write(HTTP_STATUS_PREFIX + "SERVICE_UNAVAILABLE"); + break; + case "101": + writer.write(HTTP_STATUS_PREFIX + "SWITCHING_PROTOCOLS"); + break; + case "307": + writer.write(HTTP_STATUS_PREFIX + "TEMPORARY_REDIRECT"); + break; + case "425": + writer.write(HTTP_STATUS_PREFIX + "TOO_EARLY"); + break; + case "429": + writer.write(HTTP_STATUS_PREFIX + "TOO_MANY_REQUESTS"); + break; + case "401": + writer.write(HTTP_STATUS_PREFIX + "UNAUTHORIZED"); + break; + case "451": + writer.write(HTTP_STATUS_PREFIX + "UNAVAILABLE_FOR_LEGAL_REASONS"); + break; + case "422": + writer.write(HTTP_STATUS_PREFIX + "UNPROCESSABLE_ENTITY"); + break; + case "415": + writer.write(HTTP_STATUS_PREFIX + "UNSUPPORTED_MEDIA_TYPE"); + break; + case "426": + writer.write(HTTP_STATUS_PREFIX + "UPGRADE_REQUIRED"); + break; + case "414": + writer.write(HTTP_STATUS_PREFIX + "URI_TOO_LONG"); + break; + case "506": + writer.write(HTTP_STATUS_PREFIX + "VARIANT_ALSO_NEGOTIATES"); + break; + default: + throw new IllegalArgumentException("The given HTTP status code: " + httpCode + + " is not supported by the 'org.springframework.http.HttpStatus' enum."); + } + } +} 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 11c08308542..75be8e7ef71 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 @@ -28,11 +28,12 @@ import io.swagger.v3.oas.models.media.*; 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 io.swagger.v3.parser.ObjectMapperFactory; import io.swagger.v3.parser.core.models.AuthorizationValue; import io.swagger.v3.parser.util.ClasspathHelper; -import io.swagger.v3.parser.ObjectMapperFactory; import io.swagger.v3.parser.util.RemoteUrl; import io.swagger.v3.parser.util.SchemaTypeUtil; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.IJsonSchemaValidationProperties; @@ -41,18 +42,17 @@ import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.apache.commons.io.FileUtils; import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.net.URI; import java.net.URLDecoder; -import java.util.*; -import java.util.Map.Entry; -import java.util.stream.Collectors; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.*; +import java.util.Map.Entry; +import java.util.stream.Collectors; import static org.openapitools.codegen.utils.OnceLogger.once; @@ -71,29 +71,30 @@ public class ModelUtils { private static final String freeFormExplicit = "x-is-free-form"; - private static ObjectMapper JSON_MAPPER, YAML_MAPPER; + private static final ObjectMapper JSON_MAPPER; + private static final ObjectMapper YAML_MAPPER; static { JSON_MAPPER = ObjectMapperFactory.createJson(); YAML_MAPPER = ObjectMapperFactory.createYaml(); } - public static void setDisallowAdditionalPropertiesIfNotPresent(boolean value) { - GlobalSettings.setProperty(disallowAdditionalPropertiesIfNotPresent, Boolean.toString(value)); - } - public static boolean isDisallowAdditionalPropertiesIfNotPresent() { return Boolean.parseBoolean(GlobalSettings.getProperty(disallowAdditionalPropertiesIfNotPresent, "true")); } - public static void setGenerateAliasAsModel(boolean value) { - GlobalSettings.setProperty(generateAliasAsModelKey, Boolean.toString(value)); + public static void setDisallowAdditionalPropertiesIfNotPresent(boolean value) { + GlobalSettings.setProperty(disallowAdditionalPropertiesIfNotPresent, Boolean.toString(value)); } public static boolean isGenerateAliasAsModel() { return Boolean.parseBoolean(GlobalSettings.getProperty(generateAliasAsModelKey, "false")); } + public static void setGenerateAliasAsModel(boolean value) { + GlobalSettings.setProperty(generateAliasAsModelKey, Boolean.toString(value)); + } + public static boolean isGenerateAliasAsModel(Schema schema) { return isGenerateAliasAsModel() || (schema.getExtensions() != null && schema.getExtensions().getOrDefault("x-generate-alias-as-model", false).equals(true)); } @@ -371,12 +372,6 @@ public class ModelUtils { } } - @FunctionalInterface - private static interface OpenAPISchemaVisitor { - - public void visit(Schema schema, String mimeType); - } - public static String getSimpleRef(String ref) { if (ref == null) { once(LOGGER).warn("Failed to get the schema name: null"); @@ -417,10 +412,7 @@ public class ModelUtils { * @return true if the specified schema is an Object schema. */ public static boolean isTypeObjectSchema(Schema schema) { - if (SchemaTypeUtil.OBJECT_TYPE.equals(schema.getType())) { - return true; - } - return false; + return SchemaTypeUtil.OBJECT_TYPE.equals(schema.getType()); } /** @@ -446,20 +438,11 @@ public class ModelUtils { * @return true if the specified schema is an Object schema. */ public static boolean isObjectSchema(Schema schema) { - if (schema instanceof ObjectSchema) { - return true; - } - - // must not be a map - if (SchemaTypeUtil.OBJECT_TYPE.equals(schema.getType()) && !(schema instanceof MapSchema)) { - return true; - } - - // must have at least one property - if (schema.getType() == null && schema.getProperties() != null && !schema.getProperties().isEmpty()) { - return true; - } - return false; + return (schema instanceof ObjectSchema) || + // must not be a map + (SchemaTypeUtil.OBJECT_TYPE.equals(schema.getType()) && !(schema instanceof MapSchema)) || + // must have at least one property + (schema.getType() == null && schema.getProperties() != null && !schema.getProperties().isEmpty()); } /** @@ -470,10 +453,7 @@ public class ModelUtils { * @return true if the specified schema is a Composed schema. */ public static boolean isComposedSchema(Schema schema) { - if (schema instanceof ComposedSchema) { - return true; - } - return false; + return schema instanceof ComposedSchema; } /** @@ -506,11 +486,7 @@ public class ModelUtils { count++; } - if (count > 1) { - return true; - } - - return false; + return count > 1; } /** @@ -548,23 +524,9 @@ public class ModelUtils { * @return true if the specified schema is a Map schema. */ public static boolean isMapSchema(Schema schema) { - if (schema instanceof MapSchema) { - return true; - } - - if (schema == null) { - return false; - } - - if (schema.getAdditionalProperties() instanceof Schema) { - return true; - } - - if (schema.getAdditionalProperties() instanceof Boolean && (Boolean) schema.getAdditionalProperties()) { - return true; - } - - return false; + return (schema instanceof MapSchema) || + (schema.getAdditionalProperties() instanceof Schema) || + (schema.getAdditionalProperties() instanceof Boolean && (Boolean) schema.getAdditionalProperties()); } /** @@ -582,174 +544,122 @@ public class ModelUtils { } public static boolean isStringSchema(Schema schema) { - if (schema instanceof StringSchema || SchemaTypeUtil.STRING_TYPE.equals(schema.getType())) { - return true; - } - return false; + return schema instanceof StringSchema || SchemaTypeUtil.STRING_TYPE.equals(schema.getType()); } public static boolean isIntegerSchema(Schema schema) { - if (schema instanceof IntegerSchema) { - return true; - } - if (SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType())) { - return true; - } - return false; + return schema instanceof IntegerSchema || SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType()); } public static boolean isShortSchema(Schema schema) { - if (SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType()) // type: integer - && SchemaTypeUtil.INTEGER32_FORMAT.equals(schema.getFormat())) { // format: short (int32) - return true; - } - return false; + // format: short (int32) + return SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType()) // type: integer + && SchemaTypeUtil.INTEGER32_FORMAT.equals(schema.getFormat()); + } + + public static boolean isUnsignedIntegerSchema(Schema schema) { + return SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType()) && // type: integer + ("int32".equals(schema.getFormat()) || schema.getFormat() == null) && // format: int32 + (schema.getExtensions() != null && (Boolean) schema.getExtensions().getOrDefault("x-unsigned", Boolean.FALSE)); } public static boolean isLongSchema(Schema schema) { - if (SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType()) // type: integer - && SchemaTypeUtil.INTEGER64_FORMAT.equals(schema.getFormat())) { // format: long (int64) - return true; - } - return false; + // format: long (int64) + return SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType()) // type: integer + && SchemaTypeUtil.INTEGER64_FORMAT.equals(schema.getFormat()); + } + + public static boolean isUnsignedLongSchema(Schema schema) { + return SchemaTypeUtil.INTEGER_TYPE.equals(schema.getType()) && // type: integer + "int64".equals(schema.getFormat()) && // format: int64 + (schema.getExtensions() != null && (Boolean) schema.getExtensions().getOrDefault("x-unsigned", Boolean.FALSE)); } public static boolean isBooleanSchema(Schema schema) { - if (schema instanceof BooleanSchema) { - return true; - } - if (SchemaTypeUtil.BOOLEAN_TYPE.equals(schema.getType())) { - return true; - } - return false; + return schema instanceof BooleanSchema || SchemaTypeUtil.BOOLEAN_TYPE.equals(schema.getType()); } public static boolean isNumberSchema(Schema schema) { - if (schema instanceof NumberSchema) { - return true; - } - if (SchemaTypeUtil.NUMBER_TYPE.equals(schema.getType())) { - return true; - } - return false; + return schema instanceof NumberSchema || SchemaTypeUtil.NUMBER_TYPE.equals(schema.getType()); } public static boolean isFloatSchema(Schema schema) { - if (SchemaTypeUtil.NUMBER_TYPE.equals(schema.getType()) - && SchemaTypeUtil.FLOAT_FORMAT.equals(schema.getFormat())) { // format: float - return true; - } - return false; + // format: float + return SchemaTypeUtil.NUMBER_TYPE.equals(schema.getType()) + && SchemaTypeUtil.FLOAT_FORMAT.equals(schema.getFormat()); } public static boolean isDoubleSchema(Schema schema) { - if (SchemaTypeUtil.NUMBER_TYPE.equals(schema.getType()) - && SchemaTypeUtil.DOUBLE_FORMAT.equals(schema.getFormat())) { // format: double - return true; - } - return false; + // format: double + return SchemaTypeUtil.NUMBER_TYPE.equals(schema.getType()) + && SchemaTypeUtil.DOUBLE_FORMAT.equals(schema.getFormat()); } public static boolean isDateSchema(Schema schema) { - if (schema instanceof DateSchema) { - return true; - } - - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) - && SchemaTypeUtil.DATE_FORMAT.equals(schema.getFormat())) { // format: date - return true; - } - return false; + return (schema instanceof DateSchema) || + // format: date + (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) + && SchemaTypeUtil.DATE_FORMAT.equals(schema.getFormat())); } public static boolean isDateTimeSchema(Schema schema) { - if (schema instanceof DateTimeSchema) { - return true; - } - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) - && SchemaTypeUtil.DATE_TIME_FORMAT.equals(schema.getFormat())) { // format: date-time - return true; - } - return false; + return (schema instanceof DateTimeSchema) || + // format: date-time + (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) + && SchemaTypeUtil.DATE_TIME_FORMAT.equals(schema.getFormat())); } public static boolean isPasswordSchema(Schema schema) { - if (schema instanceof PasswordSchema) { - return true; - } - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) - && SchemaTypeUtil.PASSWORD_FORMAT.equals(schema.getFormat())) { // double - return true; - } - return false; + return (schema instanceof PasswordSchema) || + // double + (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) + && SchemaTypeUtil.PASSWORD_FORMAT.equals(schema.getFormat())); } public static boolean isByteArraySchema(Schema schema) { - if (schema instanceof ByteArraySchema) { - return true; - } - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) - && SchemaTypeUtil.BYTE_FORMAT.equals(schema.getFormat())) { // format: byte - return true; - } - return false; + return (schema instanceof ByteArraySchema) || + // format: byte + (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) + && SchemaTypeUtil.BYTE_FORMAT.equals(schema.getFormat())); } public static boolean isBinarySchema(Schema schema) { - if (schema instanceof BinarySchema) { - return true; - } - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) - && SchemaTypeUtil.BINARY_FORMAT.equals(schema.getFormat())) { // format: binary - return true; - } - return false; + return (schema instanceof BinarySchema) || + // format: binary + (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) + && SchemaTypeUtil.BINARY_FORMAT.equals(schema.getFormat())); } public static boolean isFileSchema(Schema schema) { - if (schema instanceof FileSchema) { - return true; - } - // file type in oas2 mapped to binary in oas3 - return isBinarySchema(schema); + return (schema instanceof FileSchema) || + // file type in oas2 mapped to binary in oas3 + isBinarySchema(schema); } public static boolean isUUIDSchema(Schema schema) { - if (schema instanceof UUIDSchema) { - return true; - } - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) - && SchemaTypeUtil.UUID_FORMAT.equals(schema.getFormat())) { // format: uuid - return true; - } - return false; + return (schema instanceof UUIDSchema) || + // format: uuid + (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) + && SchemaTypeUtil.UUID_FORMAT.equals(schema.getFormat())); } public static boolean isURISchema(Schema schema) { - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) - && URI_FORMAT.equals(schema.getFormat())) { // format: uri - return true; - } - return false; + // format: uri + return SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) + && URI_FORMAT.equals(schema.getFormat()); } public static boolean isEmailSchema(Schema schema) { - if (schema instanceof EmailSchema) { - return true; - } - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) - && SchemaTypeUtil.EMAIL_FORMAT.equals(schema.getFormat())) { // format: email - return true; - } - return false; + return (schema instanceof EmailSchema) || + // format: email + (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) + && SchemaTypeUtil.EMAIL_FORMAT.equals(schema.getFormat())); } public static boolean isDecimalSchema(Schema schema) { - if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) // type: string - && "number".equals(schema.getFormat())) { // format: number - return true; - } - return false; + // format: number + return SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) // type: string + && "number".equals(schema.getFormat()); } /** @@ -759,17 +669,11 @@ public class ModelUtils { * @return true if it's a model with at least one properties */ public static boolean isModel(Schema schema) { - if (schema == null) { - return false; - } - - // has properties - if (null != schema.getProperties() && !schema.getProperties().isEmpty()) { - return true; - } - - // composed schema is a model, consider very simple ObjectSchema a model - return schema instanceof ComposedSchema || schema instanceof ObjectSchema; + return (schema != null) && + // has properties + ((null != schema.getProperties() && !schema.getProperties().isEmpty()) + // composed schema is a model, consider very simple ObjectSchema a model + || (schema instanceof ComposedSchema || schema instanceof ObjectSchema)); } /** @@ -779,16 +683,12 @@ public class ModelUtils { * @return true if it's a model with at least one properties */ public static boolean isModelWithPropertiesOnly(Schema schema) { - if (schema == null) { - return false; - } - - if (null != schema.getProperties() && !schema.getProperties().isEmpty() && // has properties - (schema.getAdditionalProperties() == null || // no additionalProperties is set - (schema.getAdditionalProperties() instanceof Boolean && !(Boolean) schema.getAdditionalProperties()))) { - return true; - } - return false; + return (schema != null) && + // has properties + (null != schema.getProperties() && !schema.getProperties().isEmpty()) && + // no additionalProperties is set + (schema.getAdditionalProperties() == null || + (schema.getAdditionalProperties() instanceof Boolean && !(Boolean) schema.getAdditionalProperties())); } public static boolean hasValidation(Schema sc) { @@ -878,14 +778,10 @@ public class ModelUtils { if (addlProps instanceof ObjectSchema) { ObjectSchema objSchema = (ObjectSchema) addlProps; // additionalProperties defined as {} - if (objSchema.getProperties() == null || objSchema.getProperties().isEmpty()) { - return true; - } + return objSchema.getProperties() == null || objSchema.getProperties().isEmpty(); } else if (addlProps instanceof Schema) { // additionalProperties defined as {} - if (addlProps.getType() == null && addlProps.get$ref() == null && (addlProps.getProperties() == null || addlProps.getProperties().isEmpty())) { - return true; - } + return addlProps.getType() == null && addlProps.get$ref() == null && (addlProps.getProperties() == null || addlProps.getProperties().isEmpty()); } } } @@ -1003,11 +899,7 @@ public class ModelUtils { } public static ApiResponse getApiResponse(OpenAPI openAPI, String name) { - if (name == null) { - return null; - } - - if (openAPI != null && openAPI.getComponents() != null && openAPI.getComponents().getResponses() != null) { + if (name != null && openAPI != null && openAPI.getComponents() != null && openAPI.getComponents().getResponses() != null) { return openAPI.getComponents().getResponses().get(name); } return null; @@ -1032,11 +924,7 @@ public class ModelUtils { } public static Parameter getParameter(OpenAPI openAPI, String name) { - if (name == null) { - return null; - } - - if (openAPI != null && openAPI.getComponents() != null && openAPI.getComponents().getParameters() != null) { + if (name != null && openAPI != null && openAPI.getComponents() != null && openAPI.getComponents().getParameters() != null) { return openAPI.getComponents().getParameters().get(name); } return null; @@ -1061,11 +949,7 @@ public class ModelUtils { } public static Callback getCallback(OpenAPI openAPI, String name) { - if (name == null) { - return null; - } - - if (openAPI != null && openAPI.getComponents() != null && openAPI.getComponents().getCallbacks() != null) { + if (name != null && openAPI != null && openAPI.getComponents() != null && openAPI.getComponents().getCallbacks() != null) { return openAPI.getComponents().getCallbacks().get(name); } return null; @@ -1372,11 +1256,7 @@ public class ModelUtils { } public static Header getHeader(OpenAPI openAPI, String name) { - if (name == null) { - return null; - } - - if (openAPI != null && openAPI.getComponents() != null && openAPI.getComponents().getHeaders() != null) { + if (name != null && openAPI != null && openAPI.getComponents() != null && openAPI.getComponents().getHeaders() != null) { return openAPI.getComponents().getHeaders().get(name); } return null; @@ -1394,7 +1274,6 @@ public class ModelUtils { .collect(Collectors.toMap(entry -> entry.getKey(), entry -> entry.getValue().stream().map(e -> e.getKey()).collect(Collectors.toList()))); } - /** * Get the interfaces from the schema (composed) * @@ -1575,17 +1454,17 @@ public class ModelUtils { public static boolean isExtensionParent(Schema schema) { if (schema.getExtensions() == null) { return false; + } + + Object xParent = schema.getExtensions().get("x-parent"); + if (xParent == null) { + return false; + } else if (xParent instanceof Boolean) { + return (Boolean) xParent; + } else if (xParent instanceof String) { + return StringUtils.isNotEmpty((String) xParent); } else { - Object xParent = schema.getExtensions().get("x-parent"); - if (xParent == null) { - return false; - } else if (xParent instanceof Boolean) { - return (Boolean) xParent; - } else if (xParent instanceof String) { - return StringUtils.isNotEmpty((String) xParent); - } else { - return false; - } + return false; } } @@ -1665,18 +1544,15 @@ public class ModelUtils { * either be null or a specified type: *

    * OptionalOrder: - * oneOf: - * - type: 'null' - * - $ref: '#/components/schemas/Order' + * oneOf: + * - type: 'null' + * - $ref: '#/components/schemas/Order' * * @param schema the OpenAPI schema * @return true if the schema is the 'null' type */ public static boolean isNullType(Schema schema) { - if ("null".equals(schema.getType())) { - return true; - } - return false; + return "null".equals(schema.getType()); } /** @@ -1697,47 +1573,90 @@ public class ModelUtils { public static void syncValidationProperties(Schema schema, IJsonSchemaValidationProperties target) { // TODO move this method to IJsonSchemaValidationProperties - if (schema != null && target != null) { - if (isNullType(schema) || schema.get$ref() != null || isBooleanSchema(schema)) { - return; - } - Integer minItems = schema.getMinItems(); - Integer maxItems = schema.getMaxItems(); - Boolean uniqueItems = schema.getUniqueItems(); - Integer minProperties = schema.getMinProperties(); - Integer maxProperties = schema.getMaxProperties(); - Integer minLength = schema.getMinLength(); - Integer maxLength = schema.getMaxLength(); - String pattern = schema.getPattern(); - BigDecimal multipleOf = schema.getMultipleOf(); - BigDecimal minimum = schema.getMinimum(); - BigDecimal maximum = schema.getMaximum(); - Boolean exclusiveMinimum = schema.getExclusiveMinimum(); - Boolean exclusiveMaximum = schema.getExclusiveMaximum(); + if (schema == null || + target == null || + schema.get$ref() != null) + return; + SchemaValidations.ValidationSetBuilder vSB = new SchemaValidations.ValidationSetBuilder(); - if (isArraySchema(schema)) { + Integer minItems = schema.getMinItems(); + if (minItems != null) vSB.withMinItems(); + + Integer maxItems = schema.getMaxItems(); + if (maxItems != null) vSB.withMaxItems(); + + Boolean uniqueItems = schema.getUniqueItems(); + if (uniqueItems != null) vSB.withUniqueItems(); + + Integer minProperties = schema.getMinProperties(); + if (minProperties != null) vSB.withMinProperties(); + + Integer maxProperties = schema.getMaxProperties(); + if (maxProperties != null) vSB.withMaxProperties(); + + Integer minLength = schema.getMinLength(); + if (minLength != null) vSB.withMinLength(); + + Integer maxLength = schema.getMaxLength(); + if (maxLength != null) vSB.withMaxLength(); + + String pattern = schema.getPattern(); + if (pattern != null) vSB.withPattern(); + + BigDecimal multipleOf = schema.getMultipleOf(); + if (multipleOf != null) vSB.withMultipleOf(); + + BigDecimal minimum = schema.getMinimum(); + if (minimum != null) vSB.withMinimum(); + + BigDecimal maximum = schema.getMaximum(); + if (maximum != null) vSB.withMaximum(); + + Boolean exclusiveMinimum = schema.getExclusiveMinimum(); + if (exclusiveMinimum != null) vSB.withExclusiveMinimum(); + + Boolean exclusiveMaximum = schema.getExclusiveMaximum(); + if (exclusiveMaximum != null) vSB.withExclusiveMaximum(); + + LinkedHashSet setValidations = vSB.build(); + + if (isBooleanSchema(schema) || isNullType(schema)) { + logWarnMessagesForIneffectiveValidations(setValidations, schema, new HashSet<>()); + } else if (isArraySchema(schema)) { + if (minItems != null || maxItems != null || uniqueItems != null) setArrayValidations(minItems, maxItems, uniqueItems, target); - } else if (isTypeObjectSchema(schema)) { + logWarnMessagesForIneffectiveValidations(new LinkedHashSet(setValidations), schema, SchemaValidations.ARRAY_VALIDATIONS); + } else if (isTypeObjectSchema(schema)) { + if (minProperties != null || maxProperties != null) setObjectValidations(minProperties, maxProperties, target); - } else if (isStringSchema(schema)) { + logWarnMessagesForIneffectiveValidations(new LinkedHashSet(setValidations), schema, SchemaValidations.OBJECT_VALIDATIONS); + } else if (isStringSchema(schema)) { + if (minLength != null || maxLength != null || pattern != null) setStringValidations(minLength, maxLength, pattern, target); - if (isDecimalSchema(schema)) { + if (isDecimalSchema(schema)) { + if (multipleOf != null || minimum != null || maximum != null || exclusiveMinimum != null || exclusiveMaximum != null) setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); - } - } else if (isNumberSchema(schema) || isIntegerSchema(schema)) { - setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); - } else if (isAnyType(schema)) { - // anyType can have any validations set on it - setArrayValidations(minItems, maxItems, uniqueItems, target); - setObjectValidations(minProperties, maxProperties, target); - setStringValidations(minLength, maxLength, pattern, target); - setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); - } - if (maxItems != null || minItems != null || minProperties != null || maxProperties != null || minLength != null || maxLength != null || multipleOf != null || pattern != null || minimum != null || maximum != null || exclusiveMinimum != null || exclusiveMaximum != null || uniqueItems != null) { - target.setHasValidation(true); - } + Set stringAndNumericValidations = new HashSet<>(SchemaValidations.STRING_VALIDATIONS); + stringAndNumericValidations.addAll(SchemaValidations.NUMERIC_VALIDATIONS); + logWarnMessagesForIneffectiveValidations(new LinkedHashSet(setValidations), schema, stringAndNumericValidations); + } else + logWarnMessagesForIneffectiveValidations(new LinkedHashSet(setValidations), schema, SchemaValidations.STRING_VALIDATIONS); + + } else if (isNumberSchema(schema) || isIntegerSchema(schema)) { + if (multipleOf != null || minimum != null || maximum != null || exclusiveMinimum != null || exclusiveMaximum != null) + setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); + logWarnMessagesForIneffectiveValidations(new LinkedHashSet(setValidations), schema, SchemaValidations.NUMERIC_VALIDATIONS); + } else if (isAnyType(schema)) { + // anyType can have any validations set on it + setArrayValidations(minItems, maxItems, uniqueItems, target); + setObjectValidations(minProperties, maxProperties, target); + setStringValidations(minLength, maxLength, pattern, target); + setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); } + + if (!setValidations.isEmpty()) + target.setHasValidation(true); } private static void setArrayValidations(Integer minItems, Integer maxItems, Boolean uniqueItems, IJsonSchemaValidationProperties target) { @@ -1778,6 +1697,13 @@ public class ModelUtils { } } + private static void logWarnMessagesForIneffectiveValidations(Set setValidations, Schema schema, Set effectiveValidations) { + setValidations.removeAll(effectiveValidations); + setValidations.stream().forEach(validation -> { + LOGGER.warn("Validation '" + validation + "' has no effect on schema '"+ schema.getType() +"'. Ignoring!"); + }); + } + private static ObjectMapper getRightMapper(String data) { ObjectMapper mapper; if (data.trim().startsWith("{")) { @@ -1852,4 +1778,254 @@ public class ModelUtils { return new SemVer(version); } + + /** + * Returns true if the schema contains allOf but + * no properties/oneOf/anyOf defined. + * + * @param schema the schema + * @return true if the schema contains allOf but no properties/oneOf/anyOf defined. + */ + public static boolean isAllOf(Schema schema) { + if (hasAllOf(schema) && (schema.getProperties() == null || schema.getProperties().isEmpty()) && + (schema.getOneOf() == null || schema.getOneOf().isEmpty()) && + (schema.getAnyOf() == null || schema.getAnyOf().isEmpty())) { + return true; + } + + return false; + } + + /** + * Returns true if the schema contains allOf and may or may not have + * properties/oneOf/anyOf defined. + * + * @param schema the schema + * @return true if allOf is not empty + */ + public static boolean hasAllOf(Schema schema) { + if (schema.getAllOf() != null && !schema.getAllOf().isEmpty()) { + return true; + } + + return false; + } + + /** + * Returns true if the schema contains allOf and properties, + * and no oneOf/anyOf defined. + * + * @param schema the schema + * @return true if the schema contains allOf but no properties/oneOf/anyOf defined. + */ + public static boolean isAllOfWithProperties(Schema schema) { + return hasAllOf(schema) && (schema.getProperties() != null && !schema.getProperties().isEmpty()) && + (schema.getOneOf() == null || schema.getOneOf().isEmpty()) && + (schema.getAnyOf() == null || schema.getAnyOf().isEmpty()); + } + + /** + * Returns true if the schema contains oneOf but + * no properties/allOf/anyOf defined. + * + * @param schema the schema + * @return true if the schema contains oneOf but no properties/allOf/anyOf defined. + */ + public static boolean isOneOf(Schema schema) { + if (hasOneOf(schema) && (schema.getProperties() == null || schema.getProperties().isEmpty()) && + (schema.getAllOf() == null || schema.getAllOf().isEmpty()) && + (schema.getAnyOf() == null || schema.getAnyOf().isEmpty())) { + return true; + } + + return false; + } + + /** + * Returns true if the schema contains oneOf and may or may not have + * properties/allOf/anyOf defined. + * + * @param schema the schema + * @return true if allOf is not empty + */ + public static boolean hasOneOf(Schema schema) { + if (schema.getOneOf() != null && !schema.getOneOf().isEmpty()) { + return true; + } + + return false; + } + + /** + * Returns true if the schema contains anyOf but + * no properties/allOf/anyOf defined. + * + * @param schema the schema + * @return true if the schema contains oneOf but no properties/allOf/anyOf defined. + */ + public static boolean isAnyOf(Schema schema) { + if (hasAnyOf(schema) && (schema.getProperties() == null || schema.getProperties().isEmpty()) && + (schema.getAllOf() == null || schema.getAllOf().isEmpty()) && + (schema.getOneOf() == null || schema.getOneOf().isEmpty())) { + return true; + } + + return false; + } + + /** + * Returns true if the schema contains anyOf and may or may not have + * properties/allOf/oneOf defined. + * + * @param schema the schema + * @return true if anyOf is not empty + */ + public static boolean hasAnyOf(Schema schema) { + if (schema.getAnyOf() != null && !schema.getAnyOf().isEmpty()) { + return true; + } + + return false; + } + + /** + * Returns true if any of the common attributes of the schema (e.g. readOnly, default, maximum, etc) is defined. + * + * @param schema the schema + * @return true if allOf is not empty + */ + public static boolean hasCommonAttributesDefined(Schema schema) { + if (schema.getNullable() != null || schema.getDefault() != null || + schema.getMinimum() != null || schema.getMaximum() != null || + schema.getExclusiveMaximum() != null || schema.getExclusiveMinimum() != null || + schema.getMinLength() != null || schema.getMaxLength() != null || + schema.getMinItems() != null || schema.getMaxItems() != null || + schema.getReadOnly() != null || schema.getWriteOnly() != null || + schema.getPattern() != null) { + return true; + } + + return false; + } + + @FunctionalInterface + private interface OpenAPISchemaVisitor { + + void visit(Schema schema, String mimeType); + } + + private static final class SchemaValidations { + + public static Set ARRAY_VALIDATIONS = new ValidationSetBuilder() + .withMinItems() + .withMaxItems() + .withUniqueItems() + .build(); + public static Set OBJECT_VALIDATIONS = new ValidationSetBuilder() + .withMinProperties() + .withMaxProperties() + .build(); + public static Set STRING_VALIDATIONS = new ValidationSetBuilder() + .withMinLength() + .withMaxLength() + .withPattern() + .build(); + public static Set NUMERIC_VALIDATIONS = new ValidationSetBuilder() + .withMultipleOf() + .withMinimum() + .withMaximum() + .withExclusiveMinimum() + .withExclusiveMaximum() + .build(); + + public static Set ALL_VALIDATIONS; + + static { + ALL_VALIDATIONS = new HashSet<>(ARRAY_VALIDATIONS); + ALL_VALIDATIONS.addAll(OBJECT_VALIDATIONS); + ALL_VALIDATIONS.addAll(STRING_VALIDATIONS); + ALL_VALIDATIONS.addAll(NUMERIC_VALIDATIONS); + } + + SchemaValidations() { + } + + + public static class ValidationSetBuilder { + LinkedHashSet validationSet; + + ValidationSetBuilder() { + this.validationSet = new LinkedHashSet(); + } + + public ValidationSetBuilder withMinItems() { + this.validationSet.add("minItems"); + return this; + } + + public ValidationSetBuilder withMaxItems() { + this.validationSet.add("maxItems"); + return this; + } + + public ValidationSetBuilder withUniqueItems() { + this.validationSet.add("uniqueItems"); + return this; + } + + public ValidationSetBuilder withMinProperties() { + this.validationSet.add("minProperties"); + return this; + } + + public ValidationSetBuilder withMaxProperties() { + this.validationSet.add("maxProperties"); + return this; + } + + public ValidationSetBuilder withMinLength() { + this.validationSet.add("minLength"); + return this; + } + + public ValidationSetBuilder withMaxLength() { + this.validationSet.add("maxLength"); + return this; + } + + public ValidationSetBuilder withPattern() { + this.validationSet.add("pattern"); + return this; + } + + public ValidationSetBuilder withMultipleOf() { + this.validationSet.add("multipleOf"); + return this; + } + + public ValidationSetBuilder withMinimum() { + this.validationSet.add("minimum"); + return this; + } + + public ValidationSetBuilder withMaximum() { + this.validationSet.add("maximum"); + return this; + } + + public ValidationSetBuilder withExclusiveMinimum() { + this.validationSet.add("exclusiveMinimum"); + return this; + } + + public ValidationSetBuilder withExclusiveMaximum() { + this.validationSet.add("exclusiveMaximum"); + return this; + } + + public LinkedHashSet build() { + return this.validationSet; + } + } + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache index 14ec22fe248..2fd8862ba3d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache @@ -12,6 +12,9 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} import org.apache.hc.client5.http.cookie.BasicCookieStore; import org.apache.hc.client5.http.cookie.Cookie; @@ -141,6 +144,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { objectMapper.registerModule(new JodaModule()); {{/joda}} objectMapper.registerModule(new JavaTimeModule()); + {{#openApiNullable}} + objectMapper.registerModule(new JsonNullableModule()); + {{/openApiNullable}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api.mustache index 82466c4a1bc..4b542299a52 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api.mustache @@ -15,6 +15,7 @@ import {{invokerPackage}}.Pair; {{^fullJavaUtil}} import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -24,6 +25,8 @@ import java.util.StringJoiner; {{>generatedAnnotation}} {{#operations}} public class {{classname}} { + + private ApiClient apiClient; public {{classname}}() { @@ -65,6 +68,33 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}return {{/returnType}}this.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}Collections.emptyMap()); + } + + + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + {{/allParams}} + * @param additionalHeaders additionalHeaders for this call + {{#returnType}} + * @return {{returnType}} + {{/returnType}} + * @throws ApiException if fails to make API call + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Map additionalHeaders) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -126,6 +156,8 @@ public class {{classname}} { localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/headerParams}} + localVarHeaderParams.putAll(additionalHeaders); + {{#cookieParams}}if ({{paramName}} != null) localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/cookieParams}} @@ -168,6 +200,7 @@ public class {{classname}} { {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} ); } + {{/operation}} } {{/operations}} 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 962f41cc6fc..a8ef032386f 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 @@ -38,6 +38,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -45,11 +46,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; {{#jsr310}} import java.time.OffsetDateTime; {{/jsr310}} @@ -79,80 +83,93 @@ import {{invokerPackage}}.auth.OAuth; */ {{>generatedAnnotation}} public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "{{{basePath}}}"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( -{{/-first}} new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + protected List servers = new ArrayList<>({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} ){{/-last}}{{/servers}}); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ + {{^hasOperationServers}} + protected Map> operationServers = new HashMap<>(); + {{/hasOperationServers}} + {{#hasOperationServers}} + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); {{#apiInfo}} {{#apis}} {{#operations}} {{#operation}} {{#servers}} {{#-first}} - put("{{{classname}}}.{{{operationId}}}", new ArrayList(Arrays.asList( + operationServers.put("{{{classname}}}.{{{operationId}}}", new ArrayList<>(Arrays.asList( {{/-first}} - new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} - )));{{/-last}} + ))); + {{/-last}} {{/servers}} {{/operation}} {{/operations}} {{/apis}} {{/apiInfo}} - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + this.operationServers = operationServers; + } + + {{/hasOperationServers}} + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -189,7 +206,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; {{#authMethods}} if (authMap != null) { @@ -235,7 +252,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} + authenticationLookup = new HashMap<>();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}} } @@ -830,7 +847,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -889,14 +906,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -908,8 +924,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -929,8 +945,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1222,20 +1238,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - {{#hasHttpSignatureMethods}} - serializeToString(body, formParams, contentType, isBodyNullable), - {{/hasHttpSignatureMethods}} - {{^hasHttpSignatureMethods}} - null, - {{/hasHttpSignatureMethods}} - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + {{#hasHttpSignatureMethods}} + serializeToString(body, formParams, contentType, isBodyNullable), + {{/hasHttpSignatureMethods}} + {{^hasHttpSignatureMethods}} + null, + {{/hasHttpSignatureMethods}} + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1253,7 +1271,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#hasOAuthMethods}} // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (statusCode == Status.UNAUTHORIZED.getStatusCode()) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1425,10 +1443,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } 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 873a39ab33a..25287dcf7f1 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 @@ -76,7 +76,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -96,7 +96,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -205,12 +205,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/additional_properties.mustache index 61973dc24fa..2955e93922d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/additional_properties.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/additional_properties.mustache @@ -13,7 +13,7 @@ @JsonAnySetter public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache index 1d20bad1a66..8239a303ffb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -134,7 +134,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -166,7 +166,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isNullable}} {{#anyOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } 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 ac16f6e0598..0048d3c97d8 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 @@ -14,6 +14,7 @@ import {{javaxPackage}}.ws.rs.core.GenericType; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -116,58 +117,84 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set + {{#hasRequiredParams}} + // Check required parameters + {{#allParams}} + {{#required}} if ({{paramName}} == null) { throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}} - // create path and map variables + {{/required}} + {{/allParams}} + + {{/hasRequiredParams}} + {{#hasPathParams}} + // Path parameters String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; - - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}{{^isString}}.toString(){{/isString}})){{/pathParams}}; + {{/hasPathParams}} {{#queryParams}} + {{#-first}} + // Query parameters + {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList<>( + apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}) + ); + {{/-first}} + {{^-first}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/-first}} + {{#-last}} + + {{/-last}} {{/queryParams}} + {{#headerParams}} + {{#-first}} + // Header parameters + {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/headerParams}} + {{#cookieParams}} + {{#-first}} + // Cookie parameters + {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#cookieParams}}if ({{paramName}} != null) - localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/cookieParams}} + {{#formParams}} + {{#-first}} + // Form parameters + {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarFormParams.put("{{baseName}}", {{paramName}});{{^required}} + }{{/required}} + {{#-last}} - {{#formParams}}if ({{paramName}} != null) - localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/-last}} {{/formParams}} - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - + String localVarAccept = apiClient.selectHeaderAccept({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}); + String localVarContentType = apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); + {{#hasAuthMethods}} + String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% + {{/hasAuthMethods}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; - {{/returnType}} - return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); + return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); } {{#vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache index 74ad0aa8258..50c1c60efc5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache @@ -60,7 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#useOneOfDiscriminatorLookup}} {{#discriminator}} {{classname}} new{{classname}} = new {{classname}}(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { {{#mappedModels}} @@ -132,7 +132,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -167,7 +167,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -199,7 +199,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isNullable}} {{#oneOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index 255be1f0991..4d60d2b9c05 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -141,13 +141,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/defaultValue}} - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -168,13 +164,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/defaultValue}} - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -389,7 +381,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return 0; } - public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<>() { public {{classname}} createFromParcel(Parcel in) { {{#model}} {{#isArray}} @@ -408,14 +400,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }; {{/parcelableModel}} {{#discriminator}} -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - {{#mappedModels}} - mappings.put("{{mappingName}}", {{modelName}}.class); - {{/mappedModels}} - mappings.put("{{name}}", {{classname}}.class); - JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + {{#mappedModels}} + mappings.put("{{mappingName}}", {{modelName}}.class); + {{/mappedModels}} + mappings.put("{{name}}", {{classname}}.class); + JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); + } {{/discriminator}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache index 962f41cc6fc..b954f950c82 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache @@ -38,6 +38,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -45,11 +46,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; {{#jsr310}} import java.time.OffsetDateTime; {{/jsr310}} @@ -79,80 +83,93 @@ import {{invokerPackage}}.auth.OAuth; */ {{>generatedAnnotation}} public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "{{{basePath}}}"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( -{{/-first}} new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + protected List servers = new ArrayList<>({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} ){{/-last}}{{/servers}}); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ + {{^hasOperationServers}} + protected Map> operationServers = new LinkedHashMap<>(); + {{/hasOperationServers}} + {{#hasOperationServers}} + protected Map> operationServers; + + { + Map> operationServers = new LinkedHashMap<>(); {{#apiInfo}} {{#apis}} {{#operations}} {{#operation}} {{#servers}} {{#-first}} - put("{{{classname}}}.{{{operationId}}}", new ArrayList(Arrays.asList( + operationServers.put("{{{classname}}}.{{{operationId}}}", new ArrayList<>(Arrays.asList( {{/-first}} - new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} - )));{{/-last}} + ))); + {{/-last}} {{/servers}} {{/operation}} {{/operations}} {{/apis}} {{/apiInfo}} - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + this.operationServers = operationServers; + } + + {{/hasOperationServers}} + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -189,7 +206,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; {{#authMethods}} if (authMap != null) { @@ -235,7 +252,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} + authenticationLookup = new HashMap<>();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}} } @@ -830,7 +847,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -889,14 +906,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -908,8 +924,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -929,8 +945,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1222,20 +1238,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - {{#hasHttpSignatureMethods}} - serializeToString(body, formParams, contentType, isBodyNullable), - {{/hasHttpSignatureMethods}} - {{^hasHttpSignatureMethods}} - null, - {{/hasHttpSignatureMethods}} - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + {{#hasHttpSignatureMethods}} + serializeToString(body, formParams, contentType, isBodyNullable), + {{/hasHttpSignatureMethods}} + {{^hasHttpSignatureMethods}} + null, + {{/hasHttpSignatureMethods}} + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1253,7 +1271,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#hasOAuthMethods}} // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (statusCode == Status.UNAUTHORIZED.getStatusCode()) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1425,10 +1443,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache index 873a39ab33a..25287dcf7f1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache @@ -76,7 +76,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -96,7 +96,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -205,12 +205,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/additional_properties.mustache index 61973dc24fa..2955e93922d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/additional_properties.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/additional_properties.mustache @@ -13,7 +13,7 @@ @JsonAnySetter public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache index 1d20bad1a66..8239a303ffb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -134,7 +134,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -166,7 +166,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isNullable}} {{#anyOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache index ac16f6e0598..0048d3c97d8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache @@ -14,6 +14,7 @@ import {{javaxPackage}}.ws.rs.core.GenericType; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -116,58 +117,84 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set + {{#hasRequiredParams}} + // Check required parameters + {{#allParams}} + {{#required}} if ({{paramName}} == null) { throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}} - // create path and map variables + {{/required}} + {{/allParams}} + + {{/hasRequiredParams}} + {{#hasPathParams}} + // Path parameters String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; - - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}{{^isString}}.toString(){{/isString}})){{/pathParams}}; + {{/hasPathParams}} {{#queryParams}} + {{#-first}} + // Query parameters + {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList<>( + apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}) + ); + {{/-first}} + {{^-first}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/-first}} + {{#-last}} + + {{/-last}} {{/queryParams}} + {{#headerParams}} + {{#-first}} + // Header parameters + {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/headerParams}} + {{#cookieParams}} + {{#-first}} + // Cookie parameters + {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#cookieParams}}if ({{paramName}} != null) - localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/cookieParams}} + {{#formParams}} + {{#-first}} + // Form parameters + {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarFormParams.put("{{baseName}}", {{paramName}});{{^required}} + }{{/required}} + {{#-last}} - {{#formParams}}if ({{paramName}} != null) - localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/-last}} {{/formParams}} - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - + String localVarAccept = apiClient.selectHeaderAccept({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}); + String localVarContentType = apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); + {{#hasAuthMethods}} + String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% + {{/hasAuthMethods}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; - {{/returnType}} - return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); + return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); } {{#vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache index 74ad0aa8258..de29a873b63 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache @@ -132,7 +132,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -167,7 +167,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -199,7 +199,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isNullable}} {{#oneOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache index c116c66654d..e418c1be31e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache @@ -141,13 +141,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/defaultValue}} - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -168,13 +164,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/defaultValue}} - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -389,7 +381,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return 0; } - public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<>() { public {{classname}} createFromParcel(Parcel in) { {{#model}} {{#isArray}} @@ -408,14 +400,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }; {{/parcelableModel}} {{#discriminator}} -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - {{#mappedModels}} - mappings.put("{{mappingName}}", {{modelName}}.class); - {{/mappedModels}} - mappings.put("{{name}}", {{classname}}.class); - JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + {{#mappedModels}} + mappings.put("{{mappingName}}", {{modelName}}.class); + {{/mappedModels}} + mappings.put("{{name}}", {{classname}}.class); + JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); + } {{/discriminator}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index 3d1f9dbc03b..f0f6960bfca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -496,11 +496,15 @@ public class {{classname}} { {{#formParams}} {{#isArray}} for (int i=0; i < {{paramName}}.size(); i++) { - formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.get(i).toString())); + if ({{paramName}}.get(i) != null) { + formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.get(i).toString())); + } } {{/isArray}} {{^isArray}} - formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.toString())); + if ({{paramName}} != null) { + formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.toString())); + } {{/isArray}} {{/formParams}} HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache index bdfa5eb4df7..dbd74e348ca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -141,11 +141,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = new ArrayList<>(); + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -166,13 +164,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/defaultValue}} - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -273,6 +267,23 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vars}} {{>libraries/native/additional_properties}} + {{#parent}} + {{#allVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + + {{/isOverridden}} + {{/allVars}} + {{/parent}} /** * Return true if this {{name}} object is equal to o. */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache index bd86563c983..726189418cb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache @@ -158,13 +158,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/defaultValue}} - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -185,13 +181,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/defaultValue}} - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} 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 b5de6ce3a19..a844c8c384f 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 @@ -81,7 +81,6 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} {{>generatedAnnotation}} -@Component("{{invokerPackage}}.ApiClient") public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -115,7 +114,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { init(); } - @Autowired public ApiClient(RestTemplate restTemplate) { this.restTemplate = restTemplate; init(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index f2e8a1b2c80..87da6cf0402 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -27,7 +27,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; {{>generatedAnnotation}} -@Component("{{package}}.{{classname}}") {{#operations}} public class {{classname}} { private ApiClient apiClient; @@ -36,7 +35,6 @@ public class {{classname}} { this(new ApiClient()); } - @Autowired public {{classname}}(ApiClient apiClient) { this.apiClient = apiClient; } 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 7ec8edd1fe9..2b586ef0c03 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 @@ -32,8 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { + {{#useJakartaEe}} + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 + {{/useJakartaEe}} } // Rename the aar correctly @@ -66,7 +72,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -78,8 +84,14 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' + {{#useJakartaEe}} + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 + {{/useJakartaEe}} publishing { publications { @@ -91,26 +103,36 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } ext { + {{#swagger1AnnotationLibrary}} swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} jackson_version = "2.14.1" jackson_databind_version = "2.14.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" + {{#useJakartaEe}} + spring_web_version = "6.0.3" + jakarta_annotation_version = "2.1.1" + {{/useJakartaEe}} + {{^useJakartaEe}} spring_web_version = "5.3.24" + jakarta_annotation_version = "1.3.5" + {{/useJakartaEe}} jodatime_version = "2.9.9" junit_version = "4.13.2" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.springframework:spring-web:$spring_web_version" implementation "org.springframework:spring-context:$spring_web_version" 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 f92534f5699..34fed083474 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 @@ -32,7 +32,7 @@ ext { swagger_annotations_version = "1.5.21" jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" - vertx_version = "3.4.2" + vertx_version = "3.5.2" junit_version = "4.13.2" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" 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 5e487d12492..35592f629ea 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 @@ -292,7 +292,7 @@ UTF-8 - 3.4.2 + 3.5.2 1.6.6 2.13.4 2.13.4.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index 0e21e620f24..0d29af88fb9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -32,8 +32,14 @@ if(hasProperty('target') && target == 'android') { } compileOptions { + {{#useJakartaEe}} + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 + {{/useJakartaEe}} } // Rename the aar correctly @@ -66,7 +72,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -78,8 +84,14 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' + {{#useJakartaEe}} + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 + {{/useJakartaEe}} publishing { publications { @@ -91,17 +103,17 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } @@ -112,22 +124,36 @@ if(hasProperty('target') && target == 'android') { } ext { + {{#swagger1AnnotationLibrary}} swagger_annotations_version = "1.6.3" + {{/swagger1AnnotationLibrary}} + {{#useJakartaEe}} + spring_boot_version = "3.0.1" + jakarta_annotation_version = "2.1.1" + reactor_version = "3.5.1" + reactor_netty_version = "1.1.1" + {{/useJakartaEe}} + {{^useJakartaEe}} spring_boot_version = "2.6.6" + jakarta_annotation_version = "1.3.5" + reactor_version = "3.4.3" + reactor_netty_version = "1.0.4" + {{/useJakartaEe}} jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" - reactor_version = "3.4.3" - reactor_netty_version = "1.0.4" + {{#joda}} jodatime_version = "2.9.9" + {{/joda}} junit_version = "4.13.2" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.projectreactor:reactor-core:$reactor_version" implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index e8d4dc8ee21..9d2db9a73f2 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -146,13 +146,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/defaultValue}} - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -174,11 +170,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} {{^required}} - {{#defaultValue}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/defaultValue}} {{/required}} this.{{name}}.put(key, {{name}}Item); return this; @@ -276,7 +270,23 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isReadOnly}} {{/vars}} + {{#parent}} + {{#allVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{/isOverridden}} + {{/allVars}} + {{/parent}} @Override public boolean equals(Object o) { {{#useReflectionEqualsHashCode}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache index b9d34d678d6..f00d72939a7 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache @@ -61,7 +61,7 @@ public class {{classname}} { @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) { - return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); + return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{#isMultipart}}{{paramName}}InputStream, {{paramName}}Detail{{/isMultipart}}{{^isMultipart}}{{paramName}}{{/isMultipart}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); } {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 0e071a15317..87f4ec974f1 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -51,11 +51,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#isArray}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; } @@ -64,11 +62,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#isMap}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index ed27882f268..d60e46927f8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -47,11 +47,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#isArray}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; } @@ -59,11 +57,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#isMap}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidation.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidation.mustache index c8c6946fef6..6bed33003cb 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidation.mustache @@ -1,4 +1,2 @@ -{{#required}} - @NotNull -{{/required}} -{{>beanValidationCore}} \ No newline at end of file +{{#required}}{{^isReadOnly}} @NotNull +{{/isReadOnly}}{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache index 2a4074e4c6b..8d4e28af4b5 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache @@ -53,23 +53,19 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#isArray}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} - if ({{name}} == null) { - {{name}} = {{{defaultValue}}}; + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} - {{name}}.add({{name}}Item); + this.{{name}}.add({{name}}Item); return this; } {{/isArray}} {{#isMap}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index ece96d8eba1..7bf4efe7320 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -31,7 +31,12 @@ import io.virtualan.annotation.VirtualService; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; {{/jdk8-no-delegate}} +{{^useResponseEntity}} +import org.springframework.http.HttpStatus; +{{/useResponseEntity}} +{{#useResponseEntity}} import org.springframework.http.ResponseEntity; +{{/useResponseEntity}} {{#useBeanValidation}} import org.springframework.validation.annotation.Validated; {{/useBeanValidation}} @@ -222,7 +227,10 @@ public interface {{classname}} { headers = { {{#vendorExtensions.versionHeaderParamsList}}"{{baseName}}{{#defaultValue}}={{{.}}}{{/defaultValue}}"{{^-last}}, {{/-last}}{{/vendorExtensions.versionHeaderParamsList}} } {{/hasVersionHeaders}}{{#hasVersionQueryParams}}, params = { {{#vendorExtensions.versionQueryParamsList}}"{{baseName}}{{#defaultValue}}={{{.}}}{{/defaultValue}}"{{^-last}}, {{/-last}}{{/vendorExtensions.versionQueryParamsList}} } {{/hasVersionQueryParams}} ) - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}( + {{^useResponseEntity}} + @ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}}) + {{/useResponseEntity}} + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}( {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, @@ -233,7 +241,7 @@ public interface {{classname}} { } // Override this method - {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { {{/delegate-method}} {{^isDelegate}} {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache index df224372c6e..f66ae61551f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache @@ -21,7 +21,9 @@ import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; +{{#useResponseEntity}} import org.springframework.http.ResponseEntity; +{{/useResponseEntity}} import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -109,7 +111,7 @@ public class {{classname}}Controller implements {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}( + public {{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}( {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}}, {{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}} @@ -119,9 +121,9 @@ public class {{classname}}Controller implements {{classname}} { {{>methodBody}} {{/async}} {{#async}} - return new CallablereturnTypes}}>>() { + return new Callable<{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}>() { @Override - public ResponseEntity<{{>returnTypes}}> call() { + public {{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}} call() { {{>methodBody}} } }; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache index b11e41a5425..a544adc2dcc 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache @@ -4,7 +4,9 @@ package {{package}}; {{/imports}} import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; +{{#useResponseEntity}} import org.springframework.http.ResponseEntity; +{{/useResponseEntity}} import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; {{#reactive}} @@ -60,7 +62,7 @@ public interface {{classname}}Delegate { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}}, + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} { {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache index f8aa5ab2a9a..7ebfccafca5 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache @@ -11,8 +11,10 @@ minLength not set, maxLength set }}{{#minItems}}{{^maxItems}}@Size(min = {{minItems}}) {{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set }}{{^minItems}}{{#maxItems}}@Size(max = {{.}}) {{/maxItems}}{{/minItems}}{{! -@Email: useBeanValidation set && isEmail set -}}{{#useBeanValidation}}{{#isEmail}}@Email{{/isEmail}}{{/useBeanValidation}}{{! +@Email: useBeanValidation +}}{{#isEmail}}{{#useBeanValidation}}@{{javaxPackage}}.validation.constraints.Email{{/useBeanValidation}}{{! +@Email: performBeanValidation exclusive +}}{{^useBeanValidation}}{{#performBeanValidation}}@org.hibernate.validator.constraints.Email{{/performBeanValidation}}{{/useBeanValidation}}{{/isEmail}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}}@Min({{.}}) {{/minimum}}{{#maximum}}@Max({{.}}) {{/maximum}}{{/isInteger}}{{! diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache index 23dfcf6759b..0decb2314ba 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache @@ -14,14 +14,20 @@ return CompletableFuture.supplyAsync(()-> { {{#-last}} {{#async}} {{/async}}{{^async}} {{/async}} } {{#async}} {{/async}} }); -{{#async}} {{/async}} return new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); +{{#async}} {{/async}} {{#useResponseEntity}}return new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); +{{/useResponseEntity}} +{{^useResponseEntity}}throw new IllegalArgumentException("Not implemented"); +{{/useResponseEntity}} {{#async}} }, Runnable::run); {{/async}} {{/-last}} {{/examples}} {{^examples}} -return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}){{#async}}){{/async}}; +{{#useResponseEntity}}return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}){{#async}}){{/async}}; +{{/useResponseEntity}} +{{^useResponseEntity}}throw new IllegalArgumentException("Not implemented"); +{{/useResponseEntity}} {{/examples}} {{/reactive}} {{#reactive}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 45c9c96dcd4..e7f8b62369e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -45,7 +45,6 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{/isContainer}} {{/isEnum}} {{#jackson}} - @JsonProperty("{{baseName}}") {{#withXml}} @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/withXml}} @@ -59,10 +58,10 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#isContainer}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} {{#openApiNullable}} - private {{>nullableDataType}} {{name}} = {{#isNullable}}JsonNullable.undefined(){{/isNullable}}{{^isNullable}}{{#required}}{{{defaultValue}}}{{/required}}{{^required}}null{{/required}}{{/isNullable}}; + private {{>nullableDataType}} {{name}}{{#isNullable}} = JsonNullable.undefined(){{/isNullable}}{{^isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isNullable}}; {{/openApiNullable}} {{^openApiNullable}} - private {{>nullableDataType}} {{name}} = {{#required}}{{{defaultValue}}}{{/required}}{{^required}}null{{/required}}; + private {{>nullableDataType}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/openApiNullable}} {{/isContainer}} {{^isContainer}} @@ -80,6 +79,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{/openApiNullable}} {{/isContainer}} {{/vars}} + {{#generatedConstructorWithRequiredArgs}} {{#hasRequired}} /** @@ -110,6 +110,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{/vars}} } {{/hasRequired}} + {{/generatedConstructorWithRequiredArgs}} {{#vars}} {{! begin feature: fluent setter methods }} @@ -126,16 +127,14 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#openApiNullable}} - {{^required}} if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}{{#isNullable}}){{/isNullable}}; } - {{/required}} this.{{name}}{{#isNullable}}.get(){{/isNullable}}.add({{name}}Item); {{/openApiNullable}} {{^openApiNullable}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } this.{{name}}.add({{name}}Item); {{/openApiNullable}} @@ -145,11 +144,9 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#isMap}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } @@ -187,6 +184,9 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") {{/swagger1AnnotationLibrary}} + {{#jackson}} + @JsonProperty("{{baseName}}") + {{/jackson}} public {{>nullableDataType}} {{getter}}() { return {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/api.mustache b/modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/api.mustache index 82ab5f8c99c..a18b4148790 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/api.mustache @@ -29,7 +29,7 @@ export default class <&classname> extends ApiClient { * <¬es><#allParams><#required> * @param {<&vendorExtensions.x-jsdoc-type>} <¶mName> <&description><#hasOptionalParams> * @param {Object} opts Optional parameters<#allParams><^required> - * @param {<&vendorExtensions.x-jsdoc-type>} opts.<¶mName> <&description><#defaultValue> (default to <&.>) + * @param {<&vendorExtensions.x-jsdoc-type>} [<¶mName><#defaultValue> = <&.>] <&description> * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} <=| |=>* @return {Promise|#returnType|<|&vendorExtensions.x-jsdoc-type|>|/returnType|}|=< >=| */ diff --git a/modules/openapi-generator/src/main/resources/Javascript/libraries/javascript/api.mustache b/modules/openapi-generator/src/main/resources/Javascript/libraries/javascript/api.mustache index 84b2386c24a..cbe441ca08c 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/libraries/javascript/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/libraries/javascript/api.mustache @@ -38,7 +38,7 @@ export default class <&classname> { * <¬es><#allParams><#required> * @param {<&vendorExtensions.x-jsdoc-type>} <¶mName> <&description><#hasOptionalParams> * @param {Object} opts Optional parameters<#allParams><^required> - * @param {<&vendorExtensions.x-jsdoc-type>} opts.<¶mName> <&description><#defaultValue> (default to <&.>)<^usePromises> + * @param {<&vendorExtensions.x-jsdoc-type>} [<¶mName><#defaultValue> = <&.>)] <&description><^usePromises> * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~<&operationId>Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with an object containing data of type {@link <&vendorExtensions.x-jsdoc-type>} and HTTP response<^returnType>, with an object containing HTTP response 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 bac277ba6d2..633534b8f5f 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 @@ -22,7 +22,6 @@ org.openapitools.codegen.languages.CppTizenClientCodegen org.openapitools.codegen.languages.CppUE4ClientCodegen org.openapitools.codegen.languages.CSharpClientCodegen org.openapitools.codegen.languages.CSharpNetCoreClientCodegen -org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen org.openapitools.codegen.languages.CsharpNetcoreFunctionsServerCodegen org.openapitools.codegen.languages.DartClientCodegen org.openapitools.codegen.languages.DartDioClientCodegen @@ -140,4 +139,4 @@ org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen -org.openapitools.codegen.languages.WsdlSchemaCodegen \ No newline at end of file +org.openapitools.codegen.languages.WsdlSchemaCodegen diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache index 4e8fa2022b2..c2d31c5370c 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache @@ -36,6 +36,9 @@ namespace {{packageName}}.Models {{#description}} /// {{.}} {{/description}} + {{#example}} + /// {{.}} + {{/example}} {{#required}} [Required] {{/required}} 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 362708e149e..30ee6f18d35 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 @@ -35,7 +35,8 @@ namespace {{modelPackage}} /// /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{.}}{{/description}}{{#required}} + /// {{.}}{{/description}}{{#example}} + /// {{.}}{{/example}}{{#required}} [Required]{{/required}}{{#pattern}} [RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} [StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache index e96ce19cf52..888955ed4bb 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache @@ -11,7 +11,9 @@ using Newtonsoft.Json; {{#model}} {{#discriminator}} using JsonSubTypes; +{{#useSwashbuckle}} using Swashbuckle.AspNetCore.Annotations; +{{/useSwashbuckle}} {{/discriminator}} {{/model}} {{/models}} @@ -27,10 +29,14 @@ namespace {{modelPackage}} [DataContract] {{#discriminator}} [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] + {{#useSwashbuckle}} [SwaggerDiscriminator("{{{discriminatorName}}}")] + {{/useSwashbuckle}} {{#mappedModels}} [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] + {{#useSwashbuckle}} [SwaggerSubType(typeof({{{modelName}}}), DiscriminatorValue = "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] + {{/useSwashbuckle}} {{/mappedModels}} {{/discriminator}} public {{#modelClassModifier}}{{.}} {{/modelClassModifier}}class {{classname}} {{#parent}}: {{{.}}}{{^pocoModels}}, {{/pocoModels}}{{/parent}}{{^pocoModels}}{{^parent}}: {{/parent}}IEquatable<{{classname}}>{{/pocoModels}} @@ -51,7 +57,8 @@ namespace {{modelPackage}} /// /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{.}}{{/description}}{{#required}} + /// {{.}}{{/description}}{{#example}} + /// {{.}}{{/example}}{{#required}} [Required]{{/required}}{{#pattern}} [RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} [StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache index ae484139eb4..338fbf63591 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache @@ -2,39 +2,53 @@ cmake_minimum_required(VERSION 3.2) project({{{packageName}}}) -set(CMAKE_VERBOSE_MAKEFILE ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CXX_STANDARD_REQUIRED ON) - -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) -endif() - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() - -find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Gui) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network Gui) include(GNUInstallDirs) include(CMakePackageConfigHelpers) -file(GLOB_RECURSE HEADER_FILES "*.h") -file(GLOB_RECURSE SOURCE_FILES "*.cpp") - -add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES}) - -target_compile_options(${PROJECT_NAME} - PRIVATE - $<$,$,$>: - -Wall -Wno-unused-variable> -) +add_library(${PROJECT_NAME} +{{#models}} +{{#model}} + {{classname}}.h +{{/model}} +{{/models}} +{{#apiInfo}} +{{#apis}} +{{#operations}} + {{classname}}.h +{{/operations}} +{{/apis}} +{{/apiInfo}} + {{prefix}}Helpers.h + {{prefix}}HttpRequest.h + {{prefix}}Object.h + {{prefix}}Enum.h + {{prefix}}HttpFileElement.h + {{prefix}}ServerConfiguration.h + {{prefix}}ServerVariable.h + {{prefix}}Oauth.h +{{#models}} +{{#model}} + {{classname}}.cpp +{{/model}} +{{/models}} +{{#apiInfo}} +{{#apis}} +{{#operations}} + {{classname}}.cpp +{{/operations}} +{{/apis}} +{{/apiInfo}} + {{prefix}}Helpers.cpp + {{prefix}}HttpRequest.cpp + {{prefix}}HttpFileElement.cpp + {{prefix}}Oauth.cpp + ) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $ ) @@ -48,11 +62,6 @@ target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES}{{/contentCompression}} ) -if(NOT APPLE) - find_package(OpenSSL REQUIRED) - target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto) -endif() - configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/helpers-body.mustache index 0e19b1771fb..707a93be139 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/helpers-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/helpers-body.mustache @@ -225,7 +225,7 @@ bool fromStringValue(const QString &inStr, QByteArray &value) { } else { value.clear(); value.append(inStr.toUtf8()); - return value.count() > 0; + return value.size() > 0; } } diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/Build.cs.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/Build.cs.mustache index 9b33c5d3d57..bfbee1158a3 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/Build.cs.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/Build.cs.mustache @@ -11,7 +11,7 @@ public class {{unrealModuleName}} : ModuleRules new string[] { "Core", - "Http", + "HTTP", "Json", } ); diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache index 4868c236ea1..15ef30e93a5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache @@ -172,11 +172,16 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt HttpRequest->SetContentAsString(JsonBody); {{/bodyParams.0}} {{^bodyParams.0}} - // Form parameters + {{#formParams.0}} + // Form parameters added to try to generate a json body when no body parameters are specified. FString JsonBody; JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); Writer->WriteObjectStart(); {{#formParams}} + {{#isFile}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Files are not supported in json body")); + {{/isFile}} + {{^isFile}} {{#required}} Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{paramName}}); @@ -187,11 +192,13 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt WriteJsonValue(Writer, {{paramName}}.GetValue()); } {{/required}} + {{/isFile}} {{/formParams}} Writer->WriteObjectEnd(); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); HttpRequest->SetContentAsString(JsonBody); + {{/formParams.0}} {{/bodyParams.0}} } else if (Consumes.Contains(TEXT("multipart/form-data"))) diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache index 8d0efb6a1d9..d6091e4e3c7 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache @@ -47,7 +47,7 @@ bool {{classname}}::IsValid() const void {{classname}}::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) { - if(RetryManager != &GetHttpRetryManager()) + if (RetryManager != &InRetryManager) { DefaultRetryManager.Reset(); RetryManager = &InRetryManager; diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache index 640db9da815..f2a75bcf9dd 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache @@ -94,12 +94,18 @@ FString Base64UrlEncode(const T& Value) return Base64String; } -template +template::value, int>::type = 0> inline FStringFormatArg ToStringFormatArg(const T& Value) { return FStringFormatArg(Value); } +template::value, int>::type = 0> +inline FStringFormatArg ToStringFormatArg(const T& EnumModelValue) +{ + return FStringFormatArg(T::EnumToString(EnumModelValue.Value)); +} + inline FStringFormatArg ToStringFormatArg(const FDateTime& Value) { return FStringFormatArg(Value.ToIso8601()); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelGeneric.mustache index b9707924166..80122db2164 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelGeneric.mustache @@ -31,6 +31,9 @@ {{#description}} /// {{description}} {{/description}} + {{#example}} + /// {{.}} + {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } @@ -50,7 +53,7 @@ {{#isReadOnly}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - + /// /// Returns false as {{name}} should not be serialized given that it's read-only. @@ -179,6 +182,9 @@ /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// {{#description}} /// {{description}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache index eeafa6e8843..ffd28edb4a2 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache @@ -2,6 +2,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -41,7 +42,7 @@ namespace {{packageName}}.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -111,8 +112,12 @@ namespace {{packageName}}.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); 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 7f43f567b32..7ee1b93d7e8 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache @@ -145,7 +145,7 @@ namespace {{packageName}}.Client { "{{{name}}}", new Dictionary { {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {"default_value", "{{{defaultValue}}}"}, + {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, {{#enumValues}} {{#-first}} { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/RequestOptions.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/RequestOptions.mustache index 928c5e74073..cfc1469250a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/RequestOptions.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/RequestOptions.mustache @@ -35,10 +35,12 @@ namespace {{packageName}}.Client /// public Dictionary FormParameters { get; set; } + {{#supportsFileParameters}} /// /// File parameters to be sent along with the request. /// public Multimap FileParameters { get; set; } + {{/supportsFileParameters}} /// /// Cookies to be sent along with the request. @@ -76,7 +78,9 @@ namespace {{packageName}}.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); + {{#supportsFileParameters}} FileParameters = new Multimap(); + {{/supportsFileParameters}} Cookies = new List(); } } 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 57e1455087f..2a27f6a9f79 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache @@ -23,8 +23,8 @@ - - + + 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 2f6c23598d3..ddfa74e9d5f 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -361,13 +361,17 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} @@ -379,13 +383,17 @@ namespace {{packageName}}.{{apiPackage}} { {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} @@ -602,13 +610,17 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} @@ -620,13 +632,17 @@ namespace {{packageName}}.{{apiPackage}} { {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/auth/OAuthAuthenticator.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/auth/OAuthAuthenticator.mustache index cc0b3894a07..1f811bf2412 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/auth/OAuthAuthenticator.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/auth/OAuthAuthenticator.mustache @@ -63,7 +63,7 @@ namespace {{packageName}}.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -80,7 +80,7 @@ namespace {{packageName}}.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); + var response = await client.PostAsync(request).ConfigureAwait(false); return $"{response.TokenType} {response.AccessToken}"; } } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache index 2c200d418af..7e59130d6eb 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache @@ -6,10 +6,13 @@ using System; using System.IO; using System.Linq; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Text.RegularExpressions;{{#useCompareNetObjects}} using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} +using {{packageName}}.{{modelPackage}}; namespace {{packageName}}.{{clientPackage}} { @@ -93,7 +96,7 @@ namespace {{packageName}}.{{clientPackage}} /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -120,9 +123,45 @@ namespace {{packageName}}.{{clientPackage}} // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + {{#models}} + {{#model}} + {{#isEnum}} + if (obj is {{classname}} {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{classname}}Converter.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/isEnum}} + {{^isEnum}} + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/isEnum}} + {{/vars}} + {{/isEnum}} + {{/model}} + {{/models}} + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DateTimeJsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DateTimeJsonConverter.mustache index 55ecf4a1660..21d35ec2302 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DateTimeJsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DateTimeJsonConverter.mustache @@ -46,6 +46,6 @@ namespace {{packageName}}.{{clientPackage}} /// /// public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); } } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DateTimeNullableJsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DateTimeNullableJsonConverter.mustache index f052afa1491..52e2afa0b7a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DateTimeNullableJsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DateTimeNullableJsonConverter.mustache @@ -50,7 +50,7 @@ namespace {{packageName}}.{{clientPackage}} if (dateTimeValue == null) writer.WriteNullValue(); else - writer.WriteStringValue(dateTimeValue.Value.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.Value.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); } } } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/JsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/JsonConverter.mustache index 33d337de59e..915d943f8fb 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/JsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/JsonConverter.mustache @@ -8,14 +8,14 @@ /// /// The format to use to serialize {{name}} /// - public static string {{name}}Format { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + public static string {{name}}Format { get; set; } = "{{{dateTimeFormat}}}"; {{/isDateTime}} {{#isDate}} /// /// The format to use to serialize {{name}} /// - public static string {{name}}Format { get; set; } = "yyyy-MM-dd"; + public static string {{name}}Format { get; set; } = "{{{dateFormat}}}"; {{/isDate}} {{/allVars}} @@ -84,33 +84,33 @@ {{/isMap}} {{/isString}} {{#isBoolean}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetBoolean(); {{/isBoolean}} {{#isNumeric}} {{^isEnum}} {{#isDouble}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetDouble(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetDouble(); {{/isDouble}} {{#isDecimal}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetDecimal(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetDecimal(); {{/isDecimal}} {{#isFloat}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = (float)utf8JsonReader.GetDouble(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = (float)utf8JsonReader.GetDouble(); {{/isFloat}} {{#isLong}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64(); {{/isLong}} {{^isLong}} {{^isFloat}} {{^isDecimal}} {{^isDouble}} - {{#isNullable}} if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetInt32(); - {{/isNullable}} - {{^isNullable}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetInt32(); - {{/isNullable}} + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32(); {{/isDouble}} {{/isDecimal}} {{/isFloat}} @@ -118,15 +118,18 @@ {{/isEnum}} {{/isNumeric}} {{#isDate}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); {{/isDate}} {{#isDateTime}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); {{/isDateTime}} {{#isEnum}} {{^isMap}} {{#isNumeric}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32(); {{/isNumeric}} {{^isNumeric}} string {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue = utf8JsonReader.GetString(); @@ -140,7 +143,8 @@ {{/isMap}} {{/isEnum}} {{#isUuid}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetGuid(); {{/isUuid}} {{^isUuid}} {{^isEnum}} @@ -149,7 +153,8 @@ {{^isNumeric}} {{^isDate}} {{^isDateTime}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions); {{/isDateTime}} {{/isDate}} {{/isNumeric}} @@ -165,6 +170,21 @@ } } + {{#nonNullableVars}} + {{#-first}} +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + {{/-first}} + if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) + throw new ArgumentNullException(nameof({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}), "Property is required for class {{classname}}."); + + {{#-last}} +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + {{/-last}} + {{/nonNullableVars}} {{#composedSchemas.oneOf}} if ({{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized) return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/allVars}}{{/lambda.joinWithComma}}); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ModelSignature.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ModelSignature.mustache index 1cc9190e969..86e22d57f06 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ModelSignature.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ModelSignature.mustache @@ -1 +1 @@ -{{#model.allVars}}{{>PropertyDataType}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#defaultValue}} = {{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}{{#isNullable}} = default{{/isNullable}}{{/defaultValue}} {{/model.allVars}} \ No newline at end of file +{{#model.allVars}}{{>PropertyDataType}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#defaultValue}} = {{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}{{#isNullable}} = default{{/isNullable}}{{/defaultValue}} {{/model.allVars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OperationOrDefault.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OperationOrDefault.mustache index 01a2d1daf10..399c67f02e8 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OperationOrDefault.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OperationOrDefault.mustache @@ -9,16 +9,16 @@ /// <> public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}) { - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>{{nrt?}} result = null; + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>{{nrt?}} apiResponseLocalVar = null; try { - result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache index ccd0091ea50..76f13d93240 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache @@ -160,14 +160,14 @@ namespace {{packageName}}.{{apiPackage}} /// <> public async Task<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}> {{operationId}}Async({{>OperationSignature}}) { - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> apiResponseLocalVar = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); {{^nrt}}{{#returnTypeIsPrimitive}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - {{/returnTypeIsPrimitive}}{{/nrt}}if (result.Content == null){{^nrt}}{{#returnTypeIsPrimitive}} + {{/returnTypeIsPrimitive}}{{/nrt}}if (apiResponseLocalVar.Content == null){{^nrt}}{{#returnTypeIsPrimitive}} #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/returnTypeIsPrimitive}}{{/nrt}} - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content{{#nrt}}{{#returnProperty}}{{#isPrimitiveType}}{{^isMap}}{{^isString}}.Value{{/isString}}{{/isMap}}{{/isPrimitiveType}}{{/returnProperty}}{{/nrt}}; + return apiResponseLocalVar.Content{{#nrt}}{{#returnProperty}}{{#isPrimitiveType}}{{^isMap}}{{^isString}}{{^isContainer}}.Value{{/isContainer}}{{/isString}}{{/isMap}}{{/isPrimitiveType}}{{/returnProperty}}{{/nrt}}; } {{#nrt}} @@ -219,11 +219,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Processes the server response /// - /// + /// {{#allParams}} /// {{/allParams}} - protected virtual void After{{operationId}}({{#lambda.joinWithComma}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> apiResponse {{#allParams}}{{#requiredAndNotNullable}}{{#lambda.required}}{{{dataType}}}{{/lambda.required}} {{paramName}} {{/requiredAndNotNullable}}{{^requiredAndNotNullable}}{{#lambda.optional}}{{{dataType}}}{{/lambda.optional}} {{paramName}} {{/requiredAndNotNullable}}{{/allParams}}{{/lambda.joinWithComma}}) + protected virtual void After{{operationId}}({{#lambda.joinWithComma}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> apiResponseLocalVar {{#allParams}}{{#requiredAndNotNullable}}{{#lambda.required}}{{{dataType}}}{{/lambda.required}} {{paramName}} {{/requiredAndNotNullable}}{{^requiredAndNotNullable}}{{#lambda.optional}}{{{dataType}}}{{/lambda.optional}} {{paramName}} {{/requiredAndNotNullable}}{{/allParams}}{{/lambda.joinWithComma}}) { } @@ -252,44 +252,44 @@ namespace {{packageName}}.{{apiPackage}} /// <> where T : public async Task> {{operationId}}WithHttpInfoAsync({{>OperationSignature}}) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - {{#allParams}}{{#-first}}{{#-last}}{{paramName}} = {{/-last}}{{^-last}}var validatedParameters = {{/-last}}{{/-first}}{{/allParams}}On{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#allParams}}{{#-first}}{{#-last}}{{paramName}} = {{/-last}}{{^-last}}var validatedParameterLocalVars = {{/-last}}{{/-first}}{{/allParams}}On{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#allParams}} {{#-first}} {{^-last}} {{#allParams}} - {{paramName}} = validatedParameters.Item{{-index}}; + {{paramName}} = validatedParameterLocalVars.Item{{-index}}; {{/allParams}} {{/-last}} {{/-first}} {{/allParams}} - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { {{^servers}} - uriBuilder.Host = HttpClient.BaseAddress{{nrt!}}.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "{{path}}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{path}}"; {{/servers}} {{#servers}} {{#-first}} - var url = request.RequestUri = new Uri("{{url}}"); - uriBuilder.Host = url.Authority; - uriBuilder.Scheme = url.Scheme; - uriBuilder.Path = url.AbsolutePath; + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("{{url}}"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; {{/-first}} {{/servers}} {{#pathParams}} {{#required}} - uriBuilder.Path = uriBuilder.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString()));{{/required}}{{^required}} + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString()));{{/required}}{{^required}} if ({{paramName}} != null) - uriBuilder.Path = uriBuilder.Path + $"/{ Uri.EscapeDataString({{paramName}}).ToString()) }"; + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path + $"/{ Uri.EscapeDataString({{paramName}}).ToString()) }"; {{#-last}} {{/-last}} @@ -297,167 +297,167 @@ namespace {{packageName}}.{{apiPackage}} {{/pathParams}} {{#queryParams}} {{#-first}} - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/-first}}{{/queryParams}}{{^queryParams}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/-first}}{{/queryParams}}{{^queryParams}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/queryParams}}{{#queryParams}}{{#required}}{{#-first}} + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/queryParams}}{{#queryParams}}{{#required}}{{#-first}} {{! all the redundant tags here are to get the spacing just right }} - {{/-first}}{{/required}}{{/queryParams}}{{#queryParams}}{{#required}}parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{nrt!}}); + {{/-first}}{{/required}}{{/queryParams}}{{#queryParams}}{{#required}}parseQueryStringLocalVar["{{baseName}}"] = {{paramName}}.ToString(); {{/required}}{{/queryParams}}{{#queryParams}}{{#-first}} {{/-first}}{{/queryParams}}{{#queryParams}}{{^required}}if ({{paramName}} != null) - parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{nrt!}}); + parseQueryStringLocalVar["{{baseName}}"] = {{paramName}}.ToString(); - {{/required}}{{#-last}}uriBuilder.Query = parseQueryString.ToString(); + {{/required}}{{#-last}}uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); {{/-last}} {{/queryParams}} {{#headerParams}} {{#required}} - request.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); {{/required}} {{^required}} if ({{paramName}} != null) - request.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); {{/required}} {{/headerParams}} {{#formParams}} {{#-first}} - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams));{{/-first}}{{^isFile}}{{#required}} + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars));{{/-first}}{{^isFile}}{{#required}} - formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); {{/required}} {{^required}} if ({{paramName}} != null) - formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); {{/required}} {{/isFile}} {{#isFile}} {{#required}} - multipartContent.Add(new StreamContent({{paramName}})); + multipartContentLocalVar.Add(new StreamContent({{paramName}})); {{/required}} {{^required}} if ({{paramName}} != null) - multipartContent.Add(new StreamContent({{paramName}})); + multipartContentLocalVar.Add(new StreamContent({{paramName}})); {{/required}} {{/isFile}} {{/formParams}} {{#bodyParam}} - request.Content = ({{paramName}} as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize({{paramName}}, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = ({{paramName}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}, _jsonSerializerOptions)); {{/bodyParam}} {{#authMethods}} {{#-first}} - List tokens = new List(); + List tokenBaseLocalVars = new List(); {{/-first}} {{#isApiKey}} - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey);{{#isKeyInHeader}} + tokenBaseLocalVars.Add(apiKeyTokenLocalVar);{{#isKeyInHeader}} - apiKey.UseInHeader(request, "{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}} + apiKeyTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}} - apiKey.UseInQuery(request, uriBuilder, parseQueryString, "{{keyParamName}}"); + apiKeyTokenLocalVar.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "{{keyParamName}}"); - uriBuilder.Query = parseQueryString.ToString();{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}} + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}} {{! below line must be after any UseInQuery calls, but before using the HttpSignatureToken}} - request.RequestUri = uriBuilder.Uri;{{#authMethods}}{{#isBasicBasic}} + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri;{{#authMethods}}{{#isBasicBasic}} - BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + BasicToken basicTokenLocalVar = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(basicToken); + tokenBaseLocalVars.Add(basicTokenLocalVar); - basicToken.UseInHeader(request, "{{keyParamName}}");{{/isBasicBasic}}{{#isBasicBearer}} + basicTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}");{{/isBasicBasic}}{{#isBasicBearer}} - BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + BearerToken bearerTokenLocalVar = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(bearerToken); + tokenBaseLocalVars.Add(bearerTokenLocalVar); - bearerToken.UseInHeader(request, "{{keyParamName}}");{{/isBasicBearer}}{{#isOAuth}} + bearerTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}");{{/isBasicBearer}}{{#isOAuth}} - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, "{{keyParamName}}");{{/isOAuth}}{{#isHttpSignature}} + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}");{{/isOAuth}}{{#isHttpSignature}} - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content{{nrt!}}.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content{{nrt!}}.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken);{{/isHttpSignature}}{{/authMethods}}{{#consumes}}{{#-first}} + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken);{{/isHttpSignature}}{{/authMethods}}{{#consumes}}{{#-first}} string[] contentTypes = new string[] { {{/-first}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{#-last}} };{{/-last}}{{/consumes}}{{#consumes}}{{#-first}} - string{{nrt?}} contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string{{nrt?}} contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType);{{/-first}}{{/consumes}}{{#produces}}{{#-first}} + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar);{{/-first}}{{/consumes}}{{#produces}}{{#-first}} - string[] accepts = new string[] { {{/-first}}{{/produces}} + string[] acceptLocalVars = new string[] { {{/-first}}{{/produces}} {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}{{#produces}}{{#-last}} };{{/-last}}{{/produces}}{{#produces}}{{#-first}} - string{{nrt?}} accept = ClientUtils.SelectHeaderAccept(accepts); + string{{nrt?}} acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); {{/-first}} {{/produces}} {{^netStandard}} - request.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}};{{/netStandard}}{{#netStandard}} - request.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}");{{/netStandard}}{{! early standard versions do not have HttpMethod.Patch }} + httpRequestMessageLocalVar.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}};{{/netStandard}}{{#netStandard}} + httpRequestMessageLocalVar.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}");{{/netStandard}}{{! early standard versions do not have HttpMethod.Patch }} - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "{{path}}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "{{path}}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> apiResponse = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>(responseMessage, responseContent); + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> apiResponseLocalVar = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}>(apiResponse.RawContent, _jsonSerializerOptions); - After{{operationId}}({{#lambda.joinWithComma}}apiResponse {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + apiResponseLocalVar.Content = JsonSerializer.Deserialize<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + After{{operationId}}({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); } {{#authMethods}} - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); {{/authMethods}} - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnError{{operationId}}({{#lambda.joinWithComma}}e "{{path}}" uriBuilder.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + OnError{{operationId}}({{#lambda.joinWithComma}}e "{{path}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); throw; } } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/modelGeneric.mustache index 04ec3e8581c..e638741779b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/modelGeneric.mustache @@ -22,21 +22,6 @@ [JsonConstructor] {{#readWriteVars}}{{#-first}}public{{/-first}}{{/readWriteVars}}{{^readWriteVars}}internal{{/readWriteVars}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{{dataType}}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { - {{#nonNullableVars}} - {{#-first}} - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - {{/-first}} - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - throw new ArgumentNullException(nameof({{name}})); - - {{#-last}} - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - {{/-last}} - {{/nonNullableVars}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; {{#composedSchemas.allOf}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; @@ -70,21 +55,6 @@ [JsonConstructor] {{#readWriteVars}}{{#-first}}public{{/-first}}{{/readWriteVars}}{{^readWriteVars}}internal{{/readWriteVars}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.allOf}}{{^isInherited}}{{{dataType}}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/isInherited}}{{/composedSchemas.allOf}}{{#composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { - {{#nonNullableVars}} - {{#-first}} -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - {{/-first}} - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null."); - - {{#-last}} -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - {{/-last}} - {{/nonNullableVars}} {{#composedSchemas.allOf}} {{^isInherited}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; @@ -121,6 +91,9 @@ {{#description}} /// {{.}} {{/description}} + {{#example}} + /// {{.}} + {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] @@ -134,6 +107,9 @@ /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{#deprecated}} [Obsolete] {{/deprecated}} @@ -145,6 +121,9 @@ /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{#deprecated}} [Obsolete] {{/deprecated}} @@ -157,6 +136,9 @@ /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{#deprecated}} [Obsolete] {{/deprecated}} @@ -172,6 +154,9 @@ /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] @@ -185,6 +170,9 @@ /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] @@ -322,6 +310,7 @@ {{/readOnlyVars}} {{#validatable}} {{^parentModel}} + {{>validatable}} {{/parentModel}} {{/validatable}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache index bbc95b2bd5d..021fcb79a38 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache @@ -79,7 +79,7 @@ namespace {{packageName}}.Client public async Task Deserialize(HttpResponseMessage response) { - var result = (T) await Deserialize(response, typeof(T)); + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); return result; } @@ -95,17 +95,17 @@ namespace {{packageName}}.Client if (type == typeof(byte[])) // return byte array { - return await response.Content.ReadAsByteArrayAsync(); + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); } else if (type == typeof(FileParameter)) { - return new FileParameter(await response.Content.ReadAsStreamAsync()); + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) if (type == typeof(Stream)) { - var bytes = await response.Content.ReadAsByteArrayAsync(); + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); if (headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) @@ -129,18 +129,18 @@ namespace {{packageName}}.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(await response.Content.ReadAsStringAsync(), null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { - return Convert.ChangeType(await response.Content.ReadAsStringAsync(), type); + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); } // at this point, it must be a model (json) try { - return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync(), type, _serializerSettings); + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); } catch (Exception e) { @@ -401,7 +401,7 @@ namespace {{packageName}}.Client private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { T result = (T) responseData; - string rawContent = await response.Content.ReadAsStringAsync(); + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) { @@ -514,10 +514,10 @@ namespace {{packageName}}.Client if (!response.IsSuccessStatusCode) { - return await ToApiResponse(response, default(T), req.RequestUri); + return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); } - object responseData = await deserializer.Deserialize(response); + object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) @@ -526,12 +526,12 @@ namespace {{packageName}}.Client } else if (typeof(T).Name == "Stream") // for binary response { - responseData = (T) (object) await response.Content.ReadAsStreamAsync(); + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); } InterceptResponse(req, response); - return await ToApiResponse(response, responseData, req.RequestUri); + return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); } catch (OperationCanceledException original) { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/ApiClient.mustache new file mode 100644 index 00000000000..908c829f53b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/ApiClient.mustache @@ -0,0 +1,639 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +using UnityEngine.Networking; +using UnityEngine; + +namespace {{packageName}}.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(UnityWebRequest request) + { + var result = (T) Deserialize(request, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The UnityWebRequest after it has a response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(UnityWebRequest request, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return request.downloadHandler.data; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + // NOTE: Ignoring Content-Disposition filename support, since not all platforms + // have a location on disk to write arbitrary data (tvOS, consoles). + return new MemoryStream(request.downloadHandler.data); + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(request.downloadHandler.text, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(request.downloadHandler.text, type); + } + + var contentType = request.GetResponseHeader("Content-Type"); + + if (!string.IsNullOrEmpty(contentType) && contentType.Contains("application/json")) + { + var text = request.downloadHandler?.text; + + // Generated APIs that don't expect a return value provide System.Object as the type + if (type == typeof(System.Object) && (string.IsNullOrEmpty(text) || text.Trim() == "null")) + { + return null; + } + + if (request.responseCode >= 200 && request.responseCode < 300) + { + try + { + // Deserialize as a model + return JsonConvert.DeserializeObject(text, type, _serializerSettings); + } + catch (Exception e) + { + throw new UnexpectedResponseException(request, type, e.ToString()); + } + } + else + { + throw new ApiException((int)request.responseCode, request.error, text); + } + } + + if (type != typeof(System.Object) && request.responseCode >= 200 && request.responseCode < 300) + { + throw new UnexpectedResponseException(request, type); + } + + return null; + + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() : + this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + } + + /// + /// Provides all logic for constructing a new UnityWebRequest. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the UnityWebRequest. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new UnityWebRequest instance. + /// + private UnityWebRequest NewRequest( + string method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + var uri = builder.GetFullUri(); + UnityWebRequest request = null; + + if (contentType == "multipart/form-data") + { + var formData = new List(); + foreach (var formParameter in options.FormParameters) + { + formData.Add(new MultipartFormDataSection(formParameter.Key, formParameter.Value)); + } + + request = UnityWebRequest.Post(uri, formData); + request.method = method; + } + else if (contentType == "application/x-www-form-urlencoded") + { + var form = new WWWForm(); + foreach (var kvp in options.FormParameters) + { + form.AddField(kvp.Key, kvp.Value); + } + + request = UnityWebRequest.Post(uri, form); + request.method = method; + } + else if (options.Data != null) + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + var jsonData = serializer.Serialize(options.Data); + + // Making a post body application/json encoded is whack with UnityWebRequest. + // See: https://stackoverflow.com/questions/68156230/unitywebrequest-post-not-sending-body + request = UnityWebRequest.Put(uri, jsonData); + request.method = method; + request.SetRequestHeader("Content-Type", "application/json"); + } + else + { + request = new UnityWebRequest(builder.GetFullUri(), method); + } + + if (request.downloadHandler == null && typeof(T) != typeof(System.Object)) + { + request.downloadHandler = new DownloadHandlerBuffer(); + } + +#if UNITY_EDITOR || !UNITY_WEBGL + if (configuration.UserAgent != null) + { + request.SetRequestHeader("User-Agent", configuration.UserAgent); + } +#endif + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.SetRequestHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.SetRequestHeader(headerParam.Key, value); + } + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + #if UNITY_WEBGL + throw new System.InvalidOperationException("UnityWebRequest does not support setting cookies in WebGL"); + #else + if (options.Cookies.Count != 1) + { + UnityEngine.Debug.LogError("Only one cookie supported, ignoring others"); + } + + request.SetRequestHeader("Cookie", options.Cookies[0].ToString()); + #endif + } + + return request; + + } + + partial void InterceptRequest(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration); + partial void InterceptResponse(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration, ref object responseData); + + private ApiResponse ToApiResponse(UnityWebRequest request, object responseData) + { + T result = (T) responseData; + + var transformed = new ApiResponse((HttpStatusCode)request.responseCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, request.downloadHandler?.text ?? "") + { + ErrorText = request.error, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + var responseHeaders = request.GetResponseHeaders(); + if (responseHeaders != null) + { + foreach (var responseHeader in request.GetResponseHeaders()) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + return transformed; + } + + private async Task> ExecAsync( + UnityWebRequest request, + string path, + RequestOptions options, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + + using (request) + { + if (configuration.Timeout > 0) + { + request.timeout = (int)Math.Ceiling(configuration.Timeout / 1000.0f); + } + + if (configuration.Proxy != null) + { + throw new InvalidOperationException("Configuration `Proxy` not supported by UnityWebRequest"); + } + + if (configuration.ClientCertificates != null) + { + // Only Android/iOS/tvOS/Standalone players can support certificates, and this + // implementation is intended to work on all platforms. + // + // TODO: Could optionally allow support for this on these platforms. + // + // See: https://docs.unity3d.com/ScriptReference/Networking.CertificateHandler.html + throw new InvalidOperationException("Configuration `ClientCertificates` not supported by UnityWebRequest on all platforms"); + } + + InterceptRequest(request, path, options, configuration); + + var asyncOp = request.SendWebRequest(); + + TaskCompletionSource tsc = new TaskCompletionSource(); + asyncOp.completed += (_) => tsc.TrySetResult(request.result); + + using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) + { + await tsc.Task; + } + + if (request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.DataProcessingError) + { + throw new ConnectionException(request); + } + + object responseData = deserializer.Deserialize(request); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { new ByteArrayContent(request.downloadHandler.data) }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) new MemoryStream(request.downloadHandler.data); + } + + InterceptResponse(request, path, options, configuration, ref responseData); + + return ToApiResponse(request, responseData); + } + } + + {{#supportsAsync}} + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("GET", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("POST", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PUT", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("DELETE", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("HEAD", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("OPTIONS", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PATCH", path, options, config), path, options, config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + #endregion ISynchronousClient + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/ConnectionException.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/ConnectionException.mustache new file mode 100644 index 00000000000..108ea3bf567 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/ConnectionException.mustache @@ -0,0 +1,21 @@ +{{>partial_header}} + +using System; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ + public class ConnectionException : Exception + { + public UnityWebRequest.Result Result { get; private set; } + public string Error { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public ConnectionException(UnityWebRequest request) + : base($"result={request.result} error={request.error}") + { + Result = request.result; + Error = request.error ?? ""; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/README.mustache new file mode 100644 index 00000000000..a36233a78d2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/README.mustache @@ -0,0 +1,178 @@ +# {{packageName}} - the C# library for the {{appName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + + +## Version support +This generator should support all current LTS versions of Unity +- Unity 2020.3 (LTS) and up +- .NET Standard 2.1 / .NET Framework + + +## Dependencies + +- [Newtonsoft.Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html) - 3.0.2 or later +- [Unity Test Framework](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/index.html) - 1.1.33 or later + + +## Installation +Add the dependencies to `Packages/manifest.json` +``` +{ + "dependencies": { + ... + "com.unity.nuget.newtonsoft-json": "3.0.2", + "com.unity.test-framework": "1.1.33", + } +} +``` + +Then use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` + + +## Getting Started + +```csharp +using System; +using System.Collections.Generic; +using UnityEngine; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}Example +{ +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + public class {{operationId}}Example : MonoBehaviour + { + async void Start() + { + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + var apiInstance = new {{classname}}(config); + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}await apiInstance.{{{operationId}}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.Log(result);{{/returnType}} + Debug.Log("Done!"); + } + catch (ApiException e) + { + Debug.LogError("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.LogError("Status Code: "+ e.ErrorCode); + Debug.LogError(e.StackTrace); + } +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + } +} +``` + + +## 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}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} + + +## 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}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/RequestOptions.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/RequestOptions.mustache new file mode 100644 index 00000000000..0dd18c4ed60 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/RequestOptions.mustache @@ -0,0 +1,60 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/UnexpectedResponseException.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/UnexpectedResponseException.mustache new file mode 100644 index 00000000000..a976b2a76be --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/UnexpectedResponseException.mustache @@ -0,0 +1,26 @@ +{{>partial_header}} + +using System; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ + // Thrown when a backend doesn't return an expected response based on the expected type + // of the response data. + public class UnexpectedResponseException : Exception + { + public int ErrorCode { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public UnexpectedResponseException(UnityWebRequest request, System.Type type, string extra = "") + : base(CreateMessage(request, type, extra)) + { + ErrorCode = (int)request.responseCode; + } + + private static string CreateMessage(UnityWebRequest request, System.Type type, string extra) + { + return $"httpcode={request.responseCode}, expected {type.Name} but got data: {extra}"; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/api.mustache new file mode 100644 index 00000000000..6b0a5883d30 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/api.mustache @@ -0,0 +1,690 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{.}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + /// + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); + {{#returnType}} +#if UNITY_EDITOR || !UNITY_WEBGL + {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task.ConfigureAwait(false); +#else + {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task; +#endif + return localVarResponse.Data; + {{/returnType}} + {{^returnType}} +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + {{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + + var task = this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/api_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/api_test.mustache new file mode 100644 index 00000000000..0f7f49f7f63 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/api_test.mustache @@ -0,0 +1,74 @@ +{{>partial_header}} +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +{{#hasImport}} +// uncomment below to import models +//using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Test.Api +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class {{classname}}Tests : IDisposable + { + {{^nonPublicApi}} + private {{classname}} instance; + + {{/nonPublicApi}} + public {{classname}}Tests() + { + {{^nonPublicApi}} + instance = new {{classname}}(); + {{/nonPublicApi}} + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{operationId}}InstanceTest() + { + // TODO uncomment below to test 'IsType' {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + {{#operations}} + {{#operation}} + + /// + /// Test {{operationId}} + /// + [Test] + public void {{operationId}}Test() + { + // TODO uncomment below to test the method and replace null with proper value + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + //Assert.IsType<{{{.}}}>(response); + {{/returnType}} + } + {{/operation}} + {{/operations}} + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/asmdef.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/asmdef.mustache new file mode 100644 index 00000000000..a30cba8cc0b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/asmdef.mustache @@ -0,0 +1,7 @@ +{ + "name": "{{packageName}}", + "overrideReferences": true, + "precompiledReferences": [ + "Newtonsoft.Json.dll" + ] +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/asmdef_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/asmdef_test.mustache new file mode 100644 index 00000000000..c5e2d5852ca --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/asmdef_test.mustache @@ -0,0 +1,15 @@ +{ + "name": "{{testPackageName}}", + "references": [ + "{{packageName}}", + "UnityEngine.TestRunner" + ], + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll", + "Newtonsoft.Json.dll" + ], + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ] +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/model.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/model.mustache new file mode 100644 index 00000000000..3c1c6c0e252 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/model.mustache @@ -0,0 +1,47 @@ +{{>partial_header}} + +{{#models}} +{{#model}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{#vendorExtensions.x-com-visible}} +using System.Runtime.InteropServices; +{{/vendorExtensions.x-com-visible}} +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#anyOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/anyOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/model_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/model_test.mustache new file mode 100644 index 00000000000..404623281e2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/unityWebRequest/model_test.mustache @@ -0,0 +1,64 @@ +{{>partial_header}} + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.{{clientPackage}}; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +{{#models}} +{{#model}} +namespace {{packageName}}.Test.Model +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class {{classname}}Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for {{classname}} + //private {{classname}} instance; + + public {{classname}}Tests() + { + // TODO uncomment below to create an instance of {{classname}} + //instance = new {{classname}}(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{classname}}InstanceTest() + { + // TODO uncomment below to test "IsType" {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + + {{#vars}} + /// + /// Test the property '{{name}}' + /// + [Test] + public void {{name}}Test() + { + // TODO unit test for the property '{{name}}' + } + {{/vars}} + } +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache index 24beeae74c2..178e4fe0bf9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache @@ -76,7 +76,7 @@ {{#allowableValues}} {{#enumVars}} if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) - return {{^isNumeric}}"{{/isNumeric}}{{value}}{{^isNumeric}}"{{/isNumeric}}; + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache index 3b61b31644d..4ad255aef4c 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache @@ -8,12 +8,14 @@ [ComVisible({{{vendorExtensions.x-com-visible}}})] {{/vendorExtensions.x-com-visible}} [DataContract(Name = "{{{name}}}")] + {{^useUnityWebRequest}} {{#discriminator}} [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] {{#mappedModels}} [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} {{/discriminator}} + {{/useUnityWebRequest}} {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} { {{#vars}} @@ -37,6 +39,9 @@ {{#description}} /// {{.}} {{/description}} + {{#example}} + /// {{.}} + {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} @@ -129,7 +134,7 @@ {{#hasOnlyReadOnly}} [JsonConstructorAttribute] {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} { {{#vars}} {{^isInherited}} @@ -173,7 +178,7 @@ {{^conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}; + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{#isString}}@{{/isString}}{{{defaultValue}}}; {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; @@ -208,6 +213,9 @@ /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache index fdcd4f4a4cb..11e44dc3766 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache @@ -66,7 +66,7 @@ {{#allowableValues}} {{#enumVars}} if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) - return {{^isNumeric}}"{{/isNumeric}}{{value}}{{^isNumeric}}"{{/isNumeric}}; + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache index a7756c16045..3497bf5344a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache @@ -65,6 +65,7 @@ } } } + {{^skipOneOfAnyOfGetter}} {{#composedSchemas.oneOf}} {{^isNull}} @@ -79,6 +80,7 @@ } {{/isNull}} {{/composedSchemas.oneOf}} + {{/skipOneOfAnyOfGetter}} /// /// Returns the string presentation of the object diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/model_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/model_test.mustache index 347c2c35a25..65767faa34b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/model_test.mustache @@ -6,7 +6,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using {{packageName}}.{{apiPackage}}; using {{packageName}}.{{modelPackage}}; using {{packageName}}.{{clientPackage}}; using System.Reflection; 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 dbe742dac5f..8e825801e17 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 @@ -28,11 +28,11 @@ {{/useCompareNetObjects}} {{^useGenericHost}} - - + + {{/useGenericHost}} {{#useRestSharp}} - + {{/useRestSharp}} {{#useGenericHost}} 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 078005bc236..137af22c732 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 @@ -10,8 +10,8 @@ - - + + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache index 508d6e02e18..f86248be0e0 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache @@ -30,14 +30,14 @@ - + {{#useRestSharp}} - + {{/useRestSharp}} {{#useCompareNetObjects}} {{/useCompareNetObjects}} - + {{#validatable}} {{/validatable}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/openapi.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/openapi.mustache new file mode 100644 index 00000000000..34fbb53f331 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/validatable.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/validatable.mustache index 19b22fe6610..7ec9e987055 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/validatable.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/validatable.mustache @@ -4,7 +4,7 @@ /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -23,7 +23,7 @@ /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { {{/discriminator}} {{#parent}} @@ -74,7 +74,7 @@ {{#pattern}} {{^isByteArray}} // {{{name}}} ({{{dataType}}}) pattern - Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); + Regex regex{{{name}}} = new Regex("{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); if (false == regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); diff --git a/modules/openapi-generator/src/main/resources/erlang-client/api.mustache b/modules/openapi-generator/src/main/resources/erlang-client/api.mustache index 65cac6a8677..292cff3fb52 100644 --- a/modules/openapi-generator/src/main/resources/erlang-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-client/api.mustache @@ -21,14 +21,14 @@ Cfg = maps:get(cfg, Optional, application:get_env({{packageName}}_api, config, #{})), Method = {{httpMethod}}, - Path = [<<"{{{replacedPathName}}}">>], + Path = [?BASE_URL, "{{{replacedPathName}}}"], QS = {{#queryParams.isEmpty}}[]{{/queryParams.isEmpty}}{{^queryParams.isEmpty}}lists:flatten([{{#joinWithComma}}{{#queryParams}}{{#required}}{{#qsEncode}}{{this}}{{/qsEncode}} {{/required}}{{/queryParams}}{{/joinWithComma}}])++{{packageName}}_utils:optional_params([{{#joinWithComma}}{{#queryParams}}{{^required}} '{{baseName}}'{{/required}}{{/queryParams}}{{/joinWithComma}}], _OptionalParams){{/queryParams.isEmpty}}, Headers = {{#headerParams.isEmpty}}[]{{/headerParams.isEmpty}}{{^headerParams.isEmpty}}[{{#headerParams}}{{#required}} {<<"{{baseName}}">>, {{paramName}}}{{/required}}{{/headerParams}}]++{{packageName}}_utils:optional_params([{{#joinWithComma}}{{#headerParams}}{{^required}} '{{baseName}}'{{/required}}{{/headerParams}}{{/joinWithComma}}], _OptionalParams){{/headerParams.isEmpty}}, Body1 = {{^formParams.isEmpty}}{form, [{{#joinWithComma}}{{#formParams}}{{#required}} {<<"{{baseName}}">>, {{paramName}}}{{/required}}{{/formParams}}{{/joinWithComma}}]++{{packageName}}_utils:optional_params([{{#joinWithComma}}{{#formParams}}{{^required}} '{{baseName}}'{{/required}}{{/formParams}}{{/joinWithComma}}], _OptionalParams)}{{/formParams.isEmpty}}{{#formParams.isEmpty}}{{#bodyParams.isEmpty}}[]{{/bodyParams.isEmpty}}{{^bodyParams.isEmpty}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/bodyParams.isEmpty}}{{/formParams.isEmpty}}, ContentTypeHeader = {{packageName}}_utils:select_header_content_type([{{#consumes}}{{^-first}}, {{/-first}}<<"{{mediaType}}">>{{/consumes}}]), Opts = maps:get(hackney_opts, Optional, []), - {{packageName}}_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + {{packageName}}_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/erlang-client/utils.mustache b/modules/openapi-generator/src/main/resources/erlang-client/utils.mustache index 6336a321e67..ed3d3e109b1 100644 --- a/modules/openapi-generator/src/main/resources/erlang-client/utils.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-client/utils.mustache @@ -11,7 +11,8 @@ request(_Ctx, Method, Path, QS, Headers, Body, Opts, Cfg) -> {Headers1, QS1} = update_params_with_auth(Cfg, Headers, QS), Host = maps:get(host, Cfg, "localhost:8001"), - Url = hackney_url:make_url(Host, Path, QS1), + Path1 = prepare_path(Path), + Url = hackney_url:make_url(Host, Path1, QS1), ConfigHackneyOpts = maps:get(hackney_opts, Cfg, []), Body1 = case lists:keyfind(<<"Content-Type">>, 1, Headers1) of @@ -38,6 +39,14 @@ request(_Ctx, Method, Path, QS, Headers, Body, Opts, Cfg) -> headers => RespHeaders}} end. +prepare_path(Path) -> + lists:map(fun convert/1, Path). + +convert(PathPart) when is_integer(PathPart) -> + integer_to_binary(PathPart); +convert(PathPart) when is_list(PathPart) or is_binary(PathPart) -> + PathPart. + decode_response(Headers, Body) -> case lists:keyfind(<<"Content-Type">>, 1, Headers) of {_, <<"application/json", _/binary>>} -> diff --git a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache index 765ab782ed9..043410b1324 100644 --- a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache @@ -92,6 +92,27 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re {{/hasQueryParams}} {{#allParams}} {{#isPathParam}} + {{#isNumber}} + {{paramName}}Param, err := parseFloat32Parameter({{#routers}}{{#mux}}params["{{baseName}}"]{{/mux}}{{#chi}}chi.URLParam(r, "{{baseName}}"){{/chi}}{{/routers}}, {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/isNumber}} + {{#isFloat}} + {{paramName}}Param, err := parseFloat32Parameter({{#routers}}{{#mux}}params["{{baseName}}"]{{/mux}}{{#chi}}chi.URLParam(r, "{{baseName}}"){{/chi}}{{/routers}}, {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/isFloat}} + {{#isDouble}} + {{paramName}}Param, err := parseFloat64Parameter({{#routers}}{{#mux}}params["{{baseName}}"]{{/mux}}{{#chi}}chi.URLParam(r, "{{baseName}}"){{/chi}}{{/routers}}, {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/isDouble}} {{#isLong}} {{paramName}}Param, err := parseInt64Parameter({{#routers}}{{#mux}}params["{{baseName}}"]{{/mux}}{{#chi}}chi.URLParam(r, "{{baseName}}"){{/chi}}{{/routers}}, {{required}}) if err != nil { @@ -106,12 +127,40 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re return } {{/isInteger}} + {{^isNumber}} + {{^isFloat}} + {{^isDouble}} {{^isLong}} {{^isInteger}} {{paramName}}Param := {{#routers}}{{#mux}}params["{{baseName}}"]{{/mux}}{{#chi}}chi.URLParam(r, "{{baseName}}"){{/chi}}{{/routers}} - {{/isInteger}}{{/isLong}} + {{/isInteger}} + {{/isLong}} + {{/isDouble}} + {{/isFloat}} + {{/isNumber}} {{/isPathParam}} {{#isQueryParam}} + {{#isNumber}} + {{paramName}}Param, err := parseFloat32Parameter(query.Get("{{baseName}}"), {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/isNumber}} + {{#isFloat}} + {{paramName}}Param, err := parseFloat32Parameter(query.Get("{{baseName}}"), {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/isFloat}} + {{#isDouble}} + {{paramName}}Param, err := parseFloat64Parameter(query.Get("{{baseName}}"), {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/isDouble}} {{#isLong}} {{paramName}}Param, err := parseInt64Parameter(query.Get("{{baseName}}"), {{required}}) if err != nil { @@ -134,6 +183,27 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re } {{/isBoolean}} {{#isArray}} + {{#items.isNumber}} + {{paramName}}Param, err := parseFloat32ArrayParameter(query.Get("{{baseName}}"), {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/items.isNumber}} + {{#items.isFloat}} + {{paramName}}Param, err := parseFloat32ArrayParameter(query.Get("{{baseName}}"), {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/items.isFloat}} + {{#items.isDouble}} + {{paramName}}Param, err := parseFloat64ArrayParameter(query.Get("{{baseName}}"), {{required}}) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + {{/items.isDouble}} {{#items.isLong}} {{paramName}}Param, err := parseInt64ArrayParameter(query.Get("{{baseName}}"), ",", {{required}}) if err != nil { @@ -148,12 +218,21 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re return } {{/items.isInteger}} + {{^items.isNumber}} + {{^items.isFloat}} + {{^items.isDouble}} {{^items.isLong}} {{^items.isInteger}} {{paramName}}Param := strings.Split(query.Get("{{baseName}}"), ",") {{/items.isInteger}} {{/items.isLong}} + {{/items.isDouble}} + {{/items.isFloat}} + {{/items.isNumber}} {{/isArray}} + {{^isNumber}} + {{^isFloat}} + {{^isDouble}} {{^isLong}} {{^isInteger}} {{^isBoolean}} @@ -163,6 +242,9 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re {{/isBoolean}} {{/isInteger}} {{/isLong}} + {{/isDouble}} + {{/isFloat}} + {{/isNumber}} {{/isQueryParam}} {{#isFormParam}} {{#isFile}}{{#isArray}} diff --git a/modules/openapi-generator/src/main/resources/go-server/routers.mustache b/modules/openapi-generator/src/main/resources/go-server/routers.mustache index 1da7d805895..a15e821667e 100644 --- a/modules/openapi-generator/src/main/resources/go-server/routers.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/routers.mustache @@ -168,8 +168,8 @@ func readFileHeaderToTempFile(fileHeader *multipart.FileHeader) (*os.File, error return file, nil } -// parseInt64Parameter parses a string parameter to an int64. -func parseInt64Parameter(param string, required bool) (int64, error) { +// parseFloatParameter parses a string parameter to an int64. +func parseFloatParameter(param string, bitSize int, required bool) (float64, error) { if param == "" { if required { return 0, errors.New(errMsgRequiredMissing) @@ -178,25 +178,42 @@ func parseInt64Parameter(param string, required bool) (int64, error) { return 0, nil } - return strconv.ParseInt(param, 10, 64) + return strconv.ParseFloat(param, bitSize) +} + +// parseFloat64Parameter parses a string parameter to an float64. +func parseFloat64Parameter(param string, required bool) (float64, error) { + return parseFloatParameter(param, 64, required) +} + +// parseFloat32Parameter parses a string parameter to an float32. +func parseFloat32Parameter(param string, required bool) (float32, error) { + val, err := parseFloatParameter(param, 32, required) + return float32(val), err +} + +// parseIntParameter parses a string parameter to an int64. +func parseIntParameter(param string, bitSize int, required bool) (int64, error) { + if param == "" { + if required { + return 0, errors.New(errMsgRequiredMissing) + } + + return 0, nil + } + + return strconv.ParseInt(param, 10, bitSize) +} + +// parseInt64Parameter parses a string parameter to an int64. +func parseInt64Parameter(param string, required bool) (int64, error) { + return parseIntParameter(param, 64, required) } // parseInt32Parameter parses a string parameter to an int32. func parseInt32Parameter(param string, required bool) (int32, error) { - if param == "" { - if required { - return 0, errors.New(errMsgRequiredMissing) - } - - return 0, nil - } - - val, err := strconv.ParseInt(param, 10, 32) - if err != nil { - return -1, err - } - - return int32(val), nil + val, err := parseIntParameter(param, 32, required) + return int32(val), err } // parseBoolParameter parses a string parameter to a bool @@ -217,6 +234,55 @@ func parseBoolParameter(param string, required bool) (bool, error) { return bool(val), nil } +// parseFloat64ArrayParameter parses a string parameter containing array of values to []Float64. +func parseFloat64ArrayParameter(param, delim string, required bool) ([]float64, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + floats := make([]float64, len(str)) + + for i, s := range str { + if v, err := strconv.ParseFloat(s, 64); err != nil { + return nil, err + } else { + floats[i] = v + } + } + + return floats, nil +} + +// parseFloat32ArrayParameter parses a string parameter containing array of values to []float32. +func parseFloat32ArrayParameter(param, delim string, required bool) ([]float32, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + floats := make([]float32, len(str)) + + for i, s := range str { + if v, err := strconv.ParseFloat(s, 32); err != nil { + return nil, err + } else { + floats[i] = float32(v) + } + } + + return floats, nil +} + + // parseInt64ArrayParameter parses a string parameter containing array of values to []int64. func parseInt64ArrayParameter(param, delim string, required bool) ([]int64, error) { if param == "" { diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index eeb1197939d..80fc15bfc2c 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -725,16 +725,17 @@ func formatErrorMessage(status string, v interface{}) string { str := "" metaValue := reflect.ValueOf(v).Elem() - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } } - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - - // status title (detail) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache index 842fe1f3f0d..fa531874e73 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache @@ -45,7 +45,9 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; {{{.}}} {{/additionalClientTypeAnnotations}} {{>common/generatedAnnotation}} -@Client("${{openbrace}}{{{applicationName}}}-base-path{{closebrace}}") +@Client({{#configureClientId}} + id = "{{clientId}}", + path = {{/configureClientId}}"${{openbrace}}{{{applicationName}}}{{basePathSeparator}}base-path{{closebrace}}") public interface {{classname}} { {{#operations}} {{#operation}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache index 4c9c72d8779..a52b4294c6f 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache @@ -37,7 +37,7 @@ import {{javaxPackage}}.annotation.Generated; {{>common/generatedAnnotation}} -@Filter(Filter.MATCH_ALL_PATTERN) +@Filter({{#configureAuthFilterPattern}}"{{authorizationFilterPattern}}"{{/configureAuthFilterPattern}}{{^configureAuthFilterPattern}}Filter.MATCH_ALL_PATTERN{{/configureAuthFilterPattern}}) public class AuthorizationFilter implements HttpClientFilter { private static final Logger LOG = LoggerFactory.getLogger(ClientCredentialsHttpClientFilter.class); diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache index 56fecfe14da..7bd9ab2c8eb 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache @@ -123,7 +123,7 @@ Declare the class with extends and implements public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -135,7 +135,7 @@ Declare the class with extends and implements {{^vendorExtensions.x-is-jackson-optional-nullable}} {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } {{/required}} this.{{name}}.add({{name}}Item); @@ -148,7 +148,7 @@ Declare the class with extends and implements public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -160,7 +160,7 @@ Declare the class with extends and implements {{^vendorExtensions.x-is-jackson-optional-nullable}} {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } {{/required}} this.{{name}}.put(key, {{name}}Item); @@ -404,4 +404,4 @@ Declare the class with extends and implements {{/interfaces.0}} {{/parent}} {{/visitable}} -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache index 6609c81a3ce..19ef6761a7a 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache @@ -44,11 +44,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#isArray}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; } @@ -56,11 +54,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#isMap}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } 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 51eda6573dc..8b9cf94f26f 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 @@ -54,10 +54,12 @@ apply plugin: 'kotlinx-serialization' apply plugin: 'idea' {{/idea}} apply plugin: 'maven-publish' +{{^useSettingsGradle}} repositories { maven { url "https://repo1.maven.org/maven2" } } +{{/useSettingsGradle}} test { useJUnitPlatform() diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 3c1a0b156fd..ea711753abd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -357,7 +357,7 @@ import com.squareup.moshi.adapter val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -392,7 +392,7 @@ import com.squareup.moshi.adapter val response = client.newCall(request).execute() {{/useCoroutines}} - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache index 3369278f313..78dd8f8743c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache @@ -30,8 +30,15 @@ import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.* import {{javaxPackage}}.validation.Valid +import {{javaxPackage}}.validation.constraints.DecimalMax +import {{javaxPackage}}.validation.constraints.DecimalMin +import {{javaxPackage}}.validation.constraints.Email +import {{javaxPackage}}.validation.constraints.Max +import {{javaxPackage}}.validation.constraints.Min +import {{javaxPackage}}.validation.constraints.NotNull +import {{javaxPackage}}.validation.constraints.Pattern +import {{javaxPackage}}.validation.constraints.Size {{/useBeanValidation}} {{#reactive}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index 558ef8b5fea..3617cb42371 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -35,7 +35,14 @@ import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.* +import {{javaxPackage}}.validation.constraints.DecimalMax +import {{javaxPackage}}.validation.constraints.DecimalMin +import {{javaxPackage}}.validation.constraints.Email +import {{javaxPackage}}.validation.constraints.Max +import {{javaxPackage}}.validation.constraints.Min +import {{javaxPackage}}.validation.constraints.NotNull +import {{javaxPackage}}.validation.constraints.Pattern +import {{javaxPackage}}.validation.constraints.Size import {{javaxPackage}}.validation.Valid {{/useBeanValidation}} @@ -89,14 +96,14 @@ interface {{classname}} { produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, consumes = [{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}]{{/hasConsumes}}{{/singleContentTypes}} ) - {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}> { + {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}): ResponseEntity<{{>returnTypes}}>{{^skipDefaultInterface}} { {{^isDelegate}} return {{>returnValue}} {{/isDelegate}} {{#isDelegate}} return getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{/isDelegate}} - } + }{{/skipDefaultInterface}} {{/operation}} } {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 400e0657600..3bcff990a7a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,4 +1,4 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{.}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{{.}}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} - @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInCamelCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}?{{/isReadOnly}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{#isReadOnly}}{{^defaultValue}} = null{{/defaultValue}}{{/isReadOnly}} \ No newline at end of file + @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInCamelCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#defaultValue}} = {{{.}}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache index f2707f7eecc..f6005b5340f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache @@ -4,7 +4,14 @@ import java.util.Objects {{#imports}}import {{import}} {{/imports}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.* +import {{javaxPackage}}.validation.constraints.DecimalMax +import {{javaxPackage}}.validation.constraints.DecimalMin +import {{javaxPackage}}.validation.constraints.Email +import {{javaxPackage}}.validation.constraints.Max +import {{javaxPackage}}.validation.constraints.Min +import {{javaxPackage}}.validation.constraints.NotNull +import {{javaxPackage}}.validation.constraints.Pattern +import {{javaxPackage}}.validation.constraints.Size import {{javaxPackage}}.validation.Valid {{/useBeanValidation}} {{#swagger2AnnotationLibrary}} 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 299b64cd764..3cda7622c71 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 @@ -30,7 +30,7 @@ $asserts[] = new Assert\Date(); {{/isDate}} {{#isDateTime}} - $asserts[] = new Assert\DateTime(); + $asserts[] = new Assert\Type("DateTime"); {{/isDateTime}} {{^isDate}} {{^isDateTime}} diff --git a/modules/openapi-generator/src/main/resources/php-symfony/serialization/JmsSerializer.mustache b/modules/openapi-generator/src/main/resources/php-symfony/serialization/JmsSerializer.mustache index 0cd5d36ca5c..444eef6760e 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/serialization/JmsSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/serialization/JmsSerializer.mustache @@ -95,7 +95,7 @@ class JmsSerializer implements SerializerInterface break; case 'DateTime': case '\DateTime': - return new DateTime($data); + return is_null($data) ? null :new DateTime($data); default: throw new RuntimeException(sprintf("Type %s is unsupported", $type)); } diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache index ae4af162a14..201df14f1b4 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache @@ -48,6 +48,10 @@ Then import the package: import {{{packageName}}} ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/__init__api.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/__init__api.mustache index c2232a92f4c..8870835c81e 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/__init__api.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/__init__api.mustache @@ -1,7 +1,5 @@ -from __future__ import absolute_import - # flake8: noqa # import apis into api package {{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} -{{/apis}}{{/apiInfo}} \ No newline at end of file +{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/__init__model.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/__init__model.mustache index 56487fff6a4..0e1b55e2ace 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/__init__model.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/__init__model.mustache @@ -3,11 +3,9 @@ # flake8: noqa {{>partial_header}} -from __future__ import absolute_import - # import models into model package {{#models}} {{#model}} from {{modelPackage}}.{{classFilename}} import {{classname}} {{/model}} -{{/models}} \ No newline at end of file +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/__init__package.mustache index f12543f1f63..f598fc38c28 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/__init__package.mustache @@ -4,8 +4,6 @@ {{>partial_header}} -from __future__ import absolute_import - __version__ = "{{packageVersion}}" # import apis into sdk package diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api.mustache index 592b8f687a4..f16945da847 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/api.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/api.mustache @@ -2,8 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api_client.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api_client.mustache index 624c5ccb09c..e394ad0a733 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/api_client.mustache @@ -1,6 +1,6 @@ # coding: utf-8 + {{>partial_header}} -from __future__ import absolute_import import atexit import datetime @@ -31,10 +31,6 @@ class ApiClient(object): 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 @@ -60,7 +56,7 @@ class ApiClient(object): def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): - # use default configuraiton if none is provided + # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration @@ -245,7 +241,9 @@ class ApiClient(object): response_type = response_types_map.get(str(response_data.status), None) - if response_type not in ["file", "bytes"]: + if response_type == "bytearray": + response_data.data = response_data.data + else: match = None content_type = response_data.getheader('content-type') if content_type is not None: @@ -254,8 +252,9 @@ class ApiClient(object): response_data.data = response_data.data.decode(encoding) # deserialize response data - - if response_type: + if response_type == "bytearray": + return_data = response_data.data + elif response_type: return_data = self.deserialize(response_data, response_type) else: return_data = None diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api_test.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api_test.mustache index a981c662a0d..c3bbe4b822f 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/api_test.mustache @@ -2,8 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import - import unittest import {{packageName}} diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/configuration.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/configuration.mustache index b6fab6d7219..77b44197b2f 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/configuration.mustache @@ -2,8 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import - import copy import logging {{^asyncio}} @@ -15,7 +13,6 @@ import urllib3 import http.client as httplib from {{packageName}}.exceptions import ApiValueError - JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', @@ -23,10 +20,7 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { } class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. + """This class contains various settings of the API client. :param host: Base url. :param api_key: Dict to store API key(s). diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/github-workflow.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/github-workflow.mustache index 2698fdd76e5..d7e9a2017de 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/github-workflow.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/github-workflow.mustache @@ -16,12 +16,12 @@ jobs: matrix: python-version: ["3.7", "3.8", "3.9", "3.10"] - steps:s + steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }}s + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip @@ -35,4 +35,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest \ No newline at end of file + pytest diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache index 8c926f284ce..f4687163d26 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_anyof.mustache @@ -15,11 +15,10 @@ from pydantic import StrictStr, Field {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}] class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} + """ + {{#composedSchemas.anyOf}} # data type: {{{dataType}}} {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}} diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_enum.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_enum.mustache index e5b96967451..0e892dcc5bb 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_enum.mustache @@ -8,21 +8,19 @@ from aenum import Enum, no_arg class {{classname}}({{vendorExtensions.x-py-enum-type}}, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} """ """ allowed enum values """ - {{#allowableValues}} {{#enumVars}} {{{name}}} = {{{value}}} {{/enumVars}} {{#defaultValue}} + # @classmethod def _missing_value_(cls, value): diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache index 6c2b3432cfd..71661abb123 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_generic.mustache @@ -17,10 +17,8 @@ import {{{modelPackage}}} {{/vendorExtensions.x-py-model-imports}} class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} """ {{#vars}} {{name}}: {{{vendorExtensions.x-py-typing}}} @@ -35,7 +33,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} @validator('{{{name}}}') def {{{name}}}_validate_regular_expression(cls, v): if not re.match(r"{{{.}}}", v{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}): - raise ValueError(r"must validate the regular expression {{{pattern}}}") + raise ValueError(r"must validate the regular expression {{{vendorExtensions.x-pattern}}}") return v {{/vendorExtensions.x-regex}} {{#isEnum}} @@ -45,10 +43,16 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{^required}} if v is None: return v - {{/required}} + {{#isArray}} + for i in v: + if i not in ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}): + raise ValueError("each list item must be one of ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isArray}} + {{^isArray}} if v not in ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}): - raise ValueError("must validate the enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + raise ValueError("must be one of enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isArray}} return v {{/isEnum}} {{/vars}} @@ -158,7 +162,8 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{#allVars}} {{#isNullable}} # set to None if {{{name}}} (nullable) is None - if self.{{name}} is None: + # and __fields_set__ contains the field + if self.{{name}} is None and "{{{name}}}" in self.__fields_set__: _dict['{{{baseName}}}'] = None {{/isNullable}} @@ -216,7 +221,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{#isMap}} {{^items.isPrimitiveType}} {{^items.isEnumOrRef}} - "{{{name}}}": dict((_k, {{{dataType}}}.from_dict(_v)) for _k, _v in obj.get("{{{baseName}}}").items()){{^-last}},{{/-last}} + "{{{name}}}": dict((_k, {{{items.dataType}}}.from_dict(_v)) for _k, _v in obj.get("{{{baseName}}}").items()) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} {{/items.isEnumOrRef}} {{#items.isEnumOrRef}} "{{{name}}}": dict((_k, _v) for _k, _v in obj.get("{{{baseName}}}").items()){{^-last}},{{/-last}} @@ -255,4 +260,4 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{/isAdditionalPropertiesTrue}} return _obj - {{/hasChildren}} \ No newline at end of file + {{/hasChildren}} diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache index 7e1b110e2b0..b65f784d1cc 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_oneof.mustache @@ -15,10 +15,8 @@ from pydantic import StrictStr, Field {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}] class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} """ {{#composedSchemas.oneOf}} # data type: {{{dataType}}} diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/model_test.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/model_test.mustache index 06d8b5fa95c..93ebf99b14f 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/model_test.mustache @@ -2,8 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import - import unittest import datetime diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/partial_header.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/partial_header.mustache index dc3c8f3d8c8..d952d423503 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/partial_header.mustache @@ -1,17 +1,19 @@ """ {{#appName}} {{{.}}} -{{/appName}} +{{/appName}} {{#appDescription}} {{{.}}} # noqa: E501 -{{/appDescription}} +{{/appDescription}} {{#version}} The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} Contact: {{{.}}} {{/infoEmail}} - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache new file mode 100644 index 00000000000..1ab024d87f2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache @@ -0,0 +1,37 @@ +[tool.poetry] +name = "{{{packageName}}}" +version = "{{{packageVersion}}}" +description = "{{{appName}}}" +authors = ["{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}>"] +license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}" +readme = "README.md" +repository = "https://github.com/{{{gitRepoId}}}/{{{gitUserId}}}" +keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +{{#asyncio}} +aiohttp = ">= 3.8.4" +{{/asyncio}} +{{#tornado}} +tornado = ">=4.2,<5" +{{/tornado}} +{{#hasHttpSignatureMethods}} +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +{{/hasHttpSignatureMethods}} +pydantic = "^1.10.5" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/requirements.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/requirements.mustache index b64659a0a91..e18a97e55fd 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/requirements.mustache @@ -1,7 +1,7 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.25.3 -pydantic >= 1.10.2 +pydantic >= 1.10.5, < 2 aenum >= 3.1.11 {{#asyncio}} aiohttp >= 3.0.0 diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/rest.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/rest.mustache index 0e76f4eb996..89875d65542 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/rest.mustache @@ -2,8 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import - import io import json import logging diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/setup.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/setup.mustache index 77760324f82..902163a1e1d 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/setup.mustache @@ -29,7 +29,7 @@ REQUIRES = [ "pem>=19.3.0", "pycryptodome>=3.9.0", {{/hasHttpSignatureMethods}} - "pydantic", + "pydantic >= 1.10.5, < 2", "aenum" ] diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/signing.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/signing.mustache index 24889edbd6d..8dca7e2d1ff 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/signing.mustache @@ -64,11 +64,6 @@ class HttpSigningConfiguration(object): and optionally the body of the HTTP request, then signing the hash value using a private key. The 'Authorization' header is added to outbound HTTP requests. - NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param key_id: A string value specifying the identifier of the cryptographic key, when signing HTTP requests. :param signing_scheme: A string value specifying the signature scheme, when diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_test.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_test.mustache index 2ab6515a9b9..7079f97e770 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_test.mustache @@ -38,7 +38,7 @@ require 'json' {{/required}}{{/allParams}} # @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}] describe '{{operationId}} test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/modules/openapi-generator/src/main/resources/ruby-client/model_test.mustache b/modules/openapi-generator/src/main/resources/ruby-client/model_test.mustache index 86e5438d61a..99148c770a1 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/model_test.mustache @@ -24,14 +24,14 @@ describe {{moduleName}}::{{classname}} do describe 'test attribute "{{{name}}}"' do it 'should work' do {{#isEnum}} - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('{{{dataType}}}', [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]) # validator.allowable_values.each do |value| # expect { instance.{{name}} = value }.not_to raise_error # end {{/isEnum}} {{^isEnum}} - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ {{/isEnum}} end end diff --git a/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache index 277f6f26ab4..629de6611bf 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache @@ -1,4 +1,4 @@ -public enum {{classname}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable, JSONEncodable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable, JSONEncodable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} { {{#oneOf}} case type{{.}}({{.}}) {{/oneOf}} 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 24edd4d6ade..000e1af3266 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -306,7 +306,11 @@ export class {{classname}} extends runtime.BaseAPI { return new runtime.JSONApiResponse(response); {{/isArray}} {{#returnSimpleType}} - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse<{{returnType}}>(response); + } else { + return new runtime.TextApiResponse(response) as any; + } {{/returnSimpleType}} {{/returnTypeIsPrimitive}} {{^returnTypeIsPrimitive}} 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 fb105057e34..58f8adabaea 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -80,6 +80,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -102,6 +103,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/modules/openapi-generator/src/main/resources/typescript/model/model.mustache b/modules/openapi-generator/src/main/resources/typescript/model/model.mustache index 4f09ee74ebb..798297cba06 100644 --- a/modules/openapi-generator/src/main/resources/typescript/model/model.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/model/model.mustache @@ -19,7 +19,7 @@ export class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{ * {{{.}}} */ {{/description}} - '{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}; + '{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}; {{/vars}} {{#discriminator}} 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 9308bb14df3..e78b5af3076 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 @@ -17,9 +17,13 @@ package org.openapitools.codegen; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; import com.google.common.collect.Sets; import com.samskivert.mustache.Mustache.Lambda; - import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; @@ -33,18 +37,14 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.parser.core.models.ParseOptions; - import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.templating.mustache.CamelCaseLambda; -import org.openapitools.codegen.templating.mustache.IndentedLambda; -import org.openapitools.codegen.templating.mustache.LowercaseLambda; -import org.openapitools.codegen.templating.mustache.TitlecaseLambda; -import org.openapitools.codegen.templating.mustache.UppercaseLambda; +import org.openapitools.codegen.templating.mustache.*; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.SemVer; +import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.annotations.Ignore; import org.testng.annotations.Test; @@ -54,10 +54,13 @@ import java.nio.file.Files; import java.util.*; import java.util.stream.Collectors; +import static junit.framework.Assert.assertEquals; import static org.testng.Assert.*; public class DefaultCodegenTest { + private static final Logger testLogger = (Logger) LoggerFactory.getLogger(ModelUtils.class); + @Test public void testDeeplyNestedAdditionalPropertiesImports() { final DefaultCodegen codegen = new DefaultCodegen(); @@ -667,7 +670,6 @@ public class DefaultCodegenTest { Assert.assertTrue(colorSeen); } - @Test public void testEscapeText() { final DefaultCodegen codegen = new DefaultCodegen(); @@ -1099,7 +1101,6 @@ public class DefaultCodegenTest { cm = codegen.fromModel(modelName, sc); hs.clear(); hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); - hs.add(new CodegenDiscriminator.MappedModel("B", codegen.toModelName("B"))); hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C"))); Assert.assertEquals(cm.getHasDiscriminatorWithNonEmptyMapping(), true); Assert.assertEquals(cm.discriminator.getMappedModels(), hs); @@ -1583,15 +1584,12 @@ public class DefaultCodegenTest { discriminator.setPropertyBaseName(prop); discriminator.setMapping(null); discriminator.setMappedModels(new HashSet() {{ - add(new CodegenDiscriminator.MappedModel("DailySubObj", "DailySubObj")); - add(new CodegenDiscriminator.MappedModel("SubObj", "SubObj")); add(new CodegenDiscriminator.MappedModel("daily", "DailySubObj")); add(new CodegenDiscriminator.MappedModel("sub-obj", "SubObj")); }}); assertEquals(cm.discriminator, discriminator); } - @Test public void testAllOfSingleRefNoOwnProps() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml"); @@ -1605,14 +1603,6 @@ public class DefaultCodegenTest { Assert.assertNull(model.allParents); } - class CodegenWithMultipleInheritance extends DefaultCodegen { - public CodegenWithMultipleInheritance() { - super(); - supportsInheritance = true; - supportsMultipleInheritance = true; - } - } - @Test public void testAllOfParent() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf-required-parent.yaml"); @@ -1991,8 +1981,6 @@ public class DefaultCodegenTest { test.getMapping().put("c", "Child"); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("a", "Adult")); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("c", "Child")); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Adult", "Adult")); - test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Child", "Child")); Assert.assertEquals(discriminator, test); } @@ -2238,83 +2226,6 @@ public class DefaultCodegenTest { assertEquals(codegen.toApiName(""), "DefaultApi"); } - public static class FromParameter { - private CodegenParameter codegenParameter(String path) { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/fromParameter.yaml"); - new InlineModelResolver().flatten(openAPI); - final DefaultCodegen codegen = new DefaultCodegen(); - codegen.setOpenAPI(openAPI); - - return codegen - .fromParameter( - openAPI - .getPaths() - .get(path) - .getGet() - .getParameters() - .get(0), - new HashSet<>() - ); - } - - @Test - public void setStyle() { - CodegenParameter parameter = codegenParameter("/set_style"); - assertEquals(parameter.style, "form"); - } - - @Test - public void setShouldExplode() { - CodegenParameter parameter = codegenParameter("/set_should_explode"); - assertTrue(parameter.isExplode); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_Boolean_true() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, true); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertTrue(result); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_Boolean_false() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, false); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_String_true() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "true"); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertTrue(result); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_String_false() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "false"); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); - } - - @Test - public void testConvertPropertyToBooleanAndWriteBack_String_blibb() { - final DefaultCodegen codegen = new DefaultCodegen(); - Map additionalProperties = codegen.additionalProperties(); - additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "blibb"); - boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); - } - } - @Test public void testCircularReferencesDetection() { // given @@ -2464,7 +2375,7 @@ public class DefaultCodegenTest { "post", path.getPost(), path.getServers()); - assertEquals(operation.formParams.size(), 3, + Assert.assertEquals(operation.formParams.size(), 3, "The list of parameters should include inherited type"); final List names = operation.formParams.stream() @@ -2473,6 +2384,10 @@ public class DefaultCodegenTest { assertTrue(names.contains("password")); assertTrue(names.contains("passwordConfirmation")); assertTrue(names.contains("oldPassword")); + + Optional passwordParameter = operation.formParams.stream().filter(p -> "password".equals(p.paramName)).findFirst(); + assertTrue(passwordParameter.isPresent()); + assertTrue(passwordParameter.get().isPassword); } @Test @@ -3746,7 +3661,7 @@ public class DefaultCodegenTest { modelName = "ObjectWithComposedProperties"; CodegenModel m = codegen.fromModel(modelName, openAPI.getComponents().getSchemas().get(modelName)); /* TODO inline allOf schema are created as separate models and the following assumptions that - the properties are non-model are no longer valid and need to be revised + the properties are non-model are no longer valid and need to be revised assertTrue(m.vars.get(0).getIsMap()); assertTrue(m.vars.get(1).getIsNumber()); assertTrue(m.vars.get(2).getIsUnboundedInteger()); @@ -4238,6 +4153,356 @@ public class DefaultCodegenTest { Assert.assertEquals(codegenParameter.getSchema(), null); } + @Test + public void testArraySchemaWithIneffectiveConstraints() { + + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + + // add the appender to the logger + testLogger.addAppender(listAppender); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue6491.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "ArrayWithIneffectiveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel cm = codegen.fromModel(modelName, sc); + + + List logsList = listAppender.list; + + // JUnit assertions + assertEquals(16, logsList.size()); + assertEquals("Validation 'minProperties' has no effect on schema 'array'. Ignoring!", logsList.get(0) + .getMessage()); + assertEquals("Validation 'maxProperties' has no effect on schema 'array'. Ignoring!", logsList.get(1) + .getMessage()); + assertEquals("Validation 'minLength' has no effect on schema 'array'. Ignoring!", logsList.get(2) + .getMessage()); + assertEquals("Validation 'maxLength' has no effect on schema 'array'. Ignoring!", logsList.get(3) + .getMessage()); + assertEquals("Validation 'pattern' has no effect on schema 'array'. Ignoring!", logsList.get(4) + .getMessage()); + assertEquals("Validation 'multipleOf' has no effect on schema 'array'. Ignoring!", logsList.get(5) + .getMessage()); + assertEquals("Validation 'minimum' has no effect on schema 'array'. Ignoring!", logsList.get(6) + .getMessage()); + assertEquals("Validation 'maximum' has no effect on schema 'array'. Ignoring!", logsList.get(7) + .getMessage()); + + // Assert all logged messages are WARN messages + logsList.stream().limit(8).forEach(log -> assertEquals(Level.WARN, log.getLevel())); + } + + @Test + public void testObjectSchemaWithIneffectiveConstraints() { + + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + + // add the appender to the logger + testLogger.addAppender(listAppender); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue6491.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "ObjectWithIneffectiveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel cm = codegen.fromModel(modelName, sc); + + List logsList = listAppender.list; + + // JUnit assertions + assertEquals(9, logsList.size()); + assertEquals("Validation 'minItems' has no effect on schema 'object'. Ignoring!", logsList.get(0) + .getMessage()); + assertEquals("Validation 'maxItems' has no effect on schema 'object'. Ignoring!", logsList.get(1) + .getMessage()); + assertEquals("Validation 'uniqueItems' has no effect on schema 'object'. Ignoring!", logsList.get(2) + .getMessage()); + assertEquals("Validation 'minLength' has no effect on schema 'object'. Ignoring!", logsList.get(3) + .getMessage()); + assertEquals("Validation 'maxLength' has no effect on schema 'object'. Ignoring!", logsList.get(4) + .getMessage()); + assertEquals("Validation 'pattern' has no effect on schema 'object'. Ignoring!", logsList.get(5) + .getMessage()); + assertEquals("Validation 'multipleOf' has no effect on schema 'object'. Ignoring!", logsList.get(6) + .getMessage()); + assertEquals("Validation 'minimum' has no effect on schema 'object'. Ignoring!", logsList.get(7) + .getMessage()); + assertEquals("Validation 'maximum' has no effect on schema 'object'. Ignoring!", logsList.get(8) + .getMessage()); + + // Assert all logged messages are WARN messages + logsList.stream().forEach(log -> assertEquals(Level.WARN, log.getLevel())); + } + + @Test + public void testStringSchemaWithIneffectiveConstraints() { + + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + + // add the appender to the logger + testLogger.addAppender(listAppender); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue6491.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "StringWithIneffectiveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel cm = codegen.fromModel(modelName, sc); + + List logsList = listAppender.list; + + // JUnit assertions + assertEquals(8, logsList.size()); + assertEquals("Validation 'minItems' has no effect on schema 'string'. Ignoring!", logsList.get(0) + .getMessage()); + assertEquals("Validation 'maxItems' has no effect on schema 'string'. Ignoring!", logsList.get(1) + .getMessage()); + assertEquals("Validation 'uniqueItems' has no effect on schema 'string'. Ignoring!", logsList.get(2) + .getMessage()); + assertEquals("Validation 'minProperties' has no effect on schema 'string'. Ignoring!", logsList.get(3) + .getMessage()); + assertEquals("Validation 'maxProperties' has no effect on schema 'string'. Ignoring!", logsList.get(4) + .getMessage()); + assertEquals("Validation 'multipleOf' has no effect on schema 'string'. Ignoring!", logsList.get(5) + .getMessage()); + assertEquals("Validation 'minimum' has no effect on schema 'string'. Ignoring!", logsList.get(6) + .getMessage()); + assertEquals("Validation 'maximum' has no effect on schema 'string'. Ignoring!", logsList.get(7) + .getMessage()); + + // Assert all logged messages are WARN messages + logsList.stream().forEach(log -> assertEquals(Level.WARN, log.getLevel())); + } + + @Test + public void testIntegerSchemaWithIneffectiveConstraints() { + + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + + // add the appender to the logger + testLogger.addAppender(listAppender); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue6491.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "IntegerWithIneffectiveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel cm = codegen.fromModel(modelName, sc); + + List logsList = listAppender.list; + + // JUnit assertions + assertEquals(8, logsList.size()); + assertEquals("Validation 'minItems' has no effect on schema 'integer'. Ignoring!", logsList.get(0) + .getMessage()); + assertEquals("Validation 'maxItems' has no effect on schema 'integer'. Ignoring!", logsList.get(1) + .getMessage()); + assertEquals("Validation 'uniqueItems' has no effect on schema 'integer'. Ignoring!", logsList.get(2) + .getMessage()); + assertEquals("Validation 'minProperties' has no effect on schema 'integer'. Ignoring!", logsList.get(3) + .getMessage()); + assertEquals("Validation 'maxProperties' has no effect on schema 'integer'. Ignoring!", logsList.get(4) + .getMessage()); + assertEquals("Validation 'minLength' has no effect on schema 'integer'. Ignoring!", logsList.get(5) + .getMessage()); + assertEquals("Validation 'maxLength' has no effect on schema 'integer'. Ignoring!", logsList.get(6) + .getMessage()); + assertEquals("Validation 'pattern' has no effect on schema 'integer'. Ignoring!", logsList.get(7) + .getMessage()); + + // Assert all logged messages are WARN messages + logsList.stream().forEach(log -> assertEquals(Level.WARN, log.getLevel())); + } + + @Test + public void testAnySchemaWithIneffectiveConstraints() { + + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + + // add the appender to the logger + testLogger.addAppender(listAppender); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue6491.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "AnyTypeWithIneffectiveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel cm = codegen.fromModel(modelName, sc); + + List logsList = listAppender.list; + + // JUnit assertions + assertEquals(0, logsList.size()); + } + + @Test + public void testBooleanSchemaWithIneffectiveConstraints() { + + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + + // add the appender to the logger + testLogger.addAppender(listAppender); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue6491.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "BooleanWithIneffectiveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel cm = codegen.fromModel(modelName, sc); + + List logsList = listAppender.list; + + // JUnit assertions + assertEquals(11, logsList.size()); + assertEquals("Validation 'minItems' has no effect on schema 'boolean'. Ignoring!", logsList.get(0) + .getMessage()); + assertEquals("Validation 'maxItems' has no effect on schema 'boolean'. Ignoring!", logsList.get(1) + .getMessage()); + assertEquals("Validation 'uniqueItems' has no effect on schema 'boolean'. Ignoring!", logsList.get(2) + .getMessage()); + assertEquals("Validation 'minProperties' has no effect on schema 'boolean'. Ignoring!", logsList.get(3) + .getMessage()); + assertEquals("Validation 'maxProperties' has no effect on schema 'boolean'. Ignoring!", logsList.get(4) + .getMessage()); + assertEquals("Validation 'minLength' has no effect on schema 'boolean'. Ignoring!", logsList.get(5) + .getMessage()); + assertEquals("Validation 'maxLength' has no effect on schema 'boolean'. Ignoring!", logsList.get(6) + .getMessage()); + assertEquals("Validation 'pattern' has no effect on schema 'boolean'. Ignoring!", logsList.get(7) + .getMessage()); + assertEquals("Validation 'multipleOf' has no effect on schema 'boolean'. Ignoring!", logsList.get(8) + .getMessage()); + assertEquals("Validation 'minimum' has no effect on schema 'boolean'. Ignoring!", logsList.get(9) + .getMessage()); + assertEquals("Validation 'maximum' has no effect on schema 'boolean'. Ignoring!", logsList.get(10) + .getMessage()); + + // Assert all logged messages are WARN messages + logsList.stream().forEach(log -> assertEquals(Level.WARN, log.getLevel())); + } + + @Test + public void testNullSchemaWithIneffectiveConstraints() { + + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + + // add the appender to the logger + testLogger.addAppender(listAppender); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue6491.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "NullWithIneffectiveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel cm = codegen.fromModel(modelName, sc); + + List logsList = listAppender.list; + + // JUnit assertions + assertEquals(0, logsList.size()); + } + + public static class FromParameter { + private CodegenParameter codegenParameter(String path) { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/fromParameter.yaml"); + new InlineModelResolver().flatten(openAPI); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + return codegen + .fromParameter( + openAPI + .getPaths() + .get(path) + .getGet() + .getParameters() + .get(0), + new HashSet<>() + ); + } + + @Test + public void setStyle() { + CodegenParameter parameter = codegenParameter("/set_style"); + assertEquals(parameter.style, "form"); + } + + @Test + public void setShouldExplode() { + CodegenParameter parameter = codegenParameter("/set_should_explode"); + assertTrue(parameter.isExplode); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_Boolean_true() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, true); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertTrue(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_Boolean_false() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, false); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_true() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "true"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertTrue(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_false() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "false"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } + + @Test + public void testConvertPropertyToBooleanAndWriteBack_String_blibb() { + final DefaultCodegen codegen = new DefaultCodegen(); + Map additionalProperties = codegen.additionalProperties(); + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "blibb"); + boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); + Assert.assertFalse(result); + } + } + + class CodegenWithMultipleInheritance extends DefaultCodegen { + public CodegenWithMultipleInheritance() { + super(); + supportsInheritance = true; + supportsMultipleInheritance = true; + } + } + @Test public void testFromPropertyRequiredAndOptional() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_12857.yaml"); @@ -4294,6 +4559,43 @@ public class DefaultCodegenTest { Assert.assertFalse(referencedEnumSchemaProperty.isPrimitiveType); } + @Test + public void testAllOfDefaultEnumType() { + // test allOf with a single sub-schema and default value set in the top level + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue-5676-enums.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + String modelName = "EnumPatternObject"; + + Schema schemaWithReferencedEnum = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel modelWithReferencedSchema = codegen.fromModel(modelName, schemaWithReferencedEnum); + CodegenProperty defaultEnumSchemaProperty = modelWithReferencedSchema.vars.get(4); + + Assert.assertNotNull(schemaWithReferencedEnum); + Assert.assertTrue(modelWithReferencedSchema.hasEnums); + Assert.assertEquals(defaultEnumSchemaProperty.getName(), "defaultMinusnumberMinusenum"); + Assert.assertFalse(defaultEnumSchemaProperty.isEnum); + Assert.assertTrue(defaultEnumSchemaProperty.getIsEnumOrRef()); + Assert.assertTrue(defaultEnumSchemaProperty.isEnumRef); + Assert.assertFalse(defaultEnumSchemaProperty.isInnerEnum); + Assert.assertFalse(defaultEnumSchemaProperty.isString); + Assert.assertFalse(defaultEnumSchemaProperty.isContainer); + Assert.assertFalse(defaultEnumSchemaProperty.isPrimitiveType); + Assert.assertEquals(defaultEnumSchemaProperty.defaultValue, "2"); + + // test allOf with a single sub-schema and no default value set in the top level + CodegenProperty allOfEnumSchemaProperty = modelWithReferencedSchema.vars.get(5); + Assert.assertEquals(allOfEnumSchemaProperty.getName(), "allofMinusnumberMinusenum"); + Assert.assertFalse(allOfEnumSchemaProperty.isEnum); + Assert.assertTrue(allOfEnumSchemaProperty.getIsEnumOrRef()); + Assert.assertTrue(allOfEnumSchemaProperty.isEnumRef); + Assert.assertFalse(allOfEnumSchemaProperty.isInnerEnum); + Assert.assertFalse(allOfEnumSchemaProperty.isString); + Assert.assertFalse(allOfEnumSchemaProperty.isContainer); + Assert.assertFalse(allOfEnumSchemaProperty.isPrimitiveType); + Assert.assertEquals(allOfEnumSchemaProperty.defaultValue, "null"); + } + @Test public void testInlineEnumType() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue-5676-enums.yaml"); @@ -4317,158 +4619,4 @@ public class DefaultCodegenTest { Assert.assertFalse(inlineEnumSchemaProperty.isPrimitiveType); } - @Test - public void testOpenAPINormalizerRefAsParentInAllOf() { - // to test the rule REF_AS_PARENT_IN_ALLOF - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/allOf_extension_parent.yaml"); - - Schema schema = openAPI.getComponents().getSchemas().get("AnotherPerson"); - assertNull(schema.getExtensions()); - - Schema schema2 = openAPI.getComponents().getSchemas().get("Person"); - assertEquals(schema2.getExtensions().get("x-parent"), "abstract"); - - Map options = new HashMap<>(); - options.put("REF_AS_PARENT_IN_ALLOF", "true"); - OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); - openAPINormalizer.normalize(); - - Schema schema3 = openAPI.getComponents().getSchemas().get("AnotherPerson"); - assertEquals(schema3.getExtensions().get("x-parent"), true); - - Schema schema4 = openAPI.getComponents().getSchemas().get("AnotherParent"); - assertEquals(schema4.getExtensions().get("x-parent"), true); - - Schema schema5 = openAPI.getComponents().getSchemas().get("Person"); - assertEquals(schema5.getExtensions().get("x-parent"), "abstract"); - } - - @Test - public void testOpenAPINormalizerEnableKeepOnlyFirstTagInOperation() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml"); - - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().size(), 2); - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().size(), 1); - - Map options = new HashMap<>(); - options.put("KEEP_ONLY_FIRST_TAG_IN_OPERATION", "true"); - OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); - openAPINormalizer.normalize(); - - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().size(), 1); - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().size(), 1); - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().get(0), "person"); - } - - @Test - public void testOpenAPINormalizerRemoveAnyOfOneOfAndKeepPropertiesOnly() { - // to test the rule REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIIES_ONLY - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/removeAnyOfOneOfAndKeepPropertiesOnly_test.yaml"); - - Schema schema = openAPI.getComponents().getSchemas().get("Person"); - assertEquals(schema.getAnyOf().size(), 2); - - Map options = new HashMap<>(); - options.put("REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY", "true"); - OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); - openAPINormalizer.normalize(); - - Schema schema3 = openAPI.getComponents().getSchemas().get("Person"); - assertNull(schema.getAnyOf()); - } - - @Test - public void testOpenAPINormalizerSimplifyOneOfAnyOfStringAndEnumString() { - // to test the rule SIMPLIFY_ONEOF_ANYOF_STRING_AND_ENUM_STRING - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyAnyOfStringAndEnumString_test.yaml"); - - Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest"); - assertEquals(schema.getAnyOf().size(), 2); - - Map options = new HashMap<>(); - options.put("SIMPLIFY_ANYOF_STRING_AND_ENUM_STRING", "true"); - OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); - openAPINormalizer.normalize(); - - Schema schema3 = openAPI.getComponents().getSchemas().get("AnyOfTest"); - assertNull(schema3.getAnyOf()); - assertTrue(schema3 instanceof StringSchema); - } - - @Test - public void testOpenAPINormalizerSimplifyOneOfAnyOf() { - // to test the rule SIMPLIFY_ONEOF_ANYOF - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml"); - - Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest"); - assertEquals(schema.getAnyOf().size(), 2); - assertNull(schema.getNullable()); - - Schema schema2 = openAPI.getComponents().getSchemas().get("OneOfTest"); - assertEquals(schema2.getOneOf().size(), 2); - assertNull(schema2.getNullable()); - - Schema schema5 = openAPI.getComponents().getSchemas().get("OneOfNullableTest"); - assertEquals(schema5.getOneOf().size(), 3); - assertNull(schema5.getNullable()); - - Map options = new HashMap<>(); - options.put("SIMPLIFY_ONEOF_ANYOF", "true"); - OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); - openAPINormalizer.normalize(); - - Schema schema3 = openAPI.getComponents().getSchemas().get("AnyOfTest"); - assertNull(schema3.getAnyOf()); - assertTrue(schema3 instanceof StringSchema); - assertTrue(schema3.getNullable()); - - Schema schema4 = openAPI.getComponents().getSchemas().get("OneOfTest"); - assertNull(schema4.getOneOf()); - assertTrue(schema4 instanceof IntegerSchema); - - Schema schema6 = openAPI.getComponents().getSchemas().get("OneOfNullableTest"); - assertEquals(schema6.getOneOf().size(), 2); - assertTrue(schema6.getNullable()); - } - - @Test - public void testOpenAPINormalizerSimplifyBooleanEnum() { - // to test the rule SIMPLIFY_BOOLEAN_ENUM - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyBooleanEnum_test.yaml"); - - Schema schema = openAPI.getComponents().getSchemas().get("BooleanEnumTest"); - assertEquals(schema.getProperties().size(), 3); - assertTrue(schema.getProperties().get("boolean_enum") instanceof BooleanSchema); - BooleanSchema bs = (BooleanSchema) schema.getProperties().get("boolean_enum"); - assertEquals(bs.getEnum().size(), 2); - - Map options = new HashMap<>(); - options.put("SIMPLIFY_BOOLEAN_ENUM", "true"); - OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); - openAPINormalizer.normalize(); - - Schema schema3 = openAPI.getComponents().getSchemas().get("BooleanEnumTest"); - assertEquals(schema.getProperties().size(), 3); - assertTrue(schema.getProperties().get("boolean_enum") instanceof BooleanSchema); - BooleanSchema bs2 = (BooleanSchema) schema.getProperties().get("boolean_enum"); - assertNull(bs2.getEnum()); //ensure the enum has been erased - } - - @Test - public void testOpenAPINormalizerSetTagsInAllOperations() { - OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml"); - - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().size(), 2); - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().size(), 1); - - Map options = new HashMap<>(); - options.put("SET_TAGS_FOR_ALL_OPERATIONS", "core"); - OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); - openAPINormalizer.normalize(); - - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().size(), 1); - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().size(), 1); - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().get(0), "core"); - assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().get(0), "core"); - } } 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 f21dcb2202e..c34cd38df42 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 @@ -1103,4 +1103,29 @@ public class InlineModelResolverTest { //RequestBody referencedRequestBody = ModelUtils.getReferencedRequestBody(openAPI, requestBodyReference); //assertTrue(referencedRequestBody.getRequired()); } + + @Test + public void testInlineSchemaAllOfPropertyOfOneOf() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/inline_model_allof_propertyof_oneof.yaml"); + InlineModelResolver resolver = new InlineModelResolver(); + resolver.flatten(openAPI); + + Schema schema = openAPI.getComponents().getSchemas().get("Order_allOf_inline_oneof"); + assertEquals(((Schema) schema.getOneOf().get(0)).get$ref(), "#/components/schemas/Tag"); + assertEquals(((Schema) schema.getOneOf().get(1)).get$ref(), "#/components/schemas/Filter"); + + Schema schema2 = openAPI.getComponents().getSchemas().get("Order_allOf_inline_model"); + assertTrue(schema2.getProperties().get("something") instanceof StringSchema); + } + + @Test + public void testNestedAnyOf() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/nested_anyof.yaml"); + InlineModelResolver resolver = new InlineModelResolver(); + resolver.flatten(openAPI); + + Schema schema = openAPI.getComponents().getSchemas().get("SomeData_anyOf"); + assertTrue((Schema) schema.getAnyOf().get(0) instanceof StringSchema); + assertTrue((Schema) schema.getAnyOf().get(1) instanceof IntegerSchema); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java new file mode 100644 index 00000000000..79535e0d241 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java @@ -0,0 +1,308 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen; + +import com.google.common.collect.Sets; +import com.samskivert.mustache.Mustache.Lambda; + +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +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.QueryParameter; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.responses.ApiResponses; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.parser.core.models.ParseOptions; + +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.config.GlobalSettings; +import org.openapitools.codegen.model.ModelMap; +import org.openapitools.codegen.model.ModelsMap; +import org.openapitools.codegen.templating.mustache.CamelCaseLambda; +import org.openapitools.codegen.templating.mustache.IndentedLambda; +import org.openapitools.codegen.templating.mustache.LowercaseLambda; +import org.openapitools.codegen.templating.mustache.TitlecaseLambda; +import org.openapitools.codegen.templating.mustache.UppercaseLambda; +import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.SemVer; +import org.testng.Assert; +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +import java.io.File; +import java.nio.file.Files; +import java.util.*; +import java.util.stream.Collectors; + +import static org.testng.Assert.*; + +public class OpenAPINormalizerTest { + @Test + public void testOpenAPINormalizerRefAsParentInAllOf() { + // to test the rule REF_AS_PARENT_IN_ALLOF + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/allOf_extension_parent.yaml"); + + Schema schema = openAPI.getComponents().getSchemas().get("AnotherPerson"); + assertNull(schema.getExtensions()); + + Schema schema2 = openAPI.getComponents().getSchemas().get("Person"); + assertEquals(schema2.getExtensions().get("x-parent"), "abstract"); + + Map options = new HashMap<>(); + options.put("REF_AS_PARENT_IN_ALLOF", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema schema3 = openAPI.getComponents().getSchemas().get("AnotherPerson"); + assertEquals(schema3.getExtensions().get("x-parent"), true); + + Schema schema4 = openAPI.getComponents().getSchemas().get("AnotherParent"); + assertEquals(schema4.getExtensions().get("x-parent"), true); + + Schema schema5 = openAPI.getComponents().getSchemas().get("Person"); + assertEquals(schema5.getExtensions().get("x-parent"), "abstract"); + } + + @Test + public void testOpenAPINormalizerEnableKeepOnlyFirstTagInOperation() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml"); + + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().size(), 2); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().size(), 1); + + Map options = new HashMap<>(); + options.put("KEEP_ONLY_FIRST_TAG_IN_OPERATION", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().size(), 1); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().size(), 1); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().get(0), "person"); + } + + @Test + public void testOpenAPINormalizerRemoveAnyOfOneOfAndKeepPropertiesOnly() { + // to test the rule REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIIES_ONLY + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/removeAnyOfOneOfAndKeepPropertiesOnly_test.yaml"); + + Schema schema = openAPI.getComponents().getSchemas().get("Person"); + assertEquals(schema.getAnyOf().size(), 2); + + Map options = new HashMap<>(); + options.put("REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema schema3 = openAPI.getComponents().getSchemas().get("Person"); + assertNull(schema.getAnyOf()); + } + + @Test + public void testOpenAPINormalizerSimplifyOneOfAnyOfStringAndEnumString() { + // to test the rule SIMPLIFY_ONEOF_ANYOF_STRING_AND_ENUM_STRING + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyAnyOfStringAndEnumString_test.yaml"); + + Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest"); + assertEquals(schema.getAnyOf().size(), 2); + + Map options = new HashMap<>(); + options.put("SIMPLIFY_ANYOF_STRING_AND_ENUM_STRING", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema schema3 = openAPI.getComponents().getSchemas().get("AnyOfTest"); + assertNull(schema3.getAnyOf()); + assertTrue(schema3 instanceof StringSchema); + assertTrue(schema3.getEnum().size() > 0); + } + + @Test + public void testOpenAPINormalizerSimplifyOneOfAnyOf() { + // to test the rule SIMPLIFY_ONEOF_ANYOF + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml"); + + Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest"); + assertEquals(schema.getAnyOf().size(), 2); + assertNull(schema.getNullable()); + + Schema schema2 = openAPI.getComponents().getSchemas().get("OneOfTest"); + assertEquals(schema2.getOneOf().size(), 2); + assertNull(schema2.getNullable()); + + Schema schema5 = openAPI.getComponents().getSchemas().get("OneOfNullableTest"); + assertEquals(schema5.getOneOf().size(), 3); + assertNull(schema5.getNullable()); + + Map options = new HashMap<>(); + options.put("SIMPLIFY_ONEOF_ANYOF", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema schema3 = openAPI.getComponents().getSchemas().get("AnyOfTest"); + assertNull(schema3.getAnyOf()); + assertTrue(schema3 instanceof StringSchema); + assertTrue(schema3.getNullable()); + + Schema schema4 = openAPI.getComponents().getSchemas().get("OneOfTest"); + assertNull(schema4.getOneOf()); + assertTrue(schema4 instanceof IntegerSchema); + + Schema schema6 = openAPI.getComponents().getSchemas().get("OneOfNullableTest"); + assertEquals(schema6.getOneOf().size(), 2); + assertTrue(schema6.getNullable()); + } + + @Test + public void testOpenAPINormalizerSimplifyBooleanEnum() { + // to test the rule SIMPLIFY_BOOLEAN_ENUM + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyBooleanEnum_test.yaml"); + + Schema schema = openAPI.getComponents().getSchemas().get("BooleanEnumTest"); + assertEquals(schema.getProperties().size(), 3); + assertTrue(schema.getProperties().get("boolean_enum") instanceof BooleanSchema); + BooleanSchema bs = (BooleanSchema) schema.getProperties().get("boolean_enum"); + assertEquals(bs.getEnum().size(), 2); + + Map options = new HashMap<>(); + options.put("SIMPLIFY_BOOLEAN_ENUM", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema schema3 = openAPI.getComponents().getSchemas().get("BooleanEnumTest"); + assertEquals(schema.getProperties().size(), 3); + assertTrue(schema.getProperties().get("boolean_enum") instanceof BooleanSchema); + BooleanSchema bs2 = (BooleanSchema) schema.getProperties().get("boolean_enum"); + assertNull(bs2.getEnum()); //ensure the enum has been erased + } + + @Test + public void testOpenAPINormalizerSimplifyBooleanEnumWithComposedSchema() { + // to test the rule SIMPLIFY_BOOLEAN_ENUM + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/simplifyBooleanEnum_test.yaml"); + + Schema schema = openAPI.getComponents().getSchemas().get("ComposedSchemaBooleanEnumTest"); + assertEquals(schema.getProperties().size(), 3); + assertTrue(schema.getProperties().get("boolean_enum") instanceof BooleanSchema); + BooleanSchema bs = (BooleanSchema) schema.getProperties().get("boolean_enum"); + assertEquals(bs.getEnum().size(), 2); + + Map options = new HashMap<>(); + options.put("SIMPLIFY_BOOLEAN_ENUM", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema schema3 = openAPI.getComponents().getSchemas().get("ComposedSchemaBooleanEnumTest"); + assertEquals(schema.getProperties().size(), 3); + assertTrue(schema.getProperties().get("boolean_enum") instanceof BooleanSchema); + BooleanSchema bs2 = (BooleanSchema) schema.getProperties().get("boolean_enum"); + assertNull(bs2.getEnum()); //ensure the enum has been erased + } + + @Test + public void testOpenAPINormalizerSetTagsInAllOperations() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/enableKeepOnlyFirstTagInOperation_test.yaml"); + + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().size(), 2); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().size(), 1); + + Map options = new HashMap<>(); + options.put("SET_TAGS_FOR_ALL_OPERATIONS", "core"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().size(), 1); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().size(), 1); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getGet().getTags().get(0), "core"); + assertEquals(openAPI.getPaths().get("/person/display/{personId}").getDelete().getTags().get(0), "core"); + } + + @Test + public void testAddUnsignedToIntegerWithInvalidMaxValue() { + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/addUnsignedToIntegerWithInvalidMaxValue_test.yaml"); + + Schema person = openAPI.getComponents().getSchemas().get("Person"); + assertNull(((Schema) person.getProperties().get("integer")).getExtensions()); + assertNull(((Schema) person.getProperties().get("int32")).getExtensions()); + assertNull(((Schema) person.getProperties().get("int64")).getExtensions()); + assertNull(((Schema) person.getProperties().get("integer_max")).getExtensions()); + assertNull(((Schema) person.getProperties().get("int32_max")).getExtensions()); + assertNull(((Schema) person.getProperties().get("int64_max")).getExtensions()); + + Map options = new HashMap<>(); + options.put("ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema person2 = openAPI.getComponents().getSchemas().get("Person"); + assertNull(((Schema) person2.getProperties().get("integer")).getExtensions()); + assertNull(((Schema) person2.getProperties().get("int32")).getExtensions()); + assertNull(((Schema) person2.getProperties().get("int64")).getExtensions()); + assertTrue((Boolean) ((Schema) person2.getProperties().get("integer_max")).getExtensions().get("x-unsigned")); + assertTrue((Boolean) ((Schema) person2.getProperties().get("int32_max")).getExtensions().get("x-unsigned")); + assertTrue((Boolean) ((Schema) person2.getProperties().get("int64_max")).getExtensions().get("x-unsigned")); + } + + @Test + public void testOpenAPINormalizerConvertEnumNullToNullable_test() { + // to test the rule SIMPLIFY_ONEOF_ANYOF, which now also covers CONVERT_ENUM_NULL_TO_NULLABLE (removed) + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/convertEnumNullToNullable_test.yaml"); + + Schema schema = openAPI.getComponents().getSchemas().get("AnyOfTest"); + assertEquals(schema.getAnyOf().size(), 3); + assertNull(schema.getNullable()); + + Map options = new HashMap<>(); + options.put("SIMPLIFY_ONEOF_ANYOF", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema schema3 = openAPI.getComponents().getSchemas().get("AnyOfTest"); + assertEquals(schema3.getAnyOf().size(), 2); + assertTrue(schema3.getNullable()); + } + + @Test + public void testOpenAPINormalizerRefactorAllOfWithPropertiesOnly() { + // to test the rule REFACTOR_ALLOF_WITH_PROPERTIES_ONLY + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/allOf_extension_parent.yaml"); + + ComposedSchema schema = (ComposedSchema) openAPI.getComponents().getSchemas().get("allOfWithProperties"); + assertEquals(schema.getAllOf().size(), 1); + assertEquals(schema.getProperties().size(), 2); + assertEquals(((Schema) schema.getProperties().get("isParent")).getType(), "boolean"); + assertEquals(((Schema) schema.getProperties().get("mum_or_dad")).getType(), "string"); + + Map options = new HashMap<>(); + options.put("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "true"); + OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); + openAPINormalizer.normalize(); + + Schema schema2 = openAPI.getComponents().getSchemas().get("allOfWithProperties"); + assertEquals(schema2.getAllOf().size(), 2); + assertNull(schema2.getProperties()); + + Schema newSchema = (Schema) (schema2.getAllOf().get(1)); + assertEquals(((Schema) newSchema.getProperties().get("isParent")).getType(), "boolean"); + assertEquals(((Schema) newSchema.getProperties().get("mum_or_dad")).getType(), "string"); + assertEquals(newSchema.getRequired().get(0), "isParent"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpNetCoreClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpNetCoreClientCodegenTest.java index 3a6ce1df371..2f865064b7f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpNetCoreClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpNetCoreClientCodegenTest.java @@ -16,7 +16,13 @@ package org.openapitools.codegen.csharpnetcore; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.CSharpNetCoreClientCodegen; +import org.openapitools.codegen.languages.JavaClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; @@ -37,4 +43,36 @@ public class CSharpNetCoreClientCodegenTest { // Assert.assertEquals(codegen.toEnumVarName("FOO-BAR", "string"), "FooBar"); // Assert.assertEquals(codegen.toEnumVarName("FOO_BAR", "string"), "FooBar"); } + + @Test + public void testUnsigned() { + // test unsigned integer/long + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/unsigned-test.yaml"); + CSharpNetCoreClientCodegen codegen = new CSharpNetCoreClientCodegen(); + + Schema test1 = openAPI.getComponents().getSchemas().get("format_test"); + codegen.setOpenAPI(openAPI); + CodegenModel cm1 = codegen.fromModel("format_test", test1); + Assert.assertEquals(cm1.getClassname(), "FormatTest"); + + final CodegenProperty property1 = cm1.allVars.get(2); + Assert.assertEquals(property1.baseName, "unsigned_integer"); + Assert.assertEquals(property1.dataType, "uint"); + Assert.assertEquals(property1.vendorExtensions.get("x-unsigned"), Boolean.TRUE); + Assert.assertTrue(property1.isPrimitiveType); + Assert.assertTrue(property1.isInteger); + Assert.assertFalse(property1.isContainer); + Assert.assertFalse(property1.isFreeFormObject); + Assert.assertFalse(property1.isAnyType); + + final CodegenProperty property2 = cm1.allVars.get(4); + Assert.assertEquals(property2.baseName, "unsigned_long"); + Assert.assertEquals(property2.dataType, "ulong"); + Assert.assertEquals(property2.vendorExtensions.get("x-unsigned"), Boolean.TRUE); + Assert.assertTrue(property2.isPrimitiveType); + Assert.assertTrue(property2.isLong); + Assert.assertFalse(property2.isContainer); + Assert.assertFalse(property2.isFreeFormObject); + Assert.assertFalse(property2.isAnyType); + } } 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 22c55a4dba1..56be46d46f6 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 @@ -601,11 +601,11 @@ public class AbstractJavaCodegenTest { ModelUtils.setGenerateAliasAsModel(false); defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), schema); - Assert.assertEquals(defaultValue, "new ArrayList<>()"); + Assert.assertEquals(defaultValue, null); ModelUtils.setGenerateAliasAsModel(true); defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), schema); - Assert.assertEquals(defaultValue, "new ArrayList<>()"); + Assert.assertEquals(defaultValue, null); // Create a map schema with additionalProperties type set to array alias schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray")); 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 847eb43b263..f6f599d9cc3 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 @@ -903,7 +903,7 @@ public class JavaClientCodegenTest { /** * See https://github.com/OpenAPITools/openapi-generator/issues/4803 - * + *

    * UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ * We will contact the contributor of the following test to see if the fix will break their use cases and * how we can fix it accordingly. @@ -951,7 +951,7 @@ public class JavaClientCodegenTest { /** * See https://github.com/OpenAPITools/openapi-generator/issues/4803 - * + *

    * UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ * We will contact the contributor of the following test to see if the fix will break their use cases and * how we can fix it accordingly. @@ -1007,23 +1007,23 @@ public class JavaClientCodegenTest { output.deleteOnExit(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.WEBCLIENT) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(configurator.toClientOptInput()).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("StoreApi.java")) - .assertMethod("getInventory").hasReturnType("Mono>") //explicit 'x-webclient-blocking: false' which overrides global config - .toFileAssert() - .assertMethod("placeOrder").hasReturnType("Order"); // use global config + .assertMethod("getInventory").hasReturnType("Mono>") //explicit 'x-webclient-blocking: false' which overrides global config + .toFileAssert() + .assertMethod("placeOrder").hasReturnType("Order"); // use global config JavaFileAssert.assertThat(files.get("PetApi.java")) - .assertMethod("findPetsByStatus").hasReturnType("List"); // explicit 'x-webclient-blocking: true' which overrides global config + .assertMethod("findPetsByStatus").hasReturnType("List"); // explicit 'x-webclient-blocking: true' which overrides global config } @Test @@ -1057,7 +1057,7 @@ public class JavaClientCodegenTest { /** * See https://github.com/OpenAPITools/openapi-generator/issues/6715 - * + *

    * UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ * We will contact the contributor of the following test to see if the fix will break their use cases and * how we can fix it accordingly. @@ -1151,7 +1151,7 @@ public class JavaClientCodegenTest { .orElseThrow(() -> new IllegalStateException(String.format(Locale.ROOT, "Operation with id [%s] does not exist", operationId))); } - private Optional getByCriteria(List codegenOperations, Predicate filter){ + private Optional getByCriteria(List codegenOperations, Predicate filter) { return codegenOperations.stream() .filter(filter) .findFirst(); @@ -1190,7 +1190,7 @@ public class JavaClientCodegenTest { /** * See https://github.com/OpenAPITools/openapi-generator/issues/6715 - * + *

    * UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ * We will contact the contributor of the following test to see if the fix will break their use cases and * how we can fix it accordingly. @@ -1554,24 +1554,24 @@ public class JavaClientCodegenTest { output.deleteOnExit(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.MICROPROFILE) - .setInputSpec("src/test/resources/bugs/issue_12622.json") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setAdditionalProperties(properties) + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.MICROPROFILE) + .setInputSpec("src/test/resources/bugs/issue_12622.json") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); final ClientOptInput clientOptInput = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(clientOptInput).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("Foo.java")) - .assertConstructor("String", "Integer") - .hasParameter("b") + .assertConstructor("String", "Integer") + .hasParameter("b") .assertParameterAnnotations() .containsWithNameAndAttributes("JsonbProperty", ImmutableMap.of("value", "\"b\"", "nillable", "true")) - .toParameter().toConstructor() - .hasParameter("c") + .toParameter().toConstructor() + .hasParameter("c") .assertParameterAnnotations() .containsWithNameAndAttributes("JsonbProperty", ImmutableMap.of("value", "\"c\"")); } @@ -1585,24 +1585,24 @@ public class JavaClientCodegenTest { output.deleteOnExit(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.WEBCLIENT) - .setInputSpec("src/test/resources/bugs/issue_12790.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setAdditionalProperties(properties) + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.WEBCLIENT) + .setInputSpec("src/test/resources/bugs/issue_12790.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); final ClientOptInput clientOptInput = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(clientOptInput).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .collect(Collectors.toMap(File::getName, Function.identity())); JavaFileAssert.assertThat(files.get("TestObject.java")) - .printFileContent() - .assertConstructor("String", "String") - .bodyContainsLines( - "this.nullableProperty = nullableProperty == null ? JsonNullable.undefined() : JsonNullable.of(nullableProperty);", - "this.notNullableProperty = notNullableProperty;" - ); + .printFileContent() + .assertConstructor("String", "String") + .bodyContainsLines( + "this.nullableProperty = nullableProperty == null ? JsonNullable.undefined() : JsonNullable.of(nullableProperty);", + "this.notNullableProperty = notNullableProperty;" + ); } @Test @@ -1631,9 +1631,9 @@ public class JavaClientCodegenTest { Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/ResourceApi.java"); TestUtils.assertFileContains(defaultApi, - "org.springframework.core.io.Resource resourceInResponse()", - "ResponseEntity resourceInResponseWithHttpInfo()", - "ParameterizedTypeReference localReturnType = new ParameterizedTypeReference()" + "org.springframework.core.io.Resource resourceInResponse()", + "ResponseEntity resourceInResponseWithHttpInfo()", + "ParameterizedTypeReference localReturnType = new ParameterizedTypeReference()" ); } @@ -1689,13 +1689,13 @@ public class JavaClientCodegenTest { JavaFileAssert.assertThat(files.get("DefaultApi.java")) .assertMethod("operationWithHttpInfo") - .hasParameter("requestBody") - .assertParameterAnnotations() - .containsWithName("NotNull") + .hasParameter("requestBody") + .assertParameterAnnotations() + .containsWithName("NotNull") .toParameter().toMethod() - .hasParameter("xNonNullHeaderParameter") - .assertParameterAnnotations() - .containsWithName("NotNull"); + .hasParameter("xNonNullHeaderParameter") + .assertParameterAnnotations() + .containsWithName("NotNull"); } @Test @@ -1707,18 +1707,18 @@ public class JavaClientCodegenTest { output.deleteOnExit(); final CodegenConfigurator configurator = new CodegenConfigurator() - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.NATIVE) - .setAdditionalProperties(properties) - .setInputSpec("src/test/resources/3_0/exploded-query-param-array.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.NATIVE) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/exploded-query-param-array.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); final ClientOptInput clientOptInput = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); generator.opts(clientOptInput).generate(); TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"), - "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"multi\", \"values\", queryObject.getValues()));" + "localVarQueryParams.addAll(ApiClient.parameterToPairs(\"multi\", \"values\", queryObject.getValues()));" ); } @@ -1746,7 +1746,7 @@ public class JavaClientCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 30); + Assert.assertEquals(files.size(), 33); validateJavaSourceFiles(files); TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/model/Child.java"), @@ -1763,7 +1763,7 @@ public class JavaClientCodegenTest { output.deleteOnExit(); String outputPath = output.getAbsolutePath().replace('\\', '/'); OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()).getOpenAPI(); + .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()).getOpenAPI(); JavaClientCodegen codegen = new JavaClientCodegen(); codegen.setOutputDir(output.getAbsolutePath()); @@ -1801,7 +1801,7 @@ public class JavaClientCodegenTest { output.deleteOnExit(); String outputPath = output.getAbsolutePath().replace('\\', '/'); OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()).getOpenAPI(); + .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()).getOpenAPI(); JavaClientCodegen codegen = new JavaClientCodegen(); codegen.setOutputDir(output.getAbsolutePath()); @@ -1834,4 +1834,152 @@ public class JavaClientCodegenTest { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/ChildWithoutMappingADTO.java"), "@JsonTypeName"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/ChildWithoutMappingBDTO.java"), "@JsonTypeName"); } + + @Test + public void testForJavaNativeJsonSubtype() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_14917.yaml", null, new ParseOptions()).getOpenAPI(); + + JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + codegen.setLibrary(JavaClientCodegen.NATIVE); + + generator.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "mappings.put(\"Cat\", Cat.class)"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "@JsonSubTypes"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "mappings.put(\"cat\", Cat.class);"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "mappings.put(\"dog\", Dog.class);"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "mappings.put(\"lizard\", Lizard.class);"); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "mappings.put(\"cat\", Cat.class)"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "mappings.put(\"dog\", Dog.class)"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "mappings.put(\"lizard\", Lizard.class)"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "mappings.put(\"Pet\", Pet.class)"); + + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Cat.class, name = \"Cat\")"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Dog.class, name = \"Dog\")"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Lizard.class, name = \"Lizard\")"); + } + + @Test + public void testForJavaApacheHttpClientJsonSubtype() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_14917.yaml", null, new ParseOptions()).getOpenAPI(); + + JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + codegen.setLibrary(JavaClientCodegen.APACHE); + + generator.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"petType\", visible = true)"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "mappings.put"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")"); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"petType\", visible = true)"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Cat.class, name = \"cat\")"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Dog.class, name = \"dog\")"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Lizard.class, name = \"lizard\")"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Cat.class, name = \"Cat\")"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Dog.class, name = \"Dog\")"); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), "@JsonSubTypes.Type(value = Lizard.class, name = \"Lizard\")"); + } + + @Test + public void testIsOverriddenProperty() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + JavaClientCodegen codegen = new JavaClientCodegen(); + + Schema test1 = openAPI.getComponents().getSchemas().get("Cat"); + codegen.setOpenAPI(openAPI); + CodegenModel cm1 = codegen.fromModel("Cat", test1); + + CodegenProperty cp0 = cm1.getAllVars().get(0); + Assert.assertEquals(cp0.getName(), "petType"); + Assert.assertEquals(cp0.isOverridden, true); + + CodegenProperty cp1 = cm1.getAllVars().get(1); + Assert.assertEquals(cp1.getName(), "name"); + Assert.assertEquals(cp1.isOverridden, false); + } + + @Test + public void testForJavaApacheHttpClientOverrideSetter() 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/allOf_composition_discriminator.yaml", null, new ParseOptions()).getOpenAPI(); + + JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + codegen.setLibrary(JavaClientCodegen.APACHE); + + generator.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), " @Override\n" + + " public Cat petType(String petType) {"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), " }\n" + + "\n" + + " public Pet petType(String petType) {\n"); + + } + + @Test + public void testForJavaNativeClientOverrideSetter() 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/allOf_composition_discriminator.yaml", null, new ParseOptions()).getOpenAPI(); + + JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + codegen.setLibrary(JavaClientCodegen.NATIVE); + + generator.opts(input).generate(); + + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Cat.java"), " @Override\n" + + " public Cat petType(String petType) {"); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/Pet.java"), " }\n" + + "\n" + + " public Pet petType(String petType) {\n"); + + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java index 1f3f48e8a61..2f02be67d22 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelEnumTest.java @@ -75,7 +75,7 @@ public class JavaModelEnumTest { Assert.assertEquals(enumVar.dataType, "List"); Assert.assertEquals(enumVar.datatypeWithEnum, "List"); Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()"); + Assert.assertEquals(enumVar.defaultValue, null); Assert.assertEquals(enumVar.baseType, "List"); Assert.assertTrue(enumVar.isEnum); @@ -108,7 +108,7 @@ public class JavaModelEnumTest { Assert.assertEquals(enumVar.dataType, "List>"); Assert.assertEquals(enumVar.datatypeWithEnum, "List>"); Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()"); + Assert.assertEquals(enumVar.defaultValue, null); Assert.assertEquals(enumVar.baseType, "List"); Assert.assertTrue(enumVar.isEnum); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java index 224d10975fd..221736e4ea5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java @@ -130,7 +130,7 @@ public class JavaModelTest { Assert.assertEquals(property.setter, "setUrls"); Assert.assertEquals(property.dataType, "List"); Assert.assertEquals(property.name, "urls"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); + Assert.assertEquals(property.defaultValue, null); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -162,7 +162,7 @@ public class JavaModelTest { Assert.assertEquals(property.setter, "setUrls"); Assert.assertEquals(property.dataType, "Set"); Assert.assertEquals(property.name, "urls"); - Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()"); + Assert.assertEquals(property.defaultValue, null); Assert.assertEquals(property.baseType, "Set"); Assert.assertEquals(property.containerType, "set"); Assert.assertFalse(property.required); @@ -248,7 +248,7 @@ public class JavaModelTest { Assert.assertEquals(property.setter, "setList2D"); Assert.assertEquals(property.dataType, "List>"); Assert.assertEquals(property.name, "list2D"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); + Assert.assertEquals(property.defaultValue, null); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -333,7 +333,7 @@ public class JavaModelTest { Assert.assertEquals(property.setter, "setChildren"); Assert.assertEquals(property.dataType, "List"); Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); + Assert.assertEquals(property.defaultValue, null); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -396,7 +396,7 @@ public class JavaModelTest { Assert.assertEquals(property.setter, "setChildren"); Assert.assertEquals(property.dataType, "List"); Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); + Assert.assertEquals(property.defaultValue, null); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -429,7 +429,7 @@ public class JavaModelTest { Assert.assertEquals(property.setter, "setChildren"); Assert.assertEquals(property.dataType, "Set"); Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()"); + Assert.assertEquals(property.defaultValue, null); Assert.assertEquals(property.baseType, "Set"); Assert.assertEquals(property.containerType, "set"); Assert.assertFalse(property.required); @@ -466,7 +466,7 @@ public class JavaModelTest { Assert.assertEquals(property.setter, "setChildren"); Assert.assertEquals(property.dataType, "List"); Assert.assertEquals(property.name, "children"); - Assert.assertEquals(property.defaultValue, "new ArrayList<>()"); + Assert.assertEquals(property.defaultValue, null); Assert.assertEquals(property.baseType, "List"); Assert.assertEquals(property.containerType, "array"); Assert.assertFalse(property.required); @@ -974,7 +974,7 @@ public class JavaModelTest { Assert.assertEquals(property2.setter, "setArray"); Assert.assertEquals(property2.dataType, "List"); Assert.assertEquals(property2.name, "array"); - Assert.assertEquals(property2.defaultValue, "new ArrayList<>()"); + Assert.assertEquals(property2.defaultValue, null); Assert.assertEquals(property2.baseType, "List"); Assert.assertTrue(property2.isContainer); Assert.assertTrue(property2.isXmlWrapped); @@ -1125,6 +1125,17 @@ public class JavaModelTest { Assert.assertEquals(cp.maxLength, Integer.valueOf(10)); Assert.assertEquals(cp.pattern, "^[A-Z]+$"); } + + @Test(description = "convert string property with password format") + public void stringPropertyPasswordFormatTest() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema property = new StringSchema().format("password"); + final DefaultCodegen codegen = new JavaClientCodegen(); + codegen.setOpenAPI(openAPI); + + final CodegenProperty cp = codegen.fromProperty("somePropertyWithPasswordFormat", property); + Assert.assertEquals(cp.isPassword, true); + } @Test(description = "convert string property in an object") public void stringPropertyInObjectTest() { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java index 05b53d5fa09..5a9e6412618 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/AbstractAnnotationAssert.java @@ -35,6 +35,13 @@ public abstract class AbstractAnnotationAssert annotation.getNameAsString().equals(name)); + return myself(); + } + public ACTUAL containsWithNameAndAttributes(final String name, final Map attributes) { super .withFailMessage("Should have annotation with name: " + name + " and attributes: " + attributes + ", but was: " + actual) 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 c9b9e27a4c7..d196bf25766 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 @@ -6,6 +6,7 @@ import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; +import org.assertj.core.condition.AllOf; import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.java.assertions.JavaFileAssert; @@ -754,4 +755,44 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { "@GZIP\n" ); } + + @Test + public void testHandleRequiredAndReadOnlyPropertiesCorrectly() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/required-and-readonly-property.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert.assertThat(files.get("ReadonlyAndRequiredProperties.java")) + .hasProperty("requiredYesReadonlyYes") + .toType() + .assertMethod("getRequiredYesReadonlyYes") + .assertMethodAnnotations() + .hasSize(2) + .containsWithNameAndAttributes("ApiModelProperty", ImmutableMap.of("required", "true")) + // Mysteriously, but we need to surround the value with quotes if the Annotation only contains a single value + .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "\"requiredYesReadonlyYes\"")) + .toMethod() + .toFileAssert() + .hasProperty("requiredYesReadonlyNo") + .toType() + .assertMethod("getRequiredYesReadonlyNo") + .assertMethodAnnotations() + .hasSize(3) + .containsWithNameAndAttributes("ApiModelProperty", ImmutableMap.of("required", "true")) + // Mysteriously, but we need to surround the value with quotes if the Annotation only contains a single value + .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "\"requiredYesReadonlyNo\"")) + .containsWithName("NotNull"); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java index af612bd47ca..2c449e9bfee 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java @@ -251,4 +251,63 @@ public class MicronautClientCodegenTest extends AbstractMicronautCodegenTest { assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "MyAdditionalAnnotation1(1,${param1})"); assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "MyAdditionalAnnotation2(2,${param2})"); } + + @Test + public void testDefaultAuthorizationFilterPattern() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + codegen.additionalProperties().put(JavaMicronautClientCodegen.OPT_CONFIGURE_AUTH, "true"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.SUPPORTING_FILES, CodegenConstants.APIS); + + // Micronaut AuthorizationFilter should default to match all patterns + assertFileContains(outputPath + "/src/main/java/org/openapitools/auth/AuthorizationFilter.java", "@Filter(Filter.MATCH_ALL_PATTERN)"); + } + + @Test + public void testAuthorizationFilterPattern() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + codegen.additionalProperties().put(JavaMicronautClientCodegen.OPT_CONFIGURE_AUTH, "true"); + codegen.additionalProperties().put(JavaMicronautClientCodegen.AUTHORIZATION_FILTER_PATTERN, "pet/**"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.SUPPORTING_FILES, CodegenConstants.APIS); + + // Micronaut AuthorizationFilter should match the provided pattern + assertFileContains(outputPath + "/src/main/java/org/openapitools/auth/AuthorizationFilter.java", "@Filter(\"pet/**\")"); + } + + @Test + public void testNoConfigureClientId() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.APIS); + + // Micronaut declarative http client should not specify a Client id + assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@Client(\"${openapi-micronaut-client-base-path}\")"); + } + + @Test + public void testConfigureClientId() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + codegen.additionalProperties().put(JavaMicronautClientCodegen.CLIENT_ID, "unit-test"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.APIS); + + // Micronaut declarative http client should use the provided Client id + assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@Client( id = \"unit-test\", path = \"${openapi-micronaut-client-base-path}\")"); + } + + @Test + public void testDefaultPathSeparator() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.APIS); + + // Micronaut declarative http client should use the default path separator + assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@Client(\"${openapi-micronaut-client-base-path}\")"); + } + + @Test + public void testConfigurePathSeparator() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + codegen.additionalProperties().put(JavaMicronautClientCodegen.BASE_PATH_SEPARATOR, "."); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.APIS); + + // Micronaut declarative http client should use the provided path separator + assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@Client(\"${openapi-micronaut-client.base-path}\")"); + } } 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 da09be67395..4700596f60b 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 @@ -17,16 +17,7 @@ package org.openapitools.codegen.java.spring; -import static java.util.stream.Collectors.groupingBy; -import static org.assertj.core.api.Assertions.assertThat; -import static org.openapitools.codegen.TestUtils.assertFileContains; -import static org.openapitools.codegen.TestUtils.assertFileNotContains; -import static org.openapitools.codegen.languages.SpringCodegen.*; -import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY; -import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; - +import com.google.common.collect.ImmutableMap; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; @@ -34,28 +25,9 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.stream.Collectors; - +import org.openapitools.codegen.*; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.java.assertions.JavaFileAssert; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.AbstractJavaCodegen; import org.openapitools.codegen.languages.SpringCodegen; import org.openapitools.codegen.languages.features.BeanValidationFeatures; @@ -66,7 +38,26 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Ignore; import org.testng.annotations.Test; -import com.google.common.collect.ImmutableMap; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +import static java.util.stream.Collectors.groupingBy; +import static org.assertj.core.api.Assertions.assertThat; +import static org.openapitools.codegen.TestUtils.assertFileContains; +import static org.openapitools.codegen.TestUtils.assertFileNotContains; +import static org.openapitools.codegen.languages.SpringCodegen.*; +import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY; +import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; public class SpringCodegenTest { @@ -552,6 +543,7 @@ public class SpringCodegenTest { Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "org.openapitools.configuration"); Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.SERVER_PORT), "8082"); Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), false); + Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.USE_RESPONSE_ENTITY), true); } @Test @@ -829,16 +821,25 @@ public class SpringCodegenTest { @Test public void useBeanValidationTruePerformBeanValidationFalseJava8TrueForFormatEmail() throws IOException { - beanValidationForFormatEmail(true, false, true, "@Email", "@org.hibernate.validator.constraints.Email"); + beanValidationForFormatEmail(true, false, true, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); } @Test public void useBeanValidationTruePerformBeanValidationTrueJava8FalseForFormatEmail() throws IOException { - beanValidationForFormatEmail(true, true, false, "@Email", "@org.hibernate.validator.constraints.Email"); + beanValidationForFormatEmail(true, true, false, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); + } + + @Test + public void useBeanValidationTruePerformBeanValidationFalseJava8TrueJakartaeeTrueForFormatEmail() throws IOException { + beanValidationForFormatEmail(true, false, true, true,"@jakarta.validation.constraints.Email", "@javax.validation.constraints.Email"); } // note: java8 option/mustache tag has been removed and default to true private void beanValidationForFormatEmail(boolean useBeanValidation, boolean performBeanValidation, boolean java8, String contains, String notContains) throws IOException { + this.beanValidationForFormatEmail(useBeanValidation, performBeanValidation, java8, false, contains, notContains); + } + + private void beanValidationForFormatEmail(boolean useBeanValidation, boolean performBeanValidation, boolean java8, boolean useJakarta, String contains, String notContains) throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); String outputPath = output.getAbsolutePath().replace('\\', '/'); @@ -850,6 +851,7 @@ public class SpringCodegenTest { codegen.setOutputDir(output.getAbsolutePath()); codegen.setUseBeanValidation(useBeanValidation); codegen.setPerformBeanValidation(performBeanValidation); + codegen.setUseSpringBoot3(useJakarta); ClientOptInput input = new ClientOptInput(); input.openAPI(openAPI); @@ -863,15 +865,20 @@ public class SpringCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - List files = generator.opts(input).generate(); + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("PersonWithEmail.java")) + .printFileContent(); + if (useBeanValidation) javaFileAssert.hasImports((useJakarta? "jakarta" : "javax") + ".validation.constraints"); + if (performBeanValidation) javaFileAssert.hasImports("org.hibernate.validator.constraints"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java"), contains); assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java"), notContains); } @Test public void useBeanValidationTruePerformBeanValidationTrueJava8TrueForFormatEmail() throws IOException { - beanValidationForFormatEmail(true, true, true, "@Email", "@org.hibernate.validator.constraints.Email"); + beanValidationForFormatEmail(true, true, true, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); } @Test @@ -908,6 +915,37 @@ public class SpringCodegenTest { assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApiDelegate.java"), "Mono"); } + @Test + public void shouldGenerateValidCodeForReactiveControllerWithoutParams_issue14907() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/bugs/issue_14907.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(SpringCodegen.REACTIVE, "true"); + codegen.additionalProperties().put(USE_TAGS, "true"); + codegen.additionalProperties().put(SpringCodegen.DATE_LIBRARY, "java8"); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); + codegen.additionalProperties().put(SKIP_DEFAULT_INTERFACE, "true"); + codegen.additionalProperties().put(IMPLICIT_HEADERS, "true"); + codegen.additionalProperties().put(OPENAPI_NULLABLE, "false"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert.assertThat(files.get("ConsentControllerApi.java")) + .assertMethod("readAgreements", "ServerWebExchange"); + } + @Test public void shouldEscapeReservedKeyWordsForRequestParameters_7506_Regression() throws Exception { final SpringCodegen codegen = new SpringCodegen(); @@ -1213,7 +1251,7 @@ public class SpringCodegenTest { codegen.setHateoas(true); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); - + codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); @@ -1574,6 +1612,75 @@ public class SpringCodegenTest { .assertMethod("getWithMapOfStrings").hasReturnType("ResponseEntity>"); } + @Test + public void shouldGenerateMethodsWithoutUsingResponseEntityAndWithoutDelegation_issue11537() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put(AbstractJavaCodegen.FULL_JAVA_UTIL, "true"); + additionalProperties.put(SpringCodegen.USE_TAGS, "true"); + additionalProperties.put(SpringCodegen.INTERFACE_ONLY, "true"); + additionalProperties.put(SpringCodegen.SKIP_DEFAULT_INTERFACE, "true"); + additionalProperties.put(SpringCodegen.PERFORM_BEANVALIDATION, "true"); + additionalProperties.put(SpringCodegen.SPRING_CONTROLLER, "true"); + additionalProperties.put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); + additionalProperties.put(USE_RESPONSE_ENTITY, "false"); + Map files = generateFromContract("src/test/resources/bugs/issue_11537.yaml", SPRING_BOOT, additionalProperties); + + JavaFileAssert.assertThat(files.get("MetadataApi.java")) + .assertMethod("getSomething") + .hasReturnType("List") + .assertMethodAnnotations() + .containsWithNameAndAttributes( + "ResponseStatus", + ImmutableMap.of("value", "HttpStatus.OK") + ) + .toMethod() + .toFileAssert() + .assertMethod("putSomething") + .hasReturnType("String") + .assertMethodAnnotations() + .containsWithNameAndAttributes( + "ResponseStatus", + ImmutableMap.of("value", "HttpStatus.CREATED") + ); + } + + @Test + public void shouldGenerateMethodsWithoutUsingResponseEntityAndDelegation_issue11537() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put(AbstractJavaCodegen.FULL_JAVA_UTIL, "true"); + additionalProperties.put(SpringCodegen.USE_TAGS, "true"); + additionalProperties.put(SpringCodegen.SKIP_DEFAULT_INTERFACE, "true"); + additionalProperties.put(SpringCodegen.PERFORM_BEANVALIDATION, "true"); + additionalProperties.put(SpringCodegen.SPRING_CONTROLLER, "true"); + additionalProperties.put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); + additionalProperties.put(USE_RESPONSE_ENTITY, "false"); + additionalProperties.put(DELEGATE_PATTERN, "true"); + Map files = generateFromContract("src/test/resources/bugs/issue_11537.yaml", SPRING_BOOT, additionalProperties); + + JavaFileAssert.assertThat(files.get("MetadataApiDelegate.java")) + .assertMethod("getSomething").hasReturnType("List") + .toFileAssert() + .assertMethod("putSomething").hasReturnType("String"); + + JavaFileAssert.assertThat(files.get("MetadataApi.java")) + .assertMethod("getSomething") + .hasReturnType("List") + .assertMethodAnnotations() + .containsWithNameAndAttributes( + "ResponseStatus", + ImmutableMap.of("value", "HttpStatus.OK") + ) + .toMethod() + .toFileAssert() + .assertMethod("putSomething") + .hasReturnType("String") + .assertMethodAnnotations() + .containsWithNameAndAttributes( + "ResponseStatus", + ImmutableMap.of("value", "HttpStatus.CREATED") + ); + } + @Test public void testResponseWithArray_issue12524() throws Exception { GlobalSettings.setProperty("skipFormModel", "true"); @@ -1873,7 +1980,7 @@ public class SpringCodegenTest { JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Person.java")) .printFileContent(); javaFileAssert.assertMethod("getName").assertMethodAnnotations() - .containsWithName("NotNull").containsWithName("Size").containsWithName("Email"); + .containsWithName("NotNull").containsWithName("Size").containsWithName("javax.validation.constraints.Email"); javaFileAssert .hasNoImports("javax.validation.constraints.NotNull") .hasImports("javax.validation.constraints"); @@ -1970,7 +2077,7 @@ public class SpringCodegenTest { .assertParameterAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of("value", "2")); } - + @Test public void shouldHandleSeparatelyInterfaceAndModelAdditionalAnnotations() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -2083,4 +2190,95 @@ public class SpringCodegenTest { return generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); } + + @Test + public void testMappingSubtypesIssue13150() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/bugs/issue_13150.yaml", null, new ParseOptions()).getOpenAPI(); + + SpringCodegen codegen = new SpringCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + codegen.setUseOneOfInterfaces(true); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + codegen.setHateoas(true); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); + + codegen.setUseOneOfInterfaces(true); + codegen.setLegacyDiscriminatorBehavior(false); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + String jsonSubType = "@JsonSubTypes({\n" + + " @JsonSubTypes.Type(value = Foo.class, name = \"foo\")\n" + + "})"; + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Parent.java"), jsonSubType); + } + + @Test + public void shouldGenerateJsonPropertyAnnotationLocatedInGetters_issue5705() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml", null, new ParseOptions()).getOpenAPI(); + SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary(SPRING_BOOT); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert.assertThat(files.get("ResponseObjectWithDifferentFieldNames.java")) + .hasProperty("normalPropertyName") + .assertPropertyAnnotations() + .doesNotContainsWithName("JsonProperty") + .toProperty().toType() + .hasProperty("UPPER_CASE_PROPERTY_SNAKE") + .assertPropertyAnnotations() + .doesNotContainsWithName("JsonProperty") + .toProperty().toType() + .hasProperty("lowerCasePropertyDashes") + .assertPropertyAnnotations() + .doesNotContainsWithName("JsonProperty") + .toProperty().toType() + .hasProperty("propertyNameWithSpaces") + .assertPropertyAnnotations() + .doesNotContainsWithName("JsonProperty") + .toProperty().toType() + .assertMethod("getNormalPropertyName") + .assertMethodAnnotations() + .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "\"normalPropertyName\"")) + .toMethod().toFileAssert() + .assertMethod("getUPPERCASEPROPERTYSNAKE") + .assertMethodAnnotations() + .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "\"UPPER_CASE_PROPERTY_SNAKE\"")) + .toMethod().toFileAssert() + .assertMethod("getLowerCasePropertyDashes") + .assertMethodAnnotations() + .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "\"lower-case-property-dashes\"")) + .toMethod().toFileAssert() + .assertMethod("getPropertyNameWithSpaces") + .assertMethodAnnotations() + .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "\"property name with spaces\"")); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index c894c899c2b..87f8db53477 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -386,6 +386,28 @@ public class KotlinSpringServerCodegenTest { ); } + @Test(description = "test skip default interface") + public void skipDefaultInterface() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(KotlinSpringServerCodegen.INTERFACE_ONLY, true); + codegen.additionalProperties().put(KotlinSpringServerCodegen.SKIP_DEFAULT_INTERFACE, true); + + new DefaultGenerator().opts(new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/skip-default-interface.yaml")) + .config(codegen)) + .generate(); + + assertFileNotContains( + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApi.kt"), + "return " + ); + } + @Test(description = "use Spring boot 3 & jakarta extension") public void useSpringBoot3() throws Exception { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); 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 08bc443e334..cfc625900d2 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 @@ -388,8 +388,6 @@ public class RubyClientCodegenTest { Set mappedModels = new LinkedHashSet(); mappedModels.add(new CodegenDiscriminator.MappedModel("a", "Adult")); mappedModels.add(new CodegenDiscriminator.MappedModel("c", "Child")); - mappedModels.add(new CodegenDiscriminator.MappedModel("Adult", "Adult")); - mappedModels.add(new CodegenDiscriminator.MappedModel("Child", "Child")); Assert.assertEquals(codegenDiscriminator.getMappedModels(), mappedModels); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java index 59928dbc266..d71bef08e80 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java @@ -166,6 +166,42 @@ public class Swift5ClientCodegenTest { Assert.assertEquals(op.bodyParam.dataType, "OpenAPIDateWithoutTime"); } + @Test(description = "type from languageSpecificPrimitives should not be prefixed", enabled = true) + public void prefixExceptionTest() { + final DefaultCodegen codegen = new Swift5ClientCodegen(); + codegen.setModelNamePrefix("API"); + + final String result = codegen.toModelName("AnyCodable"); + Assert.assertEquals(result, "AnyCodable"); + } + + @Test(description = "type from languageSpecificPrimitives should not be suffixed", enabled = true) + public void suffixExceptionTest() { + final DefaultCodegen codegen = new Swift5ClientCodegen(); + codegen.setModelNameSuffix("API"); + + final String result = codegen.toModelName("AnyCodable"); + Assert.assertEquals(result, "AnyCodable"); + } + + @Test(description = "Other types should be prefixed", enabled = true) + public void prefixTest() { + final DefaultCodegen codegen = new Swift5ClientCodegen(); + codegen.setModelNamePrefix("API"); + + final String result = codegen.toModelName("MyType"); + Assert.assertEquals(result, "APIMyType"); + } + + @Test(description = "Other types should be suffixed", enabled = true) + public void suffixTest() { + final DefaultCodegen codegen = new Swift5ClientCodegen(); + codegen.setModelNameSuffix("API"); + + final String result = codegen.toModelName("MyType"); + Assert.assertEquals(result, "MyTypeAPI"); + } + @Test(enabled = true) public void testDefaultPodAuthors() throws Exception { // Given diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/SpringHttpStatusLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/SpringHttpStatusLambdaTest.java new file mode 100644 index 00000000000..50824c29bde --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/SpringHttpStatusLambdaTest.java @@ -0,0 +1,106 @@ +package org.openapitools.codegen.templating.mustache; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.Locale; +import java.util.Map; + +import static org.openapitools.codegen.templating.mustache.SpringHttpStatusLambda.HTTP_STATUS_PREFIX; +import static org.testng.Assert.assertThrows; + +public class SpringHttpStatusLambdaTest extends LambdaTest { + + @DataProvider(name = "springHttpStatusCodes") + public static Object[][] springHttpStatusCodes() { + return new Object[][] { + {"ACCEPTED", "202"}, + {"ALREADY_REPORTED", "208"}, + {"BAD_GATEWAY", "502"}, + {"BAD_REQUEST", "400"}, + {"BANDWIDTH_LIMIT_EXCEEDED", "509"}, + {"CONFLICT", "409"}, + {"CONTINUE", "100"}, + {"CREATED", "201"}, + {"EARLY_HINTS", "103"}, + {"EXPECTATION_FAILED", "417"}, + {"FAILED_DEPENDENCY", "424"}, + {"FORBIDDEN", "403"}, + {"FOUND", "302"}, + {"GATEWAY_TIMEOUT", "504"}, + {"GONE", "410"}, + {"HTTP_VERSION_NOT_SUPPORTED", "505"}, + {"I_AM_A_TEAPOT", "418"}, + {"IM_USED", "226"}, + {"INSUFFICIENT_STORAGE", "507"}, + {"INTERNAL_SERVER_ERROR", "500"}, + {"LENGTH_REQUIRED", "411"}, + {"LOCKED", "423"}, + {"LOOP_DETECTED", "508"}, + {"METHOD_NOT_ALLOWED", "405"}, + {"MOVED_PERMANENTLY", "301"}, + {"MULTI_STATUS", "207"}, + {"MULTIPLE_CHOICES", "300"}, + {"NETWORK_AUTHENTICATION_REQUIRED", "511"}, + {"NO_CONTENT", "204"}, + {"NON_AUTHORITATIVE_INFORMATION", "203"}, + {"NOT_ACCEPTABLE", "406"}, + {"NOT_EXTENDED", "510"}, + {"NOT_FOUND", "404"}, + {"NOT_IMPLEMENTED", "501"}, + {"NOT_MODIFIED", "304"}, + {"OK", "200"}, + {"PARTIAL_CONTENT", "206"}, + {"PAYLOAD_TOO_LARGE", "413"}, + {"PAYMENT_REQUIRED", "402"}, + {"PERMANENT_REDIRECT", "308"}, + {"PRECONDITION_FAILED", "412"}, + {"PRECONDITION_REQUIRED", "428"}, + {"PROCESSING", "102"}, + {"PROXY_AUTHENTICATION_REQUIRED", "407"}, + {"REQUEST_HEADER_FIELDS_TOO_LARGE", "431"}, + {"REQUEST_TIMEOUT", "408"}, + {"REQUESTED_RANGE_NOT_SATISFIABLE", "416"}, + {"RESET_CONTENT", "205"}, + {"SEE_OTHER", "303"}, + {"SERVICE_UNAVAILABLE", "503"}, + {"SWITCHING_PROTOCOLS", "101"}, + {"TEMPORARY_REDIRECT", "307"}, + {"TOO_EARLY", "425"}, + {"TOO_MANY_REQUESTS", "429"}, + {"UNAUTHORIZED", "401"}, + {"UNAVAILABLE_FOR_LEGAL_REASONS", "451"}, + {"UNPROCESSABLE_ENTITY", "422"}, + {"UNSUPPORTED_MEDIA_TYPE", "415"}, + {"UPGRADE_REQUIRED", "426"}, + {"URI_TOO_LONG", "414"}, + {"VARIANT_ALSO_NEGOTIATES", "506"} + }; + } + + @Test(dataProvider = "springHttpStatusCodes") + public void executeShouldConvertValues(String expectedHttpStatus, String httpCode) { + Map ctx = context("springHttpStatus", new SpringHttpStatusLambda()); + + test( + HTTP_STATUS_PREFIX + expectedHttpStatus, + String.format(Locale.ROOT, "{{#springHttpStatus}}%s{{/springHttpStatus}}", httpCode), + ctx); + } + + @Test + public void executeShouldConvertEmptyHttpStatusTo200Ok() { + Map ctx = context("springHttpStatus", new SpringHttpStatusLambda()); + + test(HTTP_STATUS_PREFIX + "OK", "{{#springHttpStatus}}{{/springHttpStatus}}", ctx); + } + + @Test + public void executeShouldConvertToHttpStatusNotImplementedAnyOtherStatus() { + Map ctx = context("springHttpStatus", new SpringHttpStatusLambda()); + + assertThrows( + IllegalArgumentException.class, + () -> execute("{{#springHttpStatus}}305{{/springHttpStatus}}", ctx)); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/axios/TypeScriptAxiosClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/axios/TypeScriptAxiosClientCodegenTest.java index da55a175fbc..8a229bf14ff 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/axios/TypeScriptAxiosClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/axios/TypeScriptAxiosClientCodegenTest.java @@ -89,7 +89,7 @@ public class TypeScriptAxiosClientCodegenTest { codegen.additionalProperties().put("npmName", "@openapi/typescript-axios-petstore"); codegen.additionalProperties().put("snapshot", false); codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); - codegen.setSupportsES6(true); + codegen.additionalProperties().put("supportsES6", true); codegen.processOpts(); @@ -104,7 +104,7 @@ public class TypeScriptAxiosClientCodegenTest { codegen.additionalProperties().put("npmName", "@openapi/typescript-axios-petstore"); codegen.additionalProperties().put("snapshot", false); codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); - codegen.setSupportsES6(false); + codegen.additionalProperties().put("supportsES6", false); codegen.processOpts(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java index 34e67404179..0f19827b448 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java @@ -116,7 +116,7 @@ public class TypeScriptFetchClientCodegenTest { codegen.additionalProperties().put("npmName", "@openapi/typescript-fetch-petstore"); codegen.additionalProperties().put("snapshot", false); codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); - codegen.setSupportsES6(true); + codegen.additionalProperties().put("supportsES6", true); codegen.processOpts(); @@ -131,7 +131,7 @@ public class TypeScriptFetchClientCodegenTest { codegen.additionalProperties().put("npmName", "@openapi/typescript-fetch-petstore"); codegen.additionalProperties().put("snapshot", false); codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); - codegen.setSupportsES6(false); + codegen.additionalProperties().put("supportsES6", false); codegen.processOpts(); diff --git a/modules/openapi-generator/src/test/resources/3_0/addUnsignedToIntegerWithInvalidMaxValue_test.yaml b/modules/openapi-generator/src/test/resources/3_0/addUnsignedToIntegerWithInvalidMaxValue_test.yaml new file mode 100644 index 00000000000..081d96a9013 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/addUnsignedToIntegerWithInvalidMaxValue_test.yaml @@ -0,0 +1,75 @@ +openapi: 3.0.1 +info: + version: 1.0.0 + title: Example + license: + name: MIT +servers: + - url: http://api.example.xyz/v1 +paths: + /person/display/{personId}: + get: + tags: + - person + - basic + parameters: + - name: personId + in: path + required: true + description: The id of the person to retrieve + schema: + type: string + operationId: list + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Person" + delete: + tags: + - person + parameters: + - name: personId + in: path + required: true + description: The id of the person to retrieve + schema: + type: string + operationId: delete + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Person" +components: + schemas: + Person: + description: person + type: object + properties: + integer: + type: integer + int32: + type: integer + format: int32 + int64: + type: integer + format: int64 + integer_max: + type: integer + minimum: 0 + maximum: 4294967295 #(2^32)-1 + int32_max: + type: integer + format: int32 + minimum: 0 + maximum: 4294967295 #(2^32)-1 + int64_max: + type: integer + format: int64 + minimum: 0 + maximum: 18446744073709551615 #(2^64)-1 diff --git a/modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml b/modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml index 8b5e2793604..a45d9d1cc2e 100644 --- a/modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml @@ -85,3 +85,15 @@ components: type: boolean mum_or_dad: type: string + allOfWithProperties: + description: parent object without x-parent extension + type: object + allOf: + - $ref: '#/components/schemas/AnotherParent' + properties: + isParent: + type: boolean + mum_or_dad: + type: string + required: + - isParent \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/any_codable.yaml b/modules/openapi-generator/src/test/resources/3_0/any_codable.yaml new file mode 100644 index 00000000000..00448b22ff6 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/any_codable.yaml @@ -0,0 +1,45 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore +paths: + /pets: + get: + tags: + - pets + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + /pets/{petId}: + get: + summary: Info for a specific pet + operationId: showPetById + tags: + - pets + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object +components: + schemas: + Pet: + type: object + properties: + testProperty: + type: string + required: + - testProperty \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml index c0ca877d6f9..1ba98052485 100644 --- a/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml @@ -752,3 +752,32 @@ components: type: string message: type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + discriminator: + propertyName: className + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + required: + - className + properties: + className: + type: string + color: + type: string + default: red diff --git a/modules/openapi-generator/src/test/resources/3_0/convertEnumNullToNullable_test.yaml b/modules/openapi-generator/src/test/resources/3_0/convertEnumNullToNullable_test.yaml new file mode 100644 index 00000000000..ab97e13abbd --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/convertEnumNullToNullable_test.yaml @@ -0,0 +1,43 @@ +openapi: 3.0.1 +info: + version: 1.0.0 + title: Example + license: + name: MIT +servers: + - url: http://api.example.xyz/v1 +paths: + /person/display/{personId}: + get: + parameters: + - name: personId + in: path + required: true + description: The id of the person to retrieve + schema: + type: string + operationId: list + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/AnyOfTest" +components: + schemas: + AnyOfTest: + description: to test anyOf (string, enum string) + anyOf: + - type: string + - $ref: '#/components/schemas/EnumString' + - $ref: '#/components/schemas/EnumNull' + EnumString: + type: string + enum: + - A + - B + EnumNull: + type: string + enum: + - null diff --git a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 2e6be05a4b0..c9d94efc91f 100644 --- a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -17,6 +17,21 @@ tags: - name: user description: Operations about user paths: + /hello: + get: + summary: Hello + description: Hello + operationId: Hello + responses: + '200': + description: UUIDs + content: + application/json: + schema: + type: array + items: + type: string + format: uuid /foo: get: responses: @@ -1491,9 +1506,19 @@ components: format: int32 maximum: 200 minimum: 20 + unsigned_integer: + type: integer + format: int32 + maximum: 200 + minimum: 20 + x-unsigned: true int64: type: integer format: int64 + unsigned_long: + type: integer + format: int64 + x-unsigned: true number: maximum: 543.2 minimum: 32.1 @@ -2223,3 +2248,24 @@ components: type: string format: date example: "2017-07-21" + TestCollectionEndingWithWordListObject: + type: object + properties: + TestCollectionEndingWithWordList: + type: array + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + TestCollectionEndingWithWordList: + type: object + properties: + value: + type: string + LiteralStringClass: + type: object + properties: + escapedLiteralString: + type: string + default: C:\\Users\\username + unescapedLiteralString: + type: string + default: C:\Users\username \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/echo_api.yaml b/modules/openapi-generator/src/test/resources/3_0/echo_api.yaml index 860d590a829..c1739912eb1 100644 --- a/modules/openapi-generator/src/test/resources/3_0/echo_api.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/echo_api.yaml @@ -330,6 +330,21 @@ paths: text/plain: schema: type: string + /binary/gif: + post: + tags: + - body + summary: Test binary (gif) response body + description: Test binary (gif) response body + operationId: test/binary/gif + responses: + '200': + description: Successful operation + content: + image/gif: + schema: + type: string + format: binary components: requestBodies: @@ -501,3 +516,16 @@ components: format: date-time description: A date - $ref: '#/components/schemas/Query' + NumberPropertiesOnly: + type: object + properties: + number: + type: number + float: + type: number + format: float + double: + type: number + format: double + minimum: 0.8 + maximum: 50.2 diff --git a/modules/openapi-generator/src/test/resources/3_0/inline_model_allof_propertyof_oneof.yaml b/modules/openapi-generator/src/test/resources/3_0/inline_model_allof_propertyof_oneof.yaml new file mode 100644 index 00000000000..c8869707fef --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/inline_model_allof_propertyof_oneof.yaml @@ -0,0 +1,56 @@ +openapi: 3.0.1 +info: + title: ping test + version: '1.0' +servers: + - url: 'http://localhost:8000/' +paths: + /ping: + get: + operationId: pingGet + responses: + '201': + description: OK +components: + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + allOf: + - $ref: "#/components/schemas/Tag" + - type: object + properties: + length: + type: integer + format: int64 + shipDate: + type: string + format: date-time + inline_oneof: + oneOf: + - $ref: "#/components/schemas/Tag" + - $ref: "#/components/schemas/Filter" + inline_model: + properties: + something: + type: string + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + Filter: + title: Pet Tag + description: A tag for a pet + type: object + properties: + fid: + type: integer + format: int64 + fname: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/issue-5676-enums.yaml b/modules/openapi-generator/src/test/resources/3_0/issue-5676-enums.yaml index 23cdfdc053b..68746de926e 100644 --- a/modules/openapi-generator/src/test/resources/3_0/issue-5676-enums.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/issue-5676-enums.yaml @@ -211,3 +211,11 @@ components: nullable: true allOf: - $ref: "#/components/schemas/NumberEnum" + default-number-enum: + default: 2 + allOf: + - $ref: "#/components/schemas/NumberEnum" + allof-number-enum: + allOf: + - $ref: "#/components/schemas/NumberEnum" + diff --git a/modules/openapi-generator/src/test/resources/3_0/issue6491.yaml b/modules/openapi-generator/src/test/resources/3_0/issue6491.yaml new file mode 100644 index 00000000000..a0076559ff2 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue6491.yaml @@ -0,0 +1,124 @@ +openapi: 3.0.1 +info: + title: My title + description: API under test + version: 1.0.7 +servers: + - url: https://localhost:9999/root +paths: + /location: + get: + operationId: getLocation + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayWithIneffectiveValidations' +components: + schemas: + ArrayWithIneffectiveValidations: + type: array + items: {} + minProperties: 1 + maxProperties: 5 + minLength: 1 + maxLength: 5 + pattern: 'abcde' + multipleOf: 3 + minimum: 1 + maximum: 10 + exclusiveMinimum: 0 + exclusiveMaximum: 100 + + ObjectWithIneffectiveValidations: + type: object + properties: + id: + type: integer + name: + type: string + minItems: 1 + maxItems: 5 + uniqueItems: true + minLength: 1 + maxLength: 10 + pattern: 'abcde' + multipleOf: 3 + minimum: 1 + maximum: 10 + exclusiveMinimum: 1 + exclusiveMaximum: 10 + + + StringWithIneffectiveValidations: + type: string + minItems: 1 + maxItems: 5 + uniqueItems: true + minProperties: 1 + maxProperties: 5 + multipleOf: 3 + minimum: 1 + maximum: 10 + exclusiveMinimum: 0 + exclusiveMaximum: 100 + + IntegerWithIneffectiveValidations: + type: integer + minItems: 1 + maxItems: 5 + uniqueItems: true + minProperties: 1 + maxProperties: 5 + minLength: 1 + maxLength: 10 + pattern: 'abcde' + + AnyTypeWithIneffectiveValidations: + minItems: 1 + maxItems: 5 + uniqueItems: true + minProperties: 1 + maxProperties: 5 + minLength: 1 + maxLength: 10 + pattern: 'abcde' + multipleOf: 4 + minimum: 1 + maximum: 99 + exclusiveMinimum: 0 + exclusiveMaximum: 100 + + BooleanWithIneffectiveValidations: + type: boolean + minItems: 1 + maxItems: 5 + uniqueItems: true + minProperties: 1 + maxProperties: 5 + minLength: 1 + maxLength: 10 + pattern: 'abcde' + multipleOf: 4 + minimum: 1 + maximum: 99 + exclusiveMinimum: 0 + exclusiveMaximum: 100 + + NullWithIneffectiveValidations: + type: null + minItems: 1 + maxItems: 5 + uniqueItems: true + minProperties: 1 + maxProperties: 5 + minLength: 1 + maxLength: 10 + pattern: 'abcde' + multipleOf: 4 + minimum: 1 + maximum: 99 + exclusiveMinimum: 0 + exclusiveMaximum: 100 diff --git a/modules/openapi-generator/src/test/resources/3_0/jaxrs/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/jaxrs/petstore.yaml new file mode 100644 index 00000000000..43da2edac40 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jaxrs/petstore.yaml @@ -0,0 +1,756 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + externalDocs: + url: "http://petstore.swagger.io/v2/doc/updatePet" + description: "API documentation for the updatePet operation" + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /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 + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + 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 + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + 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 + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /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 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + 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 + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + 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 + '404': + description: User not found + security: + - api_key: [] + /test/upload: + post: + summary: test upload + description: upload test + operationId: testUpload + requestBody: + required: false + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + default: + description: whatever +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/skip-default-interface.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/skip-default-interface.yaml new file mode 100644 index 00000000000..7b9d60bac6e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/skip-default-interface.yaml @@ -0,0 +1,13 @@ +openapi: "3.0.1" +info: + title: test + version: "1.0" + +paths: + + /ping: + get: + operationId: ping + responses: + 200: + description: OK diff --git a/modules/openapi-generator/src/test/resources/3_0/nested_anyof.yaml b/modules/openapi-generator/src/test/resources/3_0/nested_anyof.yaml new file mode 100644 index 00000000000..da3c88bd038 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/nested_anyof.yaml @@ -0,0 +1,16 @@ +openapi: 3.0.0 +info: + version: '1.0.0' + title: 'Problem example with nested anyOf' +paths: {} +components: + schemas: + NullOne: + enum: + - null + SomeData: + anyOf: + - anyOf: + - type: string + - type: integer + - $ref: '#/components/schemas/NullOne' 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 6ec5b66e0e6..fe954df8e42 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 @@ -1484,6 +1484,9 @@ components: type: object discriminator: propertyName: className + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' required: - className properties: diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml index 24a7dd47d53..9dedcf30521 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1234,6 +1234,20 @@ paths: responses: 200: description: The instance started successfully + /fake/any_type_body: + post: + tags: + - fake + summary: test any type request body + operationId: fakeAnyTypeRequestBody + requestBody: + content: + application/json: + schema: + type: object + responses: + 200: + description: OK servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1577,6 +1591,9 @@ components: string: type: string pattern: '/[a-z]/i' + string_with_double_quote_pattern: + type: string + pattern: 'this is "something"' byte: type: string format: byte @@ -2095,3 +2112,38 @@ components: - $ref: '#/components/schemas/RgbColor' - $ref: '#/components/schemas/RgbaColor' - $ref: '#/components/schemas/HexColor' + InnerDictWithProperty: + type: object + properties: + aProperty: + type: object + DictWithAdditionalProperties: + type: object + additionalProperties: + $ref: "#/components/schemas/InnerDictWithProperty" + ParentWithOptionalDict: + type: object + properties: + optionalDict: + $ref: "#/components/schemas/DictWithAdditionalProperties" + Circular-Reference-Model: + type: object + properties: + size: + type: integer + nested: + $ref: '#/components/schemas/FirstRef' + FirstRef: + type: object + properties: + category: + type: string + self_ref: + $ref: '#/components/schemas/SecondRef' + SecondRef: + type: object + properties: + category: + type: string + circular_ref: + $ref: '#/components/schemas/Circular-Reference-Model' diff --git a/modules/openapi-generator/src/test/resources/3_0/required-and-readonly-property.yaml b/modules/openapi-generator/src/test/resources/3_0/required-and-readonly-property.yaml new file mode 100644 index 00000000000..25c43f7d202 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/required-and-readonly-property.yaml @@ -0,0 +1,38 @@ +openapi: 3.0.3 +info: + title: Title + description: Title + version: 1.0.0 +servers: + - url: 'https' +paths: + '/user': + get: + responses: + 200: + description: "success" + content: + application/json: + schema: + $ref: '#/components/schemas/ReadonlyAndRequiredProperties' + +components: + schemas: + ReadonlyAndRequiredProperties: + type: object + required: + - requiredYesReadonlyYes + - requiredYesReadonlyNo + properties: + requiredYesReadonlyYes: + type: string + readOnly: true + requiredYesReadonlyNo: + type: string + requiredNoReadonlyYes: + type: string + readOnly: true + requiredNoReadonlyNo: + type: string + + diff --git a/modules/openapi-generator/src/test/resources/3_0/simplifyAnyOfStringAndEnumString_test.yaml b/modules/openapi-generator/src/test/resources/3_0/simplifyAnyOfStringAndEnumString_test.yaml index 453b35e0f46..a2fbdb49a79 100644 --- a/modules/openapi-generator/src/test/resources/3_0/simplifyAnyOfStringAndEnumString_test.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/simplifyAnyOfStringAndEnumString_test.yaml @@ -36,4 +36,11 @@ components: enum: - A - B + SingleAnyOfTest: + description: to test anyOf (enum string only) + anyOf: + - type: string + enum: + - A + - B diff --git a/modules/openapi-generator/src/test/resources/3_0/simplifyBooleanEnum_test.yaml b/modules/openapi-generator/src/test/resources/3_0/simplifyBooleanEnum_test.yaml index 270dfcea641..3d1fc9b379c 100644 --- a/modules/openapi-generator/src/test/resources/3_0/simplifyBooleanEnum_test.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/simplifyBooleanEnum_test.yaml @@ -41,3 +41,21 @@ components: enum: - true - false + ComposedSchemaBooleanEnumTest: + description: a model to with boolean enum property + type: object + oneOf: + - type: string + - type: integer + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + boolean_enum: + type: boolean + enum: + - true + - false diff --git a/modules/openapi-generator/src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml b/modules/openapi-generator/src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml index 5f0cf2370de..2a2fe727152 100644 --- a/modules/openapi-generator/src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml @@ -42,4 +42,10 @@ components: - type: integer - type: string - $ref: null - + SingleAnyOfTest: + description: to test anyOf (enum string only) + anyOf: + - type: string + enum: + - A + - B \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml similarity index 76% rename from samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml rename to modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml index 658d8a96b30..3d6ed2942c3 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml @@ -1,58 +1,31 @@ openapi: 3.0.1 info: - 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:\ - \ \" \\" + 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: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore + url: http://www.apache.org/licenses/LICENSE-2.0.html version: 1.0.0 servers: - url: http://petstore.swagger.io:80/v2 tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user +- name: pet + description: Everything about your Pets +- name: store + description: Access to Petstore orders +- name: user + description: Operations about user paths: /pet: - post: - operationId: addPet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store + put: tags: - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet - put: + summary: Update an existing pet operationId: updatePet requestBody: + description: Pet object that needs to be added to the store content: application/json: schema: @@ -60,172 +33,157 @@ paths: application/xml: schema: $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store required: true responses: - "200": - content: {} + 200: description: successful operation - "400": content: {} + 400: description: Invalid ID supplied - "404": content: {} + 404: description: Pet not found - "405": content: {} + 405: description: Validation exception + content: {} security: - petstore_auth: - write:pets - read:pets - summary: Update an existing pet + x-codegen-request-body-name: body + post: tags: - pet + summary: Add a new pet to the store + operationId: addPet + requestBody: + description: Pet object that needs to be added to the store + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + required: true + responses: + 200: + description: successful operation + content: {} + 405: + description: Invalid input + content: {} + security: + - petstore_auth: + - write:pets + - read:pets x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet /pet/findByStatus: get: + tags: + - pet + summary: Finds Pets by status description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - description: Status values that need to be considered for filter - explode: false + - name: status in: query - name: status + description: Status values that need to be considered for filter required: true + style: form + explode: false schema: + type: array items: + type: string default: available enum: - available - pending - sold - type: string - type: array - style: form responses: - "200": + 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": - content: {} + 400: description: Invalid status value + content: {} security: - petstore_auth: - write:pets - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet + x-spring-paginated: true /pet/findByTags: get: - deprecated: true - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." + tags: + - pet + summary: Finds Pets by tags + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - - description: Tags to filter by - explode: false + - name: tags in: query - name: tags + description: Tags to filter by required: true + style: form + explode: false schema: + type: array items: type: string - type: array - uniqueItems: true - style: form responses: - "200": + 200: + description: successful operation content: application/xml: schema: + type: array items: $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true application/json: schema: + type: array items: $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} + 400: description: Invalid tag value + content: {} + deprecated: true security: - petstore_auth: - write:pets - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet + x-spring-paginated: true /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet + get: tags: - pet - x-accepts: application/json - x-tags: - - tag: pet - get: + summary: Find pet by ID description: Returns a single pet operationId: getPetById parameters: - - description: ID of pet to return + - name: petId in: path - name: petId + description: ID of pet to return required: true schema: - format: int64 type: integer + format: int64 responses: - "200": + 200: + description: successful operation content: application/xml: schema: @@ -233,119 +191,146 @@ paths: application/json: schema: $ref: '#/components/schemas/Pet' - description: successful operation - "400": - content: {} + 400: description: Invalid ID supplied - "404": content: {} + 404: description: Pet not found + content: {} security: - api_key: [] - summary: Find pet by ID + post: tags: - pet - x-accepts: application/json - x-tags: - - tag: pet - post: + summary: Updates a pet in the store with form data operationId: updatePetWithForm parameters: - - description: ID of pet that needs to be updated + - name: petId in: path - name: petId + description: ID of pet that needs to be updated required: true schema: - format: int64 type: integer + format: int64 requestBody: content: application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/updatePetWithForm_request' + properties: + name: + type: string + description: Updated name of the pet + status: + type: string + description: Updated status of the pet responses: - "405": - content: {} + 405: description: Invalid input + content: {} security: - petstore_auth: - write:pets - read:pets - summary: Updates a pet in the store with form data + delete: tags: - pet - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile + summary: Deletes a pet + operationId: deletePet parameters: - - description: ID of pet to update + - name: api_key + in: header + schema: + type: string + - name: petId in: path - name: petId + description: Pet id to delete required: true schema: - format: int64 type: integer + format: int64 + responses: + 200: + description: successful operation + content: {} + 400: + description: Invalid pet value + content: {} + security: + - petstore_auth: + - write:pets + - read:pets + /pet/{petId}/uploadImage: + post: + tags: + - pet + summary: uploads an image + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 requestBody: content: multipart/form-data: schema: - $ref: '#/components/schemas/uploadFile_request' + properties: + additionalMetadata: + type: string + description: Additional data to pass to server + file: + type: string + description: file to upload + format: binary responses: - "200": + 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-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet /store/inventory: get: + tags: + - store + summary: Returns pet inventories by status description: Returns a map of status codes to quantities operationId: getInventory responses: - "200": + 200: + description: successful operation content: application/json: schema: - additionalProperties: - format: int32 - type: integer type: object - description: successful operation + additionalProperties: + type: integer + format: int32 security: - api_key: [] - summary: Returns pet inventories by status - tags: - - store - x-accepts: application/json - x-tags: - - tag: store /store/order: post: + tags: + - store + summary: Place an order for a pet operationId: placeOrder requestBody: + description: order placed for purchasing the pet content: '*/*': schema: $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet required: true responses: - "200": + 200: + description: successful operation content: application/xml: schema: @@ -353,59 +338,31 @@ paths: application/json: schema: $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} + 400: description: Invalid Order - summary: Place an order for a pet - tags: - - store + content: {} x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: store /store/order/{order_id}: - 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 + get: tags: - store - x-accepts: application/json - x-tags: - - tag: store - get: + summary: Find purchase order by ID description: For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions operationId: getOrderById parameters: - - description: ID of pet that needs to be fetched + - name: order_id in: path - name: order_id + description: ID of pet that needs to be fetched required: true schema: - format: int64 maximum: 5 minimum: 1 type: integer + format: int64 responses: - "200": + 200: + description: successful operation content: application/xml: schema: @@ -413,184 +370,161 @@ paths: application/json: schema: $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} + 400: description: Invalid ID supplied - "404": content: {} + 404: description: Order not found - summary: Find purchase order by ID + content: {} + delete: tags: - store - x-accepts: application/json - x-tags: - - tag: 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: {} /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: $ref: '#/components/schemas/User' - description: Created user object required: true responses: default: - content: {} description: successful operation - summary: Create user - tags: - - user + content: {} x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /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: - content: {} description: successful operation - summary: Creates list of users with given input array - tags: - - user + content: {} x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /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: - content: {} description: successful operation - summary: Creates list of users with given input array - tags: - - user + content: {} x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/login: get: + tags: + - user + summary: Logs user into the system operationId: loginUser parameters: - - description: The user name for login + - name: username in: query - name: username + description: The user name for login required: true schema: type: string - - description: The password for login in clear text + - name: password in: query - name: password + description: The password for login in clear text required: true schema: type: string responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string + 200: description: successful operation headers: X-Rate-Limit: description: calls per hour allowed by the user schema: - format: int32 type: integer + format: int32 X-Expires-After: description: date in UTC when token expires schema: - format: date-time type: string - "400": - content: {} + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + 400: description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user + content: {} /user/logout: get: + tags: + - user + summary: Logs out current logged in user session operationId: logoutUser responses: default: - content: {} description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: user + content: {} /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user + get: tags: - user - x-accepts: application/json - x-tags: - - tag: user - get: + summary: Get user by user name operationId: getUserByName parameters: - - description: The name that needs to be fetched. Use user1 for testing. + - name: username in: path - name: username + description: The name that needs to be fetched. Use user1 for testing. required: true schema: type: string responses: - "200": + 200: + description: successful operation content: application/xml: schema: @@ -598,425 +532,489 @@ paths: application/json: schema: $ref: '#/components/schemas/User' - description: successful operation - "400": - content: {} + 400: description: Invalid username supplied - "404": content: {} + 404: description: User not found - summary: Get user by user name + content: {} + put: tags: - user - x-accepts: application/json - x-tags: - - tag: user - put: + summary: Updated user description: This can only be done by the logged in user. operationId: updateUser parameters: - - description: name that need to be deleted + - name: username in: path - name: username + description: name that need to be deleted required: true schema: type: string requestBody: + description: Updated user object content: '*/*': schema: $ref: '#/components/schemas/User' - description: Updated user object required: true responses: - "400": - content: {} + 400: description: Invalid user supplied - "404": content: {} + 404: description: User not found - summary: Updated user + content: {} + x-codegen-request-body-name: body + delete: tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: 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: {} /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: $ref: '#/components/schemas/Client' - description: client model required: true responses: - "200": + 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-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ /fake: - 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: Something wrong - summary: Fake endpoint to test group parameters (optional) + get: tags: - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake - get: + summary: To test enum parameters description: To test enum parameters operationId: testEnumParameters parameters: - - description: Header parameter enum test (string array) - explode: false + - name: enum_header_string_array in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array + description: Header parameter enum test (string array) style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) explode: false - in: query - name: enum_query_string_array schema: + type: array items: + type: string default: $ enum: - '>' - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string + - name: enum_header_string + in: header + description: Header parameter enum test (string) schema: + type: string default: -efg enum: - _abc - -efg - (xyz) - type: string - - description: Query parameter enum test (double) + - name: enum_query_string_array in: query - name: enum_query_integer + description: Query parameter enum test (string array) + style: form + explode: false schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + default: -efg + enum: + - _abc + - -efg + - (xyz) + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 enum: - 1 - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) + - name: enum_query_double in: query - name: enum_query_double + description: Query parameter enum test (double) schema: + type: number + format: double enum: - 1.1 - -1.2 - format: double - type: number requestBody: content: application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/testEnumParameters_request' + properties: + enum_form_string_array: + type: array + description: Form parameter enum test (string array) + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + type: string + description: Form parameter enum test (string) + default: -efg + enum: + - _abc + - -efg + - (xyz) responses: - "400": - content: {} + 400: description: Invalid request - "404": content: {} + 404: description: Not found - summary: To test enum parameters - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - 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 - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake + content: {} post: - description: |- + tags: + - fake + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/testEndpointParameters_request' + required: + - byte + - double + - number + - pattern_without_delimiter + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + description: None + format: int32 + int32: + maximum: 200 + minimum: 20 + type: integer + description: None + format: int32 + int64: + type: integer + description: None + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + description: None + float: + maximum: 987.6 + type: number + description: None + format: float + double: + maximum: 123.4 + minimum: 67.8 + type: number + description: None + format: double + string: + pattern: /[a-z]/i + type: string + description: None + pattern_without_delimiter: + pattern: ^[A-Z].* + type: string + description: None + byte: + type: string + description: None + format: byte + binary: + type: string + description: None + format: binary + date: + type: string + description: None + format: date + dateTime: + type: string + description: None + format: date-time + password: + maxLength: 64 + minLength: 10 + type: string + description: None + format: password + callback: + type: string + description: None required: true responses: - "400": - content: {} + 400: description: Invalid username supplied - "404": content: {} + 404: description: User not found + content: {} security: - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + delete: tags: - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + 400: + description: Something wrong + content: {} + x-group-parameters: true + patch: + 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-codegen-request-body-name: body /fake/outer/number: post: + tags: + - fake description: Test serialization of outer number types operationId: fakeOuterNumberSerialize requestBody: + description: Input number as post body content: '*/*': schema: $ref: '#/components/schemas/OuterNumber' - description: Input number as post body required: false responses: - "200": + 200: + description: Output number content: '*/*': schema: $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/outer/string: post: + tags: + - fake description: Test serialization of outer string types operationId: fakeOuterStringSerialize requestBody: + description: Input string as post body content: '*/*': schema: $ref: '#/components/schemas/OuterString' - description: Input string as post body required: false responses: - "200": + 200: + description: Output string content: '*/*': schema: $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/outer/boolean: post: + tags: + - fake description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize requestBody: + description: Input boolean as post body content: '*/*': schema: $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body required: false responses: - "200": + 200: + description: Output boolean content: '*/*': schema: $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /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: $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body required: false responses: - "200": + 200: + description: Output composite content: '*/*': schema: $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/jsonFormData: get: + tags: + - fake + summary: test json serialization of form data operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/testJsonFormData_request' + required: + - param + - param2 + properties: + param: + type: string + description: field1 + param2: + type: string + description: field2 required: true responses: - "200": - content: {} + 200: description: successful operation - summary: test json serialization of form data - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake + content: {} /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": - content: {} + 200: description: successful operation - summary: test inline additionalProperties - tags: - - fake + content: {} x-codegen-request-body-name: param - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/body-with-query-params: put: + tags: + - fake operationId: testBodyWithQueryParams parameters: - - in: query - name: query + - name: query + in: query required: true schema: type: string @@ -1027,21 +1025,19 @@ paths: $ref: '#/components/schemas/User' required: true responses: - "200": - content: {} + 200: description: Success - tags: - - fake + content: {} x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/create_xml_item: post: + tags: + - fake + summary: creates an XmlItem description: this route creates an XmlItem operationId: createXmlItem requestBody: + description: XmlItem Body content: application/xml: schema: @@ -1061,50 +1057,40 @@ paths: text/xml; charset=utf-16: schema: $ref: '#/components/schemas/XmlItem' - description: XmlItem Body required: true responses: - "200": - content: {} + 200: description: successful operation - summary: creates an XmlItem - tags: - - fake + content: {} x-codegen-request-body-name: XmlItem - x-content-type: application/xml - x-accepts: application/json - x-tags: - - tag: fake /another-fake/dummy: patch: + tags: + - $another-fake? + summary: To 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: $ref: '#/components/schemas/Client' - description: client model required: true responses: - "200": + 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-content-type: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? /fake/body-with-file-schema: put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." + tags: + - fake + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1113,173 +1099,271 @@ paths: $ref: '#/components/schemas/FileSchemaTestClass' required: true responses: - "200": - content: {} + 200: description: Success - tags: - - fake + content: {} x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/test-query-parameters: put: + tags: + - fake description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - name: pipe in: query - name: pipe required: true - schema: - items: - type: string - type: array style: form - - in: query - name: ioutil - required: true + explode: false schema: + type: array items: type: string - type: array - - in: query - name: http + - name: ioutil + in: query required: true schema: + type: array items: type: string - type: array + - name: http + in: query + required: true style: spaceDelimited - - explode: false - in: query - name: url - required: true schema: + type: array items: type: string - type: array - style: form - - explode: true + - name: url in: query - name: context required: true + style: form + explode: false schema: + type: array items: type: string - type: array + - name: context + in: query + required: true style: form + explode: true + schema: + type: array + items: + type: string responses: - "200": - content: {} + 200: description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake + content: {} /fake/{petId}/uploadImageWithRequiredFile: post: + tags: + - pet + summary: uploads an image (required) operationId: uploadFileWithRequiredFile parameters: - - description: ID of pet to update + - name: petId in: path - name: petId + description: ID of pet to update required: true schema: - format: int64 type: integer + format: int64 requestBody: content: multipart/form-data: schema: - $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + required: + - requiredFile + properties: + additionalMetadata: + type: string + description: Additional data to pass to server + requiredFile: + type: string + description: file to upload + format: binary required: true responses: - "200": + 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) + /versioning/headers: + post: tags: - - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet + - versioning + operationId: versioningHeaders + parameters: + - name: VersionWithDefaultValue + in: header + required: true + schema: + type: string + default: V1 + x-version-param: true + x-version-param: true + - name: VersionNoDefaultValue + in: header + required: true + schema: + type: string + x-version-param: true + x-version-param: true + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: successful operation + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiResponse' + /versioning/query-params: + post: + tags: + - versioning + operationId: versioningQueryParams + parameters: + - name: VersionWithDefaultValue + in: query + required: true + schema: + type: string + default: V1 + x-version-param: true + x-version-param: true + - name: VersionNoDefaultValue + in: query + required: true + schema: + type: string + x-version-param: true + x-version-param: true + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: successful operation + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiResponse' + /versioning/mix: + post: + tags: + - versioning + operationId: versioningMix + parameters: + - name: VersionWithDefaultValueQuery + in: query + required: true + schema: + type: string + default: V1 + x-version-param: true + x-version-param: true + - name: VersionNoDefaultValueQuery + in: query + required: true + schema: + type: string + x-version-param: true + x-version-param: true + - name: VersionWithDefaultValueHeader + in: header + required: true + schema: + type: string + default: V1 + x-version-param: true + x-version-param: true + - name: VersionNoDefaultValueHeader + in: header + required: true + schema: + type: string + x-version-param: true + x-version-param: true + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: successful operation + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiResponse' components: schemas: Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed + type: object properties: id: - format: int64 type: integer + format: int64 petId: + type: integer format: int64 - type: integer quantity: - format: int32 type: integer + format: int32 shipDate: - format: date-time type: string + format: date-time status: + type: string description: Order Status enum: - placed - approved - delivered - type: string complete: - default: false type: boolean - type: object + default: false xml: name: Order Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string required: - name type: object + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name xml: name: Category User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username + type: object properties: id: - format: int64 type: integer + format: int64 x-is-unique: true username: type: string @@ -1294,427 +1378,404 @@ components: phone: type: string userStatus: + type: integer description: User Status format: int32 - type: integer - type: object xml: name: User Tag: - example: - name: name - id: 1 + type: object properties: id: - format: int64 type: integer + format: int64 name: type: string - type: object xml: name: Tag 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 + required: + - name + - photoUrls + type: object properties: id: - format: int64 type: integer + format: int64 x-is-unique: true category: $ref: '#/components/schemas/Category' name: - example: doggie type: string + example: doggie photoUrls: - items: - type: string type: array - uniqueItems: true xml: name: photoUrl wrapped: true - tags: items: - $ref: '#/components/schemas/Tag' + type: string + tags: type: array xml: name: tag wrapped: true + items: + $ref: '#/components/schemas/Tag' status: + type: string description: pet status in the store enum: - available - pending - sold - type: string - required: - - name - - photoUrls - type: object xml: name: Pet ApiResponse: - example: - code: 0 - type: type - message: message + type: object properties: code: - format: int32 type: integer + format: int32 type: type: string message: type: string + _special_model_name_: type: object - $special[model.name]: properties: $special[property.name]: - format: int64 type: integer - type: object + format: int64 xml: - name: "$special[model.name]" + name: $special[model.name] Return: - description: Model for testing reserved words + type: object properties: return: - format: int32 type: integer - type: object + format: int32 + description: Model for testing reserved words xml: name: Return Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer required: - name type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number properties: name: - format: int32 type: integer + format: int32 + snake_case: + type: integer + format: int32 + readOnly: true + property: + type: string + 123Number: + type: integer + readOnly: true + description: Model for testing model name same as property name + xml: + name: Name + 200_response: + type: object + properties: + name: + type: integer + format: int32 class: type: string - type: object + description: Model for testing model name starting with number xml: name: Name ClassModel: - description: Model for testing model with "_class" property + type: object properties: _class: type: string - type: object + description: Model for testing model with "_class" property Dog: allOf: - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' + - type: object + properties: + breed: + type: string Cat: allOf: - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' + - type: object + properties: + declawed: + type: boolean Animal: - discriminator: - propertyName: className + required: + - className + type: object properties: className: type: string color: - default: red type: string - required: - - className - type: object + default: red + discriminator: + propertyName: className AnimalFarm: + type: array items: $ref: '#/components/schemas/Animal' - type: array format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - 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 - BigDecimal: - format: number - type: string required: - byte - date - number - password type: object + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + maximum: 2E+2 + minimum: 2E+1 + type: integer + format: int32 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + maximum: 987.6 + minimum: 54.3 + type: number + format: float + double: + maximum: 123.4 + minimum: 67.8 + type: number + format: double + string: + pattern: /[a-z]/i + type: string + byte: + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + maxLength: 64 + minLength: 10 + type: string + format: password + BigDecimal: + type: string + format: number EnumClass: + type: string 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' required: - enum_string_required type: object + 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 + outerEnum: + $ref: '#/components/schemas/OuterEnum' AdditionalPropertiesClass: + type: object properties: map_string: + type: object additionalProperties: type: string - type: object map_number: + type: object additionalProperties: type: number - type: object map_integer: + type: object additionalProperties: type: integer - type: object map_boolean: + type: object additionalProperties: type: boolean - type: object map_array_integer: + type: object additionalProperties: + type: array items: type: integer - type: array - type: object map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array type: object - map_map_string: additionalProperties: + type: array + items: + type: object + properties: {} + map_map_string: + type: object + additionalProperties: + type: object additionalProperties: type: string - type: object - type: object map_map_anytype: + type: object additionalProperties: - additionalProperties: - properties: {} - type: object type: object - type: object + additionalProperties: + type: object + properties: {} anytype_1: - properties: {} type: object + properties: {} anytype_2: type: object anytype_3: - properties: {} type: object - type: object + properties: {} AdditionalPropertiesString: + type: object + properties: + name: + type: string additionalProperties: type: string + AdditionalPropertiesInteger: + type: object properties: name: type: string - type: object - AdditionalPropertiesInteger: additionalProperties: type: integer + AdditionalPropertiesNumber: + type: object properties: name: type: string - type: object - AdditionalPropertiesNumber: additionalProperties: type: number + AdditionalPropertiesBoolean: + type: object properties: name: type: string - type: object - AdditionalPropertiesBoolean: additionalProperties: type: boolean - properties: - name: - type: string - type: object AdditionalPropertiesArray: + type: object + properties: + name: + type: string additionalProperties: - items: - properties: {} - type: object type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} + items: type: object - type: object + properties: {} + AdditionalPropertiesObject: + type: object properties: name: type: string - type: object - AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object + additionalProperties: + type: object + properties: {} + AdditionalPropertiesAnyType: + type: object properties: name: type: string - type: object + additionalProperties: + type: object + properties: {} MixedPropertiesAndAdditionalPropertiesClass: + type: object properties: uuid: + type: string format: uuid - type: string dateTime: - format: date-time type: string + format: date-time map: + type: object additionalProperties: $ref: '#/components/schemas/Animal' - type: object - type: object List: - properties: - "123-list": - type: string type: object + properties: + 123-list: + type: string Client: - example: - client: client + type: object properties: client: type: string - type: object ReadOnlyFirst: + type: object properties: bar: - readOnly: true type: string + readOnly: true baz: type: string - type: object hasOnlyReadOnly: + type: object properties: bar: - readOnly: true type: string + readOnly: true foo: - readOnly: true type: string - type: object + readOnly: true Capitalization: + type: object properties: smallCamel: type: string @@ -1727,110 +1788,102 @@ components: SCA_ETH_Flow_Points: type: string ATT_NAME: + type: string description: | Name of the pet - type: string - type: object MapTest: + type: object properties: map_map_of_string: + type: object additionalProperties: + type: object additionalProperties: type: string - type: object - type: object map_of_enum_string: + type: object additionalProperties: + type: string enum: - UPPER - lower - type: string - type: object direct_map: + type: object additionalProperties: type: boolean - type: object indirect_map: - additionalProperties: - type: boolean - type: object - type: object + $ref: '#/components/schemas/StringBooleanMap' ArrayTest: + type: object properties: array_of_string: + type: array items: type: string - type: array array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array type: array - array_array_of_model: items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array items: $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object NumberOnly: + type: object properties: JustNumber: type: number - type: object ArrayOfNumberOnly: + type: object properties: ArrayNumber: + type: array items: type: number - type: array - type: object ArrayOfArrayOfNumberOnly: + type: object properties: ArrayArrayNumber: + type: array items: + type: array items: type: number - type: array - type: array - type: object EnumArrays: + type: object properties: just_symbol: + type: string enum: - '>=' - $ - type: string array_enum: + type: array items: + type: string enum: - fish - crab - type: string - type: array - type: object OuterEnum: + type: string enum: - placed - approved - delivered - type: string OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true + type: object properties: my_number: - type: number + $ref: '#/components/schemas/OuterNumber' my_string: - type: string + $ref: '#/components/schemas/OuterString' my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object + $ref: '#/components/schemas/OuterBoolean' OuterNumber: type: number OuterString: @@ -1839,49 +1892,26 @@ components: type: boolean x-codegen-body-parameter-name: boolean_post_body StringBooleanMap: + type: object additionalProperties: type: boolean - type: object FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI + type: object properties: file: $ref: '#/components/schemas/File' files: + type: array items: $ref: '#/components/schemas/File' - type: array - type: object File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI + type: object properties: sourceURI: + type: string description: Test capitalization - type: string - type: object + description: Must be named `File` for test. TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array required: - array_item - bool_item @@ -1889,33 +1919,22 @@ components: - number_item - string_item type: object - TypeHolderExample: properties: string_item: - example: what type: string + default: what 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 + default: true array_item: - example: - - 0 - - 1 - - 2 - - 3 + type: array items: type: integer - type: array + TypeHolderExample: required: - array_item - bool_item @@ -1924,362 +1943,228 @@ components: - number_item - string_item type: object + properties: + string_item: + type: string + example: what + number_item: + type: number + example: 1.234 + float_item: + type: number + format: float + example: 1.234 + integer_item: + type: integer + example: -2 + bool_item: + type: boolean + example: true + array_item: + type: array + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer XmlItem: + type: object properties: attribute_string: - example: string type: string + example: string xml: attribute: true attribute_number: - example: 1.234 type: number + example: 1.234 xml: attribute: true attribute_integer: - example: -2 type: integer + example: -2 xml: attribute: true attribute_boolean: - example: true type: boolean + example: true xml: attribute: true wrapped_array: - items: - type: integer type: array xml: wrapped: true + items: + type: integer name_string: - example: string type: string + example: string xml: name: xml_name_string name_number: - example: 1.234 type: number + example: 1.234 xml: name: xml_name_number name_integer: - example: -2 type: integer + example: -2 xml: name: xml_name_integer name_boolean: - example: true type: boolean + example: true xml: name: xml_name_boolean name_array: + type: array items: type: integer xml: name: xml_name_array_item - type: array name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item type: array xml: name: xml_name_wrapped_array wrapped: true + items: + type: integer + xml: + name: xml_name_wrapped_array_item prefix_string: - example: string type: string + example: string xml: prefix: ab prefix_number: - example: 1.234 type: number + example: 1.234 xml: prefix: cd prefix_integer: - example: -2 type: integer + example: -2 xml: prefix: ef prefix_boolean: - example: true type: boolean + example: true xml: prefix: gh prefix_array: + type: array items: type: integer xml: prefix: ij - type: array prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn type: array xml: prefix: kl wrapped: true + items: + type: integer + xml: + prefix: mn namespace_string: - example: string type: string + example: string xml: namespace: http://a.com/schema namespace_number: - example: 1.234 type: number + example: 1.234 xml: namespace: http://b.com/schema namespace_integer: - example: -2 type: integer + example: -2 xml: namespace: http://c.com/schema namespace_boolean: - example: true type: boolean + example: true xml: namespace: http://d.com/schema namespace_array: + type: array items: type: integer xml: namespace: http://e.com/schema - type: array namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema type: array xml: namespace: http://f.com/schema wrapped: true + items: + type: integer + xml: + namespace: http://g.com/schema prefix_ns_string: - example: string type: string + example: string xml: namespace: http://a.com/schema prefix: a prefix_ns_number: - example: 1.234 type: number + example: 1.234 xml: namespace: http://b.com/schema prefix: b prefix_ns_integer: - example: -2 type: integer + example: -2 xml: namespace: http://c.com/schema prefix: c prefix_ns_boolean: - example: true type: boolean + example: true xml: namespace: http://d.com/schema prefix: d prefix_ns_array: + type: 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 + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g xml: namespace: http://a.com/schema prefix: pre - updatePetWithForm_request: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - uploadFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - testEnumParameters_request: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - testEndpointParameters_request: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - testJsonFormData_request: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - uploadFileWithRequiredFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - Dog_allOf: - properties: - breed: - type: string - type: object - example: null - Cat_allOf: - properties: - declawed: - type: boolean - type: object - example: null - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null securitySchemes: petstore_auth: + type: oauth2 flows: implicit: authorizationUrl: http://petstore.swagger.io/api/oauth/dialog scopes: write:pets: modify pets in your account read:pets: read your pets - type: oauth2 api_key: - in: header + type: apiKey name: api_key - type: apiKey + in: header api_key_query: - in: query - name: api_key_query type: apiKey + name: api_key_query + in: query http_basic_test: - scheme: basic type: http -x-original-swagger-version: "2.0" + scheme: basic diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml new file mode 100644 index 00000000000..27c97636a18 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml @@ -0,0 +1,2039 @@ +openapi: 3.0.0 +info: + 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: " \' + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: "" + operationId: addPet + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + "200": + description: successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + put: + tags: + - pet + summary: Update an existing pet + description: "" + operationId: updatePet + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + "200": + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + /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 + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + "200": + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: "#/components/schemas/Pet" + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Pet" + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + 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 + schema: + type: array + items: + type: string + uniqueItems: true + responses: + "200": + description: successful operation + content: + application/xml: + schema: + type: array + uniqueItems: true + items: + $ref: "#/components/schemas/Pet" + application/json: + schema: + type: array + uniqueItems: true + items: + $ref: "#/components/schemas/Pet" + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + deprecated: true + "/pet/{petId}": + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: "" + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + delete: + tags: + - pet + summary: Deletes a pet + description: "" + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + "/pet/{petId}/uploadImage": + post: + tags: + - pet + summary: uploads an image + description: "" + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + security: + - petstore_auth: + - write:pets + - read:pets + /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 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Order" + description: order placed for purchasing the pet + required: true + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + "400": + description: Invalid Order + "/store/order/{order_id}": + get: + tags: + - store + summary: Find purchase order by ID + description: For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + "400": + description: Invalid ID supplied + "404": + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: 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 + "404": + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Created user object + required: true + responses: + default: + description: successful operation + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: "#/components/requestBodies/UserArray" + responses: + default: + description: successful operation + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: "#/components/requestBodies/UserArray" + responses: + default: + description: successful operation + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: "" + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + "200": + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + "400": + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + "/user/{username}": + get: + tags: + - user + summary: Get user by user name + description: "" + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/User" + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + description: Invalid username supplied + "404": + description: User not found + 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 + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + delete: + 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 + "404": + description: User not found + /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: + $ref: "#/components/requestBodies/Client" + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + security: + - api_key_query: [] + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - -efg + - (xyz) + default: -efg + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - -efg + - (xyz) + default: -efg + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - -efg + - (xyz) + default: -efg + responses: + "400": + description: Invalid request + "404": + description: Not found + post: + tags: + - fake + summary: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: /[a-z]/i + pattern_without_delimiter: + description: None + type: string + pattern: ^[A-Z].* + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + delete: + tags: + - fake + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + "400": + description: Something wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterNumber" + description: Input number as post body + responses: + "200": + description: Output number + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterNumber" + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterString" + description: Input string as post body + responses: + "200": + description: Output string + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterString" + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Input boolean as post body + responses: + "200": + description: Output boolean + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterBoolean" + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterComposite" + description: Input composite as post body + responses: + "200": + description: Output composite + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterComposite" + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + responses: + "200": + description: successful operation + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + responses: + "200": + description: successful operation + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + required: true + responses: + "200": + description: Success + /fake/create_xml_item: + post: + tags: + - fake + operationId: createXmlItem + summary: creates an XmlItem + description: this route creates an XmlItem + 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": + description: successful operation + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + /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: + content: + application/json: + schema: + $ref: "#/components/schemas/FileSchemaTestClass" + required: true + responses: + "200": + description: Success + /fake/test-query-parameters: + 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: 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: + - pet + summary: uploads an image (required) + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + security: + - petstore_auth: + - write:pets + - read:pets + /fake/{petId}/response-object-different-names: + get: + tags: + - pet + operationId: responseObjectDifferentNames + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/ResponseObjectWithDifferentFieldNames" +servers: + - url: http://petstore.swagger.io:80/v2 +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + application/xml: + schema: + $ref: "#/components/schemas/Pet" + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + schemas: + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: "#/components/schemas/Category" + name: + type: string + example: doggie + photoUrls: + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: "#/components/schemas/Tag" + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: "#/components/schemas/Animal" + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: "#/components/schemas/Animal" + - type: object + properties: + declawed: + type: boolean + BigCat: + allOf: + - $ref: "#/components/schemas/Cat" + - type: object + properties: + kind: + type: string + enum: + - lions + - tigers + - leopards + - jaguars + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: "#/components/schemas/Animal" + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + string: + type: string + pattern: /[a-z]/i + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + BigDecimal: + type: string + format: number + EnumClass: + type: string + default: -efg + enum: + - _abc + - -efg + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + 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 + outerEnum: + $ref: "#/components/schemas/OuterEnum" + AdditionalPropertiesClass: + type: object + properties: + map_string: + type: object + additionalProperties: + type: string + map_number: + type: object + additionalProperties: + type: number + map_integer: + type: object + additionalProperties: + type: integer + map_boolean: + type: object + additionalProperties: + type: boolean + map_array_integer: + type: object + additionalProperties: + type: array + items: + type: integer + map_array_anytype: + type: object + additionalProperties: + type: array + items: + type: object + map_map_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_map_anytype: + type: object + additionalProperties: + type: object + additionalProperties: + type: object + anytype_1: + type: object + anytype_2: {} + anytype_3: + type: object + properties: {} + AdditionalPropertiesString: + type: object + properties: + name: + type: string + additionalProperties: + type: string + AdditionalPropertiesInteger: + type: object + properties: + name: + type: string + additionalProperties: + type: integer + AdditionalPropertiesNumber: + type: object + properties: + name: + type: string + additionalProperties: + type: number + AdditionalPropertiesBoolean: + type: object + properties: + name: + type: string + additionalProperties: + type: boolean + AdditionalPropertiesArray: + type: object + properties: + name: + type: string + additionalProperties: + type: array + items: + type: object + AdditionalPropertiesObject: + type: object + properties: + name: + type: string + additionalProperties: + type: object + additionalProperties: + type: object + AdditionalPropertiesAnyType: + type: object + properties: + name: + type: string + additionalProperties: + type: object + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: "#/components/schemas/Animal" + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: "#/components/schemas/StringBooleanMap" + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: "#/components/schemas/ReadOnlyFirst" + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - ">=" + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + OuterEnum: + type: string + enum: + - placed + - approved + - delivered + OuterComposite: + type: object + properties: + my_number: + $ref: "#/components/schemas/OuterNumber" + my_string: + $ref: "#/components/schemas/OuterString" + my_boolean: + $ref: "#/components/schemas/OuterBoolean" + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: "#/components/schemas/File" + files: + type: array + items: + $ref: "#/components/schemas/File" + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + TypeHolderDefault: + type: object + required: + - string_item + - number_item + - integer_item + - bool_item + - array_item + properties: + string_item: + type: string + default: what + number_item: + type: number + default: 1.234 + integer_item: + type: integer + default: -2 + bool_item: + type: boolean + default: true + array_item: + type: array + items: + type: integer + default: + - 0 + - 1 + - 2 + - 3 + TypeHolderExample: + type: object + required: + - string_item + - number_item + - float_item + - integer_item + - bool_item + - array_item + properties: + string_item: + type: string + example: what + number_item: + type: number + example: 1.234 + float_item: + type: number + example: 1.234 + format: float + integer_item: + type: integer + example: -2 + bool_item: + type: boolean + example: true + array_item: + type: array + items: + type: integer + example: + - 0 + - 1 + - 2 + - 3 + XmlItem: + type: object + xml: + namespace: http://a.com/schema + prefix: pre + properties: + attribute_string: + type: string + example: string + xml: + attribute: true + attribute_number: + type: number + example: 1.234 + xml: + attribute: true + attribute_integer: + type: integer + example: -2 + xml: + attribute: true + attribute_boolean: + type: boolean + example: true + xml: + attribute: true + wrapped_array: + type: array + xml: + wrapped: true + items: + type: integer + name_string: + type: string + example: string + xml: + name: xml_name_string + name_number: + type: number + example: 1.234 + xml: + name: xml_name_number + name_integer: + type: integer + example: -2 + xml: + name: xml_name_integer + name_boolean: + type: boolean + example: true + xml: + name: xml_name_boolean + name_array: + type: array + items: + type: integer + xml: + name: xml_name_array_item + name_wrapped_array: + type: array + xml: + wrapped: true + name: xml_name_wrapped_array + items: + type: integer + xml: + name: xml_name_wrapped_array_item + prefix_string: + type: string + example: string + xml: + prefix: ab + prefix_number: + type: number + example: 1.234 + xml: + prefix: cd + prefix_integer: + type: integer + example: -2 + xml: + prefix: ef + prefix_boolean: + type: boolean + example: true + xml: + prefix: gh + prefix_array: + type: array + items: + type: integer + xml: + prefix: ij + prefix_wrapped_array: + type: array + xml: + wrapped: true + prefix: kl + items: + type: integer + xml: + prefix: mn + namespace_string: + type: string + example: string + xml: + namespace: http://a.com/schema + namespace_number: + type: number + example: 1.234 + xml: + namespace: http://b.com/schema + namespace_integer: + type: integer + example: -2 + xml: + namespace: http://c.com/schema + namespace_boolean: + type: boolean + example: true + xml: + namespace: http://d.com/schema + namespace_array: + type: array + items: + type: integer + xml: + namespace: http://e.com/schema + namespace_wrapped_array: + type: array + xml: + wrapped: true + namespace: http://f.com/schema + items: + type: integer + xml: + namespace: http://g.com/schema + prefix_ns_string: + type: string + example: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + type: number + example: 1.234 + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + type: integer + example: -2 + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + type: boolean + example: true + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + type: array + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + prefix_ns_wrapped_array: + type: array + xml: + wrapped: true + namespace: http://f.com/schema + prefix: f + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + _special_model.name_: + properties: + "$special[property.name]": + type: integer + format: int64 + xml: + name: $special[model.name] + ContainerDefaultValue: + type: object + required: + - required_array + - nullable_required_array + properties: + nullable_array: + type: array + nullable: true + items: + type: string + nullable_required_array: + type: array + nullable: true + items: + type: string + required_array: + type: array + nullable: false + items: + type: string + nullable_array_with_default: + type: array + nullable: true + items: + type: string + default: ["foo", "bar"] + ResponseObjectWithDifferentFieldNames: + type: object + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-pageable.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-pageable.yaml new file mode 100644 index 00000000000..bd045d28262 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-pageable.yaml @@ -0,0 +1,733 @@ +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 + version: 1.0.0 +servers: +- url: http://petstore.swagger.io/v2 +tags: +- name: pet + description: Everything about your Pets +- name: store + description: Access to Petstore orders +- name: user + description: Operations about user +paths: + /pet: + put: + tags: + - pet + summary: Update an existing pet + operationId: updatePet + requestBody: + description: Pet object that needs to be added to the store + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + required: true + responses: + 400: + description: Invalid ID supplied + content: {} + 404: + description: Pet not found + content: {} + 405: + description: Validation exception + content: {} + security: + - petstore_auth: + - write:pets + - read:pets + x-codegen-request-body-name: body + post: + tags: + - pet + summary: Add a new pet to the store + operationId: addPet + requestBody: + description: Pet object that needs to be added to the store + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + required: true + responses: + 405: + description: Invalid input + content: {} + security: + - petstore_auth: + - write:pets + - read:pets + x-codegen-request-body-name: body + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + default: available + enum: + - available + - pending + - sold + responses: + 200: + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + 400: + description: Invalid status value + content: {} + security: + - petstore_auth: + - write:pets + - read:pets + x-spring-paginated: true + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + 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 + schema: + type: array + items: + type: string + responses: + 200: + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + 400: + description: Invalid tag value + content: {} + deprecated: true + security: + - petstore_auth: + - write:pets + - read:pets + x-spring-paginated: true + /pet/{petId}: + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + 200: + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + 400: + description: Invalid ID supplied + content: {} + 404: + description: Pet not found + content: {} + security: + - api_key: [] + 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 + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + type: string + description: Updated name of the pet + status: + type: string + description: Updated status of the pet + responses: + 405: + description: Invalid input + content: {} + security: + - petstore_auth: + - write:pets + - read:pets + delete: + tags: + - pet + summary: Deletes a pet + operationId: deletePet + parameters: + - name: api_key + in: header + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + 400: + description: Invalid pet value + content: {} + security: + - petstore_auth: + - write:pets + - read:pets + /pet/{petId}/uploadImage: + post: + tags: + - pet + summary: uploads an image + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + type: string + description: Additional data to pass to server + file: + type: string + description: file to upload + format: binary + responses: + 200: + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - write:pets + - read:pets + /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 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + operationId: placeOrder + requestBody: + description: order placed for purchasing the pet + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + required: true + responses: + 200: + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + 400: + description: Invalid Order + content: {} + x-codegen-request-body-name: body + /store/order/{orderId}: + get: + tags: + - store + summary: Find purchase order by ID + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + maximum: 5 + minimum: 1 + type: integer + format: int64 + responses: + 200: + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + 400: + description: Invalid ID supplied + content: {} + 404: + description: Order not found + content: {} + delete: + tags: + - store + summary: Delete purchase order by ID + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + 400: + description: Invalid ID supplied + content: {} + 404: + description: Order not found + content: {} + /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: + $ref: '#/components/schemas/User' + required: true + responses: + default: + description: successful operation + content: {} + x-codegen-request-body-name: body + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + operationId: createUsersWithArrayInput + requestBody: + description: List of user object + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/User' + required: true + responses: + default: + description: successful operation + content: {} + x-codegen-request-body-name: body + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + operationId: createUsersWithListInput + requestBody: + description: List of user object + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/User' + required: true + responses: + default: + description: successful operation + content: {} + x-codegen-request-body-name: body + /user/login: + get: + tags: + - user + summary: Logs user into the system + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + 200: + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + 400: + description: Invalid username/password supplied + content: {} + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + operationId: logoutUser + responses: + default: + description: successful operation + content: {} + options: + tags: + - user + summary: logoutUserOptions + operationId: logoutUserOptions + responses: + default: + description: endpoint configuration response + content: {} + /user/{username}: + get: + tags: + - user + summary: Get user by user name + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + 200: + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + 400: + description: Invalid username supplied + content: {} + 404: + description: User not found + content: {} + 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 + required: true + schema: + type: string + requestBody: + description: Updated user object + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + required: true + responses: + 400: + description: Invalid user supplied + content: {} + 404: + description: User not found + content: {} + x-codegen-request-body-name: body + delete: + 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: {} +components: + schemas: + Order: + title: Pet Order + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + description: An order for a pets from the pet store + xml: + name: Order + Category: + title: Pet category + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + description: A category for a pet + xml: + name: Category + User: + title: a User + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + description: User Status + format: int32 + description: A User who is purchasing from the pet store + xml: + name: User + Tag: + title: Pet Tag + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + description: A tag for a pet + xml: + name: Tag + Pet: + title: a Pet + required: + - name + - photoUrls + type: object + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + description: A pet for sale in the pet store + xml: + name: Pet + ApiResponse: + title: An uploaded response + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + description: Describes the result of uploading an image resource + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + api_key: + type: apiKey + name: api_key + in: header + diff --git a/modules/openapi-generator/src/test/resources/3_0/unsigned-test.yaml b/modules/openapi-generator/src/test/resources/3_0/unsigned-test.yaml new file mode 100644 index 00000000000..2c7073528db --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/unsigned-test.yaml @@ -0,0 +1,176 @@ +openapi: 3.0.0 +info: + 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: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_variable + description: The local server without variables +components: + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + multipleOf: 2 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + unsigned_integer: + type: integer + format: int32 + maximum: 200 + minimum: 20 + x-unsigned: true + int64: + type: integer + format: int64 + unsigned_long: + type: integer + format: int64 + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + type: number + multipleOf: 32.5 + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + example: '2020-02-02' + dateTime: + type: string + format: date-time + example: '2007-12-03T10:15:30+01:00' + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_11537.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_11537.yaml new file mode 100644 index 00000000000..64ecabc390d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_11537.yaml @@ -0,0 +1,44 @@ +openapi: 3.0.1 +info: + title: metadata-svc + description: Metadata Service + contact: + name: Test Svc + email: xyz@xyz.com + version: 3.1.2 +servers: +- url: https://localhost:8080/ +tags: +- name: metadata + description: APIs to get metadata. +paths: + /v1/a-path: + get: + tags: + - metadata + summary: A generic getter operation. + description: Get something from somewhere. + operationId: getSomething + responses: + 200: + description: List of groups. + content: + application/json: + schema: + type: array + items: + type: string + /v1/another-path: + post: + tags: + - metadata + summary: Insert something. + description: Insert something somewhere. + operationId: putSomething + responses: + 201: + description: List of groups. + content: + application/json: + schema: + type: string diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_13150.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_13150.yaml new file mode 100644 index 00000000000..07ee407b37e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_13150.yaml @@ -0,0 +1,60 @@ +openapi: '3.0.0' +info: + version: '1.0.0' + title: 'FooService' +paths: + /parent: + put: + summary: put parent + operationId: putParent + parameters: + - name: name + in: path + required: true + description: Name of the account being updated. + schema: + type: string + requestBody: + description: The updated account definition to save. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Parent' + responses: + '200': + $ref: '#/components/responses/Parent' +components: + schemas: + Parent: + type: object + description: Defines an account by name. + properties: + name: + type: string + description: The account name. + type: + type: string + description: The account type discriminator. + required: + - name + - type + discriminator: + propertyName: type + mapping: + foo: '#/components/schemas/Foo' + + Foo: + allOf: + - $ref: "#/components/schemas/Parent" + - type: object + properties: + fooType: + type: string + responses: + Parent: + description: The saved account definition. + content: + application/json: + schema: + $ref: '#/components/schemas/Parent' \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_14907.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_14907.yaml new file mode 100644 index 00000000000..9222f2afccc --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_14907.yaml @@ -0,0 +1,54 @@ +openapi: 3.0.1 +info: + title: TEST + description: |- + ## TEST + version: 1.0.0 + +servers: + - url: /v3 + description: Major version of service + +tags: + - name: consent-controller + description: Consent API + + +paths: + /agreements: + parameters: + - $ref: '#/components/parameters/x-client-ismobile' + get: + tags: + - consent-controller + operationId: readAgreements + responses: + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/ListResponseResponseAgreement' +components: + schemas: + ResponseAgreement: + type: object + properties: + agreementId: + type: string + ListResponseResponseAgreement: + type: object + properties: + list: + type: array + items: + $ref: '#/components/schemas/ResponseAgreement' + parameters: + x-client-ismobile: + name: x-client-ismobile + in: header + description: | + blabla + schema: + type: boolean + required: false \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_14917.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_14917.yaml new file mode 100644 index 00000000000..97ea40cac49 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_14917.yaml @@ -0,0 +1,66 @@ +openapi: 3.0.0 +info: + title: test + description: >- + test schema + version: 1.0.0 +servers: + - url: 'http://test.com' + description: stage +paths: + /demo: + get: + summary: placeholder summary + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' +components: + schemas: + AllPets: + type: object + properties: + pets: + type: array + items: + $ref: '#/components/schemas/Pet' + Pet: + type: object + required: + - petType + properties: + petType: + type: string + discriminator: + propertyName: petType + mapping: + cat: '#/components/schemas/Cat' + dog: '#/components/schemas/Dog' + lizard: '#/components/schemas/Lizard' + Cat: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + # all other properties specific to a `Cat` + properties: + name: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + # all other properties specific to a `Dog` + properties: + bark: + type: string + Lizard: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + # all other properties specific to a `Lizard` + properties: + lovesRocks: + type: boolean diff --git a/modules/openapi-generator/src/test/resources/logback.xml b/modules/openapi-generator/src/test/resources/logback.xml new file mode 100644 index 00000000000..dc582c2c8c6 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/logback.xml @@ -0,0 +1,11 @@ + + + + [%thread] %-5level %logger - %msg%n + + + + + + + diff --git a/openapi-generator.code-workspace b/openapi-generator.code-workspace index 94b0864b5d8..e94e7c5c3eb 100644 --- a/openapi-generator.code-workspace +++ b/openapi-generator.code-workspace @@ -1,78 +1,85 @@ { - "folders": [ - { - "name": "openapi-generator", - "path": "." - }, - { - "name": "openapi-generator-cli", - "path": "modules/openapi-generator-cli" - }, - { - "name": "openapi-generator-core", - "path": "modules/openapi-generator-core" - }, - { - "name": "openapi-generator-gradle-plugin", - "path": "modules/openapi-generator-gradle-plugin" - }, - { - "name": "openapi-generator-maven-plugin", - "path": "modules/openapi-generator-maven-plugin" - }, - { - "name": "openapi-generator-online", - "path": "modules/openapi-generator-online" - }, - ], - "settings": { - "editor.formatOnType": true, - "editor.linkedEditing": true, - "editor.tabCompletion": "on", - "editor.tabSize": 4, - "editor.renderWhitespace": "boundary", - "editor.suggest.shareSuggestSelections": true, - "editor.suggestSelection": "first", - "editor.semanticHighlighting.enabled": true, - "explorer.confirmDelete": true, - - "files.autoSave": "onFocusChange", - "files.exclude": { - "**/.classpath": true, - "**/.factorypath": true, - "**/.project": true, - "**/.settings": true - }, - "files.trimFinalNewlines": false, - "files.trimTrailingWhitespace": true, - - "task.saveBeforeRun": "always", - - "java.autobuild.enabled": false, - "java.completion.enabled": true, - "java.completion.guessMethodArguments": true, - "java.completion.maxResults": 5, - "java.format.onType.enabled": true, - - "java.referencesCodeLens.enabled": true, - "java.saveActions.organizeImports": true, - "java.showBuildStatusOnStart.enabled": true, - - "java.dependency.autoRefresh": true, - "java.dependency.refreshDelay": 3000, - "java.format.enabled": true, - - "maven.pomfile.autoUpdateEffectivePOM": true, - }, - "extensions": { - "recommendations": [ - "vscjava.vscode-java-pack", - "attilabuti.mustache-syntax-vscode", - "formulahendry.code-runner", - "visualstudioexptteam.vscodeintellicode", - "42crunch.vscode-openapi", - "mermade.openapi-lint" - - ] - } -} \ No newline at end of file + "folders": [ + { + "name": "openapi-generator", + "path": "." + }, + { + "name": "openapi-generator-cli", + "path": "modules/openapi-generator-cli" + }, + { + "name": "openapi-generator-core", + "path": "modules/openapi-generator-core" + }, + { + "name": "openapi-generator-gradle-plugin", + "path": "modules/openapi-generator-gradle-plugin" + }, + { + "name": "openapi-generator-maven-plugin", + "path": "modules/openapi-generator-maven-plugin" + }, + { + "name": "openapi-generator-online", + "path": "modules/openapi-generator-online" + } + ], + "settings": { + "editor.formatOnType": true, + "editor.linkedEditing": true, + "editor.tabCompletion": "on", + "editor.tabSize": 4, + "editor.renderWhitespace": "boundary", + "editor.suggest.shareSuggestSelections": true, + "editor.suggestSelection": "first", + "editor.semanticHighlighting.enabled": true, + "explorer.confirmDelete": true, + "files.autoSave": "onFocusChange", + "files.exclude": { + "**/.classpath": true, + "**/.factorypath": true, + "**/.project": true, + "**/.settings": true, + "modules/openapi-generator-cli": true, + "modules/openapi-generator-core": true, + "modules/openapi-generator-gradle-plugin": true, + "modules/openapi-generator-maven-plugin": true, + "modules/openapi-generator-online": true, + }, + "files.trimFinalNewlines": false, + "files.trimTrailingWhitespace": true, + "task.saveBeforeRun": "always", + "java.autobuild.enabled": false, + "java.completion.enabled": true, + "java.completion.guessMethodArguments": true, + "java.completion.maxResults": 5, + "java.format.onType.enabled": true, + "java.referencesCodeLens.enabled": true, + "java.saveActions.organizeImports": true, + "java.showBuildStatusOnStart.enabled": true, + "java.dependency.autoRefresh": true, + "java.dependency.refreshDelay": 3000, + "java.format.enabled": true, + "java.configuration.updateBuildConfiguration": "disabled", + "maven.pomfile.autoUpdateEffectivePOM": true, + "maven.excludedFolders": [ + "**/.*", + "**/node_modules", + "**/target", + "**/bin", + "**/archetype-resources", + "samples" + ] + }, + "extensions": { + "recommendations": [ + "vscjava.vscode-java-pack", + "attilabuti.mustache-syntax-vscode", + "formulahendry.code-runner", + "visualstudioexptteam.vscodeintellicode", + "42crunch.vscode-openapi", + "mermade.openapi-lint" + ] + } +} diff --git a/pom.xml b/pom.xml index e781aa6e1f9..c40cb2e7998 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,11 @@ - + + org.sonatype.oss oss-parent 5 - + + 4.0.0 org.openapitools diff --git a/samples/client/echo_api/java/apache-httpclient/.openapi-generator/FILES b/samples/client/echo_api/java/apache-httpclient/.openapi-generator/FILES index b73ae3b78e7..89fac5b44a4 100644 --- a/samples/client/echo_api/java/apache-httpclient/.openapi-generator/FILES +++ b/samples/client/echo_api/java/apache-httpclient/.openapi-generator/FILES @@ -13,6 +13,7 @@ docs/DataQueryAllOf.md docs/DefaultValue.md docs/FormApi.md docs/HeaderApi.md +docs/NumberPropertiesOnly.md docs/PathApi.md docs/Pet.md docs/Query.md @@ -53,6 +54,7 @@ src/main/java/org/openapitools/client/model/Category.java src/main/java/org/openapitools/client/model/DataQuery.java src/main/java/org/openapitools/client/model/DataQueryAllOf.java src/main/java/org/openapitools/client/model/DefaultValue.java +src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Query.java src/main/java/org/openapitools/client/model/StringEnumRef.java diff --git a/samples/client/echo_api/java/apache-httpclient/README.md b/samples/client/echo_api/java/apache-httpclient/README.md index 260ee85a4bd..23a54dd12af 100644 --- a/samples/client/echo_api/java/apache-httpclient/README.md +++ b/samples/client/echo_api/java/apache-httpclient/README.md @@ -84,12 +84,11 @@ public class BodyApiExample { defaultClient.setBasePath("http://localhost:3000"); BodyApi apiInstance = new BodyApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.testEchoBodyPet(pet); + File result = apiInstance.testBinaryGif(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling BodyApi#testEchoBodyPet"); + System.err.println("Exception when calling BodyApi#testBinaryGif"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -106,6 +105,7 @@ All URIs are relative to *http://localhost:3000* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body *BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) *BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body *FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) @@ -127,6 +127,7 @@ Class | Method | HTTP request | Description - [DataQuery](docs/DataQuery.md) - [DataQueryAllOf](docs/DataQueryAllOf.md) - [DefaultValue](docs/DefaultValue.md) + - [NumberPropertiesOnly](docs/NumberPropertiesOnly.md) - [Pet](docs/Pet.md) - [Query](docs/Query.md) - [StringEnumRef](docs/StringEnumRef.md) diff --git a/samples/client/echo_api/java/apache-httpclient/api/openapi.yaml b/samples/client/echo_api/java/apache-httpclient/api/openapi.yaml index 776a22706c7..e786a332be0 100644 --- a/samples/client/echo_api/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/echo_api/java/apache-httpclient/api/openapi.yaml @@ -326,6 +326,22 @@ paths: - body x-content-type: application/json x-accepts: text/plain + /binary/gif: + post: + description: Test binary (gif) response body + operationId: test/binary/gif + responses: + "200": + content: + image/gif: + schema: + format: binary + type: string + description: Successful operation + summary: Test binary (gif) response body + tags: + - body + x-accepts: image/gif components: requestBodies: Pet: @@ -505,6 +521,19 @@ components: allOf: - $ref: '#/components/schemas/DataQuery_allOf' - $ref: '#/components/schemas/Query' + NumberPropertiesOnly: + properties: + number: + type: number + float: + format: float + type: number + double: + format: double + maximum: 50.2 + minimum: 0.8 + type: number + type: object test_form_integer_boolean_string_request: properties: integer_form: diff --git a/samples/client/echo_api/java/apache-httpclient/docs/BodyApi.md b/samples/client/echo_api/java/apache-httpclient/docs/BodyApi.md index a52e813762f..d32f0b77ce5 100644 --- a/samples/client/echo_api/java/apache-httpclient/docs/BodyApi.md +++ b/samples/client/echo_api/java/apache-httpclient/docs/BodyApi.md @@ -4,11 +4,74 @@ All URIs are relative to *http://localhost:3000* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body | | [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) | | [**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body | +## testBinaryGif + +> File testBinaryGif() + +Test binary (gif) response body + +Test binary (gif) response body + +### 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.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + try { + File result = apiInstance.testBinaryGif(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testBinaryGif"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**File**](File.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: image/gif + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + ## testEchoBodyPet > Pet testEchoBodyPet(pet) diff --git a/samples/client/echo_api/java/apache-httpclient/docs/NumberPropertiesOnly.md b/samples/client/echo_api/java/apache-httpclient/docs/NumberPropertiesOnly.md new file mode 100644 index 00000000000..7e153538475 --- /dev/null +++ b/samples/client/echo_api/java/apache-httpclient/docs/NumberPropertiesOnly.md @@ -0,0 +1,15 @@ + + +# NumberPropertiesOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**number** | **BigDecimal** | | [optional] | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | + + + diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 3d8794d49af..1f9408a4110 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; +import org.openapitools.jackson.nullable.JsonNullableModule; import org.apache.hc.client5.http.cookie.BasicCookieStore; import org.apache.hc.client5.http.cookie.Cookie; @@ -116,6 +117,7 @@ public class ApiClient extends JavaTimeFormatter { objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); objectMapper.registerModule(new JavaTimeModule()); + objectMapper.registerModule(new JsonNullableModule()); objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/BodyApi.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/BodyApi.java index b06c9baf402..dd7df526dad 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/BodyApi.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/BodyApi.java @@ -20,10 +20,12 @@ import org.openapitools.client.Configuration; import org.openapitools.client.model.*; import org.openapitools.client.Pair; +import java.io.File; import org.openapitools.client.model.Pet; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,6 +33,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BodyApi { + + private ApiClient apiClient; public BodyApi() { @@ -49,6 +53,73 @@ public class BodyApi { this.apiClient = apiClient; } + /** + * Test binary (gif) response body + * Test binary (gif) response body + * @return File + * @throws ApiException if fails to make API call + */ + public File testBinaryGif() throws ApiException { + return this.testBinaryGif(Collections.emptyMap()); + } + + + /** + * Test binary (gif) response body + * Test binary (gif) response body + * @param additionalHeaders additionalHeaders for this call + * @return File + * @throws ApiException if fails to make API call + */ + public File testBinaryGif(Map additionalHeaders) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/binary/gif"; + + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + localVarHeaderParams.putAll(additionalHeaders); + + + + final String[] localVarAccepts = { + "image/gif" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + TypeReference localVarReturnType = new TypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType + ); + } + /** * Test body parameter(s) * Test body parameter(s) @@ -57,6 +128,19 @@ public class BodyApi { * @throws ApiException if fails to make API call */ public Pet testEchoBodyPet(Pet pet) throws ApiException { + return this.testEchoBodyPet(pet, Collections.emptyMap()); + } + + + /** + * Test body parameter(s) + * Test body parameter(s) + * @param pet Pet object that needs to be added to the store (optional) + * @param additionalHeaders additionalHeaders for this call + * @return Pet + * @throws ApiException if fails to make API call + */ + public Pet testEchoBodyPet(Pet pet, Map additionalHeaders) throws ApiException { Object localVarPostBody = pet; // create path and map variables @@ -71,6 +155,8 @@ public class BodyApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -102,6 +188,7 @@ public class BodyApi { localVarReturnType ); } + /** * Test empty response body * Test empty response body @@ -110,6 +197,19 @@ public class BodyApi { * @throws ApiException if fails to make API call */ public String testEchoBodyPetResponseString(Pet pet) throws ApiException { + return this.testEchoBodyPetResponseString(pet, Collections.emptyMap()); + } + + + /** + * Test empty response body + * Test empty response body + * @param pet Pet object that needs to be added to the store (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testEchoBodyPetResponseString(Pet pet, Map additionalHeaders) throws ApiException { Object localVarPostBody = pet; // create path and map variables @@ -124,6 +224,8 @@ public class BodyApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -155,4 +257,5 @@ public class BodyApi { localVarReturnType ); } + } diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/FormApi.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/FormApi.java index 44c4e489d94..225a63dbe45 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/FormApi.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/FormApi.java @@ -23,6 +23,7 @@ import org.openapitools.client.Pair; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,6 +31,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormApi { + + private ApiClient apiClient; public FormApi() { @@ -58,6 +61,21 @@ public class FormApi { * @throws ApiException if fails to make API call */ public String testFormIntegerBooleanString(Integer integerForm, Boolean booleanForm, String stringForm) throws ApiException { + return this.testFormIntegerBooleanString(integerForm, booleanForm, stringForm, Collections.emptyMap()); + } + + + /** + * Test form parameter(s) + * Test form parameter(s) + * @param integerForm (optional) + * @param booleanForm (optional) + * @param stringForm (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testFormIntegerBooleanString(Integer integerForm, Boolean booleanForm, String stringForm, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -72,6 +90,8 @@ public class FormApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + if (integerForm != null) localVarFormParams.put("integer_form", integerForm); @@ -109,4 +129,5 @@ if (stringForm != null) localVarReturnType ); } + } diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/HeaderApi.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/HeaderApi.java index facce1078e4..4a3d6233dee 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/HeaderApi.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/HeaderApi.java @@ -23,6 +23,7 @@ import org.openapitools.client.Pair; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,6 +31,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HeaderApi { + + private ApiClient apiClient; public HeaderApi() { @@ -58,6 +61,21 @@ public class HeaderApi { * @throws ApiException if fails to make API call */ public String testHeaderIntegerBooleanString(Integer integerHeader, Boolean booleanHeader, String stringHeader) throws ApiException { + return this.testHeaderIntegerBooleanString(integerHeader, booleanHeader, stringHeader, Collections.emptyMap()); + } + + + /** + * Test header parameter(s) + * Test header parameter(s) + * @param integerHeader (optional) + * @param booleanHeader (optional) + * @param stringHeader (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testHeaderIntegerBooleanString(Integer integerHeader, Boolean booleanHeader, String stringHeader, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -78,6 +96,8 @@ if (booleanHeader != null) if (stringHeader != null) localVarHeaderParams.put("string_header", apiClient.parameterToString(stringHeader)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -109,4 +129,5 @@ if (stringHeader != null) localVarReturnType ); } + } diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/PathApi.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/PathApi.java index 6f3e8b5fcfa..1b3cd28298c 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/PathApi.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/PathApi.java @@ -23,6 +23,7 @@ import org.openapitools.client.Pair; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,6 +31,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class PathApi { + + private ApiClient apiClient; public PathApi() { @@ -57,6 +60,20 @@ public class PathApi { * @throws ApiException if fails to make API call */ public String testsPathStringPathStringIntegerPathInteger(String pathString, Integer pathInteger) throws ApiException { + return this.testsPathStringPathStringIntegerPathInteger(pathString, pathInteger, Collections.emptyMap()); + } + + + /** + * Test path parameter(s) + * Test path parameter(s) + * @param pathString (required) + * @param pathInteger (required) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testsPathStringPathStringIntegerPathInteger(String pathString, Integer pathInteger, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'pathString' is set @@ -83,6 +100,8 @@ public class PathApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -114,4 +133,5 @@ public class PathApi { localVarReturnType ); } + } diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/QueryApi.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/QueryApi.java index 38b936ab5fa..443721f30d1 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/QueryApi.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/api/QueryApi.java @@ -29,6 +29,7 @@ import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQue import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,6 +37,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class QueryApi { + + private ApiClient apiClient; public QueryApi() { @@ -64,6 +67,21 @@ public class QueryApi { * @throws ApiException if fails to make API call */ public String testQueryDatetimeDateString(OffsetDateTime datetimeQuery, LocalDate dateQuery, String stringQuery) throws ApiException { + return this.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery, Collections.emptyMap()); + } + + + /** + * Test query parameter(s) + * Test query parameter(s) + * @param datetimeQuery (optional) + * @param dateQuery (optional) + * @param stringQuery (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testQueryDatetimeDateString(OffsetDateTime datetimeQuery, LocalDate dateQuery, String stringQuery, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -81,6 +99,8 @@ public class QueryApi { localVarQueryParams.addAll(apiClient.parameterToPair("date_query", dateQuery)); localVarQueryParams.addAll(apiClient.parameterToPair("string_query", stringQuery)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -112,6 +132,7 @@ public class QueryApi { localVarReturnType ); } + /** * Test query parameter(s) * Test query parameter(s) @@ -122,6 +143,21 @@ public class QueryApi { * @throws ApiException if fails to make API call */ public String testQueryIntegerBooleanString(Integer integerQuery, Boolean booleanQuery, String stringQuery) throws ApiException { + return this.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery, Collections.emptyMap()); + } + + + /** + * Test query parameter(s) + * Test query parameter(s) + * @param integerQuery (optional) + * @param booleanQuery (optional) + * @param stringQuery (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testQueryIntegerBooleanString(Integer integerQuery, Boolean booleanQuery, String stringQuery, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -139,6 +175,8 @@ public class QueryApi { localVarQueryParams.addAll(apiClient.parameterToPair("boolean_query", booleanQuery)); localVarQueryParams.addAll(apiClient.parameterToPair("string_query", stringQuery)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -170,6 +208,7 @@ public class QueryApi { localVarReturnType ); } + /** * Test query parameter(s) * Test query parameter(s) @@ -178,6 +217,19 @@ public class QueryApi { * @throws ApiException if fails to make API call */ public String testQueryStyleDeepObjectExplodeTrueObject(Pet queryObject) throws ApiException { + return this.testQueryStyleDeepObjectExplodeTrueObject(queryObject, Collections.emptyMap()); + } + + + /** + * Test query parameter(s) + * Test query parameter(s) + * @param queryObject (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testQueryStyleDeepObjectExplodeTrueObject(Pet queryObject, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -194,6 +246,8 @@ public class QueryApi { localVarQueryParameterBaseName = "query_object"; localVarQueryStringJoiner.add(queryObject.toUrlQueryString("query_object")); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -225,6 +279,7 @@ public class QueryApi { localVarReturnType ); } + /** * Test query parameter(s) * Test query parameter(s) @@ -233,6 +288,19 @@ public class QueryApi { * @throws ApiException if fails to make API call */ public String testQueryStyleDeepObjectExplodeTrueObjectAllOf(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject) throws ApiException { + return this.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject, Collections.emptyMap()); + } + + + /** + * Test query parameter(s) + * Test query parameter(s) + * @param queryObject (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testQueryStyleDeepObjectExplodeTrueObjectAllOf(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -249,6 +317,8 @@ public class QueryApi { localVarQueryParameterBaseName = "query_object"; localVarQueryStringJoiner.add(queryObject.toUrlQueryString("query_object")); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -280,6 +350,7 @@ public class QueryApi { localVarReturnType ); } + /** * Test query parameter(s) * Test query parameter(s) @@ -288,6 +359,19 @@ public class QueryApi { * @throws ApiException if fails to make API call */ public String testQueryStyleFormExplodeTrueArrayString(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject) throws ApiException { + return this.testQueryStyleFormExplodeTrueArrayString(queryObject, Collections.emptyMap()); + } + + + /** + * Test query parameter(s) + * Test query parameter(s) + * @param queryObject (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testQueryStyleFormExplodeTrueArrayString(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -303,6 +387,8 @@ public class QueryApi { localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "values", queryObject.getValues())); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -334,6 +420,7 @@ public class QueryApi { localVarReturnType ); } + /** * Test query parameter(s) * Test query parameter(s) @@ -342,6 +429,19 @@ public class QueryApi { * @throws ApiException if fails to make API call */ public String testQueryStyleFormExplodeTrueObject(Pet queryObject) throws ApiException { + return this.testQueryStyleFormExplodeTrueObject(queryObject, Collections.emptyMap()); + } + + + /** + * Test query parameter(s) + * Test query parameter(s) + * @param queryObject (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testQueryStyleFormExplodeTrueObject(Pet queryObject, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -362,6 +462,8 @@ public class QueryApi { localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "tags", queryObject.getTags())); localVarQueryParams.addAll(apiClient.parameterToPair("status", queryObject.getStatus())); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -393,6 +495,7 @@ public class QueryApi { localVarReturnType ); } + /** * Test query parameter(s) * Test query parameter(s) @@ -401,6 +504,19 @@ public class QueryApi { * @throws ApiException if fails to make API call */ public String testQueryStyleFormExplodeTrueObjectAllOf(DataQuery queryObject) throws ApiException { + return this.testQueryStyleFormExplodeTrueObjectAllOf(queryObject, Collections.emptyMap()); + } + + + /** + * Test query parameter(s) + * Test query parameter(s) + * @param queryObject (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String testQueryStyleFormExplodeTrueObjectAllOf(DataQuery queryObject, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -416,6 +532,8 @@ public class QueryApi { localVarQueryStringJoiner.add(queryObject.toUrlQueryString()); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -447,4 +565,5 @@ public class QueryApi { localVarReturnType ); } + } diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Bird.java index a42433b9d5c..7f0d09d152a 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Bird.java @@ -95,7 +95,6 @@ public class Bird { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java index 9d205aa629e..035fed012e7 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java @@ -95,7 +95,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQuery.java index 482cc9c3246..085e41e0beb 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQuery.java @@ -130,6 +130,17 @@ public class DataQuery extends Query { this.date = date; } + @Override + public DataQuery id(Long id) { + this.setId(id); + return this; + } + + @Override + public DataQuery outcomes(List outcomes) { + this.setOutcomes(outcomes); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQueryAllOf.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQueryAllOf.java index 971198bc355..e6992f37fe1 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQueryAllOf.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQueryAllOf.java @@ -127,7 +127,6 @@ public class DataQueryAllOf { this.date = date; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DefaultValue.java index 0cc2f5932b9..6cd5048a14d 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -98,7 +98,7 @@ public class DefaultValue { private List arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3)); public static final String JSON_PROPERTY_ARRAY_STRING = "array_string"; - private List arrayString = new ArrayList<>(); + private List arrayString; public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable"; private JsonNullable> arrayStringNullable = JsonNullable.>undefined(); @@ -407,7 +407,6 @@ public class DefaultValue { this.stringNullable = JsonNullable.of(stringNullable); } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java new file mode 100644 index 00000000000..2144ee2d79e --- /dev/null +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -0,0 +1,238 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * NumberPropertiesOnly + */ +@JsonPropertyOrder({ + NumberPropertiesOnly.JSON_PROPERTY_NUMBER, + NumberPropertiesOnly.JSON_PROPERTY_FLOAT, + NumberPropertiesOnly.JSON_PROPERTY_DOUBLE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NumberPropertiesOnly { + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public NumberPropertiesOnly() { + } + + public NumberPropertiesOnly number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public NumberPropertiesOnly _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * @return _float + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getFloat() { + return _float; + } + + + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(Float _float) { + this._float = _float; + } + + + public NumberPropertiesOnly _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 0.8 + * maximum: 50.2 + * @return _double + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getDouble() { + return _double; + } + + + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberPropertiesOnly numberPropertiesOnly = (NumberPropertiesOnly) o; + return Objects.equals(this.number, numberPropertiesOnly.number) && + Objects.equals(this._float, numberPropertiesOnly._float) && + Objects.equals(this._double, numberPropertiesOnly._double); + } + + @Override + public int hashCode() { + return Objects.hash(number, _float, _double); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberPropertiesOnly {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `number` to the URL query string + if (getNumber() != null) { + try { + joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumber()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `float` to the URL query string + if (getFloat() != null) { + try { + joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFloat()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `double` to the URL query string + if (getDouble() != null) { + try { + joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDouble()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java index ffb0408d05b..81a4be09c94 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java @@ -56,7 +56,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -269,7 +272,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Query.java index fc8dbda1c66..a548fca63ac 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Query.java @@ -142,7 +142,6 @@ public class Query { this.outcomes = outcomes; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java index 7692d8a1fc4..fa809685f7d 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java @@ -95,7 +95,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index 73f67121d01..8d5c5febdeb 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -156,7 +156,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 0e5bfd5253a..6e559d5558e 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -38,7 +38,7 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { public static final String JSON_PROPERTY_VALUES = "values"; - private List values = new ArrayList<>(); + private List values; public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() { } @@ -76,7 +76,6 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { this.values = values; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/CustomTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/CustomTest.java index 3517d1b5b95..8d85fe88e4b 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/CustomTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/CustomTest.java @@ -175,7 +175,7 @@ public class CustomTest { Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3)); Assert.assertNull(d.getArrayStringNullable()); - Assert.assertEquals(d.getArrayString().size(), 0); + Assert.assertNull(d.getArrayString()); // test addItem d.addArrayStringEnumDefaultItem(DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED); @@ -218,9 +218,9 @@ public class CustomTest { Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3)); Assert.assertNull(d.getArrayStringNullable()); - Assert.assertEquals(d.getArrayString().size(), 0); + Assert.assertNull(d.getArrayString()); - Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3],\"array_string\":[],\"array_string_nullable\":{\"present\":false},\"array_string_extension_nullable\":{\"present\":false},\"string_nullable\":{\"present\":false}}"); + Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3]}"); } @Test @@ -246,9 +246,9 @@ public class CustomTest { Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3)); Assert.assertNull(d.getArrayStringNullable()); - Assert.assertEquals(d.getArrayString().size(), 0); + Assert.assertNull(d.getArrayString()); - Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3],\"array_string\":[],\"array_string_nullable\":{\"present\":false},\"array_string_extension_nullable\":{\"present\":false},\"string_nullable\":{\"present\":false}}"); + Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3]}"); } @Test diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java new file mode 100644 index 00000000000..2d9c5b371fe --- /dev/null +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java @@ -0,0 +1,65 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * 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.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NumberPropertiesOnly + */ +public class NumberPropertiesOnlyTest { + private final NumberPropertiesOnly model = new NumberPropertiesOnly(); + + /** + * Model tests for NumberPropertiesOnly + */ + @Test + public void testNumberPropertiesOnly() { + // TODO: test NumberPropertiesOnly + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + +} diff --git a/samples/client/echo_api/java/feign-gson/.openapi-generator/FILES b/samples/client/echo_api/java/feign-gson/.openapi-generator/FILES index a45b0a1ad80..d5dbc5f00cc 100644 --- a/samples/client/echo_api/java/feign-gson/.openapi-generator/FILES +++ b/samples/client/echo_api/java/feign-gson/.openapi-generator/FILES @@ -33,6 +33,7 @@ src/main/java/org/openapitools/client/model/Category.java src/main/java/org/openapitools/client/model/DataQuery.java src/main/java/org/openapitools/client/model/DataQueryAllOf.java src/main/java/org/openapitools/client/model/DefaultValue.java +src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Query.java src/main/java/org/openapitools/client/model/StringEnumRef.java diff --git a/samples/client/echo_api/java/feign-gson/api/openapi.yaml b/samples/client/echo_api/java/feign-gson/api/openapi.yaml index 776a22706c7..e786a332be0 100644 --- a/samples/client/echo_api/java/feign-gson/api/openapi.yaml +++ b/samples/client/echo_api/java/feign-gson/api/openapi.yaml @@ -326,6 +326,22 @@ paths: - body x-content-type: application/json x-accepts: text/plain + /binary/gif: + post: + description: Test binary (gif) response body + operationId: test/binary/gif + responses: + "200": + content: + image/gif: + schema: + format: binary + type: string + description: Successful operation + summary: Test binary (gif) response body + tags: + - body + x-accepts: image/gif components: requestBodies: Pet: @@ -505,6 +521,19 @@ components: allOf: - $ref: '#/components/schemas/DataQuery_allOf' - $ref: '#/components/schemas/Query' + NumberPropertiesOnly: + properties: + number: + type: number + float: + format: float + type: number + double: + format: double + maximum: 50.2 + minimum: 0.8 + type: number + type: object test_form_integer_boolean_string_request: properties: integer_form: diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/BodyApi.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/BodyApi.java index 168667a31dc..13c3508214e 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/BodyApi.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/BodyApi.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.EncodingUtils; import org.openapitools.client.model.ApiResponse; +import java.io.File; import org.openapitools.client.model.Pet; import java.util.ArrayList; @@ -16,6 +17,31 @@ import feign.*; public interface BodyApi extends ApiClient.Api { + /** + * Test binary (gif) response body + * Test binary (gif) response body + * @return File + */ + @RequestLine("POST /binary/gif") + @Headers({ + "Accept: image/gif", + }) + File testBinaryGif(); + + /** + * Test binary (gif) response body + * Similar to testBinaryGif but it also returns the http response headers . + * Test binary (gif) response body + * @return A ApiResponse that wraps the response boyd and the http headers. + */ + @RequestLine("POST /binary/gif") + @Headers({ + "Accept: image/gif", + }) + ApiResponse testBinaryGifWithHttpInfo(); + + + /** * Test body parameter(s) * Test body parameter(s) diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Bird.java index 39ed6122578..153dd289b02 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Bird.java @@ -81,7 +81,6 @@ public class Bird { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java index 236c8190bb8..1f36213b28d 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java @@ -81,7 +81,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQuery.java index 1e0355bab78..30cc94c0abb 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQuery.java @@ -112,6 +112,17 @@ public class DataQuery extends Query { this.date = date; } + @Override + public DataQuery id(Long id) { + this.setId(id); + return this; + } + + @Override + public DataQuery outcomes(List outcomes) { + this.setOutcomes(outcomes); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQueryAllOf.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQueryAllOf.java index 08b9865487c..f915fdb2994 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQueryAllOf.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DataQueryAllOf.java @@ -108,7 +108,6 @@ public class DataQueryAllOf { this.date = date; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DefaultValue.java index df9a694da6e..f1c3658d20e 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -98,7 +98,7 @@ public class DefaultValue { public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string"; @SerializedName(SERIALIZED_NAME_ARRAY_STRING) - private List arrayString = new ArrayList<>(); + private List arrayString; public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable"; @SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE) @@ -272,6 +272,9 @@ public class DefaultValue { } public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) { + if (this.arrayStringNullable == null) { + this.arrayStringNullable = new ArrayList<>(); + } this.arrayStringNullable.add(arrayStringNullableItem); return this; } @@ -299,6 +302,9 @@ public class DefaultValue { } public DefaultValue addArrayStringExtensionNullableItem(String arrayStringExtensionNullableItem) { + if (this.arrayStringExtensionNullable == null) { + this.arrayStringExtensionNullable = new ArrayList<>(); + } this.arrayStringExtensionNullable.add(arrayStringExtensionNullableItem); return this; } @@ -340,7 +346,6 @@ public class DefaultValue { this.stringNullable = stringNullable; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java new file mode 100644 index 00000000000..acea6a62ec7 --- /dev/null +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -0,0 +1,155 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +/** + * NumberPropertiesOnly + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NumberPropertiesOnly { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_FLOAT = "float"; + @SerializedName(SERIALIZED_NAME_FLOAT) + private Float _float; + + public static final String SERIALIZED_NAME_DOUBLE = "double"; + @SerializedName(SERIALIZED_NAME_DOUBLE) + private Double _double; + + public NumberPropertiesOnly() { + } + + public NumberPropertiesOnly number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nullable + + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public NumberPropertiesOnly _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * @return _float + **/ + @javax.annotation.Nullable + + public Float getFloat() { + return _float; + } + + + public void setFloat(Float _float) { + this._float = _float; + } + + + public NumberPropertiesOnly _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 0.8 + * maximum: 50.2 + * @return _double + **/ + @javax.annotation.Nullable + + public Double getDouble() { + return _double; + } + + + public void setDouble(Double _double) { + this._double = _double; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberPropertiesOnly numberPropertiesOnly = (NumberPropertiesOnly) o; + return Objects.equals(this.number, numberPropertiesOnly.number) && + Objects.equals(this._float, numberPropertiesOnly._float) && + Objects.equals(this._double, numberPropertiesOnly._double); + } + + @Override + public int hashCode() { + return Objects.hash(number, _float, _double); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberPropertiesOnly {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java index 23b255c290d..10d2c0a288e 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -49,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -180,6 +180,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -251,7 +254,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Query.java index a8e911881cc..32e810791bd 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Query.java @@ -140,7 +140,6 @@ public class Query { this.outcomes = outcomes; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java index 7bfaa5ea05c..4e6d7ca4d9f 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java @@ -81,7 +81,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index 9dcdd8e4b93..535b6990da8 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -133,7 +133,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 845aab85423..439edcb6f4d 100644 --- a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -31,7 +31,7 @@ import java.util.List; public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) - private List values = new ArrayList<>(); + private List values; public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() { } @@ -65,7 +65,6 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { this.values = values; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java new file mode 100644 index 00000000000..715209c0e76 --- /dev/null +++ b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java @@ -0,0 +1,64 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * 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.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NumberPropertiesOnly + */ +class NumberPropertiesOnlyTest { + private final NumberPropertiesOnly model = new NumberPropertiesOnly(); + + /** + * Model tests for NumberPropertiesOnly + */ + @Test + void testNumberPropertiesOnly() { + // TODO: test NumberPropertiesOnly + } + + /** + * Test the property 'number' + */ + @Test + void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + void _doubleTest() { + // TODO: test _double + } + +} diff --git a/samples/client/echo_api/java/native/.openapi-generator/FILES b/samples/client/echo_api/java/native/.openapi-generator/FILES index 68f5fdb9b8a..231f7bb0e54 100644 --- a/samples/client/echo_api/java/native/.openapi-generator/FILES +++ b/samples/client/echo_api/java/native/.openapi-generator/FILES @@ -13,6 +13,7 @@ docs/DataQueryAllOf.md docs/DefaultValue.md docs/FormApi.md docs/HeaderApi.md +docs/NumberPropertiesOnly.md docs/PathApi.md docs/Pet.md docs/Query.md @@ -50,6 +51,7 @@ src/main/java/org/openapitools/client/model/Category.java src/main/java/org/openapitools/client/model/DataQuery.java src/main/java/org/openapitools/client/model/DataQueryAllOf.java src/main/java/org/openapitools/client/model/DefaultValue.java +src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Query.java src/main/java/org/openapitools/client/model/StringEnumRef.java diff --git a/samples/client/echo_api/java/native/README.md b/samples/client/echo_api/java/native/README.md index a49e0a8658e..d598d1a9a5b 100644 --- a/samples/client/echo_api/java/native/README.md +++ b/samples/client/echo_api/java/native/README.md @@ -83,12 +83,11 @@ public class BodyApiExample { // Configure clients using the `defaultClient` object, such as // overriding the host and port, timeout, etc. BodyApi apiInstance = new BodyApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.testEchoBodyPet(pet); + File result = apiInstance.testBinaryGif(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling BodyApi#testEchoBodyPet"); + System.err.println("Exception when calling BodyApi#testBinaryGif"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -105,6 +104,8 @@ All URIs are relative to *http://localhost:3000* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body +*BodyApi* | [**testBinaryGifWithHttpInfo**](docs/BodyApi.md#testBinaryGifWithHttpInfo) | **POST** /binary/gif | Test binary (gif) response body *BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) *BodyApi* | [**testEchoBodyPetWithHttpInfo**](docs/BodyApi.md#testEchoBodyPetWithHttpInfo) | **POST** /echo/body/Pet | Test body parameter(s) *BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body @@ -138,6 +139,7 @@ Class | Method | HTTP request | Description - [DataQuery](docs/DataQuery.md) - [DataQueryAllOf](docs/DataQueryAllOf.md) - [DefaultValue](docs/DefaultValue.md) + - [NumberPropertiesOnly](docs/NumberPropertiesOnly.md) - [Pet](docs/Pet.md) - [Query](docs/Query.md) - [StringEnumRef](docs/StringEnumRef.md) diff --git a/samples/client/echo_api/java/native/api/openapi.yaml b/samples/client/echo_api/java/native/api/openapi.yaml index 776a22706c7..e786a332be0 100644 --- a/samples/client/echo_api/java/native/api/openapi.yaml +++ b/samples/client/echo_api/java/native/api/openapi.yaml @@ -326,6 +326,22 @@ paths: - body x-content-type: application/json x-accepts: text/plain + /binary/gif: + post: + description: Test binary (gif) response body + operationId: test/binary/gif + responses: + "200": + content: + image/gif: + schema: + format: binary + type: string + description: Successful operation + summary: Test binary (gif) response body + tags: + - body + x-accepts: image/gif components: requestBodies: Pet: @@ -505,6 +521,19 @@ components: allOf: - $ref: '#/components/schemas/DataQuery_allOf' - $ref: '#/components/schemas/Query' + NumberPropertiesOnly: + properties: + number: + type: number + float: + format: float + type: number + double: + format: double + maximum: 50.2 + minimum: 0.8 + type: number + type: object test_form_integer_boolean_string_request: properties: integer_form: diff --git a/samples/client/echo_api/java/native/docs/BodyApi.md b/samples/client/echo_api/java/native/docs/BodyApi.md index b8cf9a99059..5df7d7346f0 100644 --- a/samples/client/echo_api/java/native/docs/BodyApi.md +++ b/samples/client/echo_api/java/native/docs/BodyApi.md @@ -4,6 +4,8 @@ All URIs are relative to *http://localhost:3000* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body | +| [**testBinaryGifWithHttpInfo**](BodyApi.md#testBinaryGifWithHttpInfo) | **POST** /binary/gif | Test binary (gif) response body | | [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) | | [**testEchoBodyPetWithHttpInfo**](BodyApi.md#testEchoBodyPetWithHttpInfo) | **POST** /echo/body/Pet | Test body parameter(s) | | [**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body | @@ -11,6 +13,132 @@ All URIs are relative to *http://localhost:3000* +## testBinaryGif + +> File testBinaryGif() + +Test binary (gif) response body + +Test binary (gif) response body + +### 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.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + try { + File result = apiInstance.testBinaryGif(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testBinaryGif"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**File**](File.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: image/gif + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + +## testBinaryGifWithHttpInfo + +> ApiResponse testBinaryGif testBinaryGifWithHttpInfo() + +Test binary (gif) response body + +Test binary (gif) response body + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + try { + ApiResponse response = apiInstance.testBinaryGifWithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testBinaryGif"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +ApiResponse<[**File**](File.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: image/gif + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + ## testEchoBodyPet > Pet testEchoBodyPet(pet) diff --git a/samples/client/echo_api/java/native/docs/NumberPropertiesOnly.md b/samples/client/echo_api/java/native/docs/NumberPropertiesOnly.md new file mode 100644 index 00000000000..7e153538475 --- /dev/null +++ b/samples/client/echo_api/java/native/docs/NumberPropertiesOnly.md @@ -0,0 +1,15 @@ + + +# NumberPropertiesOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**number** | **BigDecimal** | | [optional] | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | + + + diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/BodyApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/BodyApi.java index 1c6538a454e..0b3e56358ab 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/BodyApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/BodyApi.java @@ -17,6 +17,7 @@ import org.openapitools.client.ApiException; import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; +import java.io.File; import org.openapitools.client.model.Pet; import com.fasterxml.jackson.core.type.TypeReference; @@ -81,6 +82,71 @@ public class BodyApi { return operationId + " call failed with: " + statusCode + " - " + body; } + /** + * Test binary (gif) response body + * Test binary (gif) response body + * @return File + * @throws ApiException if fails to make API call + */ + public File testBinaryGif() throws ApiException { + ApiResponse localVarResponse = testBinaryGifWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * Test binary (gif) response body + * Test binary (gif) response body + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + */ + public ApiResponse testBinaryGifWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testBinaryGifRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testBinaryGif", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testBinaryGifRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/binary/gif"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "image/gif"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Test body parameter(s) * Test body parameter(s) diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/FormApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/FormApi.java index c273cca16cc..5ea2af146b2 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/FormApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/FormApi.java @@ -157,9 +157,15 @@ public class FormApi { localVarRequestBuilder.header("Accept", "text/plain"); List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("integer_form", integerForm.toString())); - formValues.add(new BasicNameValuePair("boolean_form", booleanForm.toString())); - formValues.add(new BasicNameValuePair("string_form", stringForm.toString())); + if (integerForm != null) { + formValues.add(new BasicNameValuePair("integer_form", integerForm.toString())); + } + if (booleanForm != null) { + formValues.add(new BasicNameValuePair("boolean_form", booleanForm.toString())); + } + if (stringForm != null) { + formValues.add(new BasicNameValuePair("string_form", stringForm.toString())); + } HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DataQuery.java index 23fd24cf179..f38b803dc81 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DataQuery.java @@ -129,6 +129,18 @@ public class DataQuery extends Query { } + @Override + public DataQuery id(Long id) { + this.setId(id); + return this; + } + + @Override + public DataQuery outcomes(List outcomes) { + this.setOutcomes(outcomes); + return this; + } + /** * Return true if this DataQuery object is equal to o. */ diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DefaultValue.java index fbeddeec813..7fa7eb2315b 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -100,7 +100,7 @@ public class DefaultValue { private List arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3)); public static final String JSON_PROPERTY_ARRAY_STRING = "array_string"; - private List arrayString = new ArrayList<>(); + private List arrayString; public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable"; private JsonNullable> arrayStringNullable = JsonNullable.>undefined(); @@ -121,7 +121,7 @@ public class DefaultValue { public DefaultValue addArrayStringEnumRefDefaultItem(StringEnumRef arrayStringEnumRefDefaultItem) { if (this.arrayStringEnumRefDefault == null) { - this.arrayStringEnumRefDefault = new ArrayList<>(); + this.arrayStringEnumRefDefault = new ArrayList<>(Arrays.asList(StringEnumRef.SUCCESS, StringEnumRef.FAILURE)); } this.arrayStringEnumRefDefault.add(arrayStringEnumRefDefaultItem); return this; @@ -154,7 +154,7 @@ public class DefaultValue { public DefaultValue addArrayStringEnumDefaultItem(ArrayStringEnumDefaultEnum arrayStringEnumDefaultItem) { if (this.arrayStringEnumDefault == null) { - this.arrayStringEnumDefault = new ArrayList<>(); + this.arrayStringEnumDefault = new ArrayList<>(Arrays.asList(ArrayStringEnumDefaultEnum.SUCCESS, ArrayStringEnumDefaultEnum.FAILURE)); } this.arrayStringEnumDefault.add(arrayStringEnumDefaultItem); return this; @@ -187,7 +187,7 @@ public class DefaultValue { public DefaultValue addArrayStringDefaultItem(String arrayStringDefaultItem) { if (this.arrayStringDefault == null) { - this.arrayStringDefault = new ArrayList<>(); + this.arrayStringDefault = new ArrayList<>(Arrays.asList("failure", "skipped")); } this.arrayStringDefault.add(arrayStringDefaultItem); return this; @@ -220,7 +220,7 @@ public class DefaultValue { public DefaultValue addArrayIntegerDefaultItem(Integer arrayIntegerDefaultItem) { if (this.arrayIntegerDefault == null) { - this.arrayIntegerDefault = new ArrayList<>(); + this.arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3)); } this.arrayIntegerDefault.add(arrayIntegerDefaultItem); return this; diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java new file mode 100644 index 00000000000..70403b35f42 --- /dev/null +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -0,0 +1,225 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * 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.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * NumberPropertiesOnly + */ +@JsonPropertyOrder({ + NumberPropertiesOnly.JSON_PROPERTY_NUMBER, + NumberPropertiesOnly.JSON_PROPERTY_FLOAT, + NumberPropertiesOnly.JSON_PROPERTY_DOUBLE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NumberPropertiesOnly { + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public NumberPropertiesOnly() { + } + + public NumberPropertiesOnly number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public NumberPropertiesOnly _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * @return _float + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getFloat() { + return _float; + } + + + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(Float _float) { + this._float = _float; + } + + + public NumberPropertiesOnly _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 0.8 + * maximum: 50.2 + * @return _double + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getDouble() { + return _double; + } + + + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + + /** + * Return true if this NumberPropertiesOnly object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberPropertiesOnly numberPropertiesOnly = (NumberPropertiesOnly) o; + return Objects.equals(this.number, numberPropertiesOnly.number) && + Objects.equals(this._float, numberPropertiesOnly._float) && + Objects.equals(this._double, numberPropertiesOnly._double); + } + + @Override + public int hashCode() { + return Objects.hash(number, _float, _double); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberPropertiesOnly {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `number` to the URL query string + if (getNumber() != null) { + joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `float` to the URL query string + if (getFloat() != null) { + joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `double` to the URL query string + if (getDouble() != null) { + joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Pet.java index 9eab225992f..e99220df233 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -58,7 +58,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -184,6 +184,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Query.java index 8e9d339067a..e2e340153db 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/Query.java @@ -117,7 +117,7 @@ public class Query { public Query addOutcomesItem(OutcomesEnum outcomesItem) { if (this.outcomes == null) { - this.outcomes = new ArrayList<>(); + this.outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); } this.outcomes.add(outcomesItem); return this; diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index bede74ea0ea..8acdcdb4bf6 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -39,7 +39,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { public static final String JSON_PROPERTY_VALUES = "values"; - private List values = new ArrayList<>(); + private List values; public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() { } diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/CustomTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/CustomTest.java index 16b304c998b..0ce6a0ff875 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/CustomTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/CustomTest.java @@ -168,8 +168,7 @@ public class CustomTest { Assert.assertNull(d.getArrayStringNullable()); Assert.assertNull(d.getArrayStringExtensionNullable()); - Assert.assertEquals(d.getArrayString().size(), 0); - + Assert.assertNull(d.getArrayString()); // test addItem d.addArrayStringEnumDefaultItem(DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED); @@ -212,9 +211,9 @@ public class CustomTest { Assert.assertNull(d.getArrayStringNullable()); Assert.assertNull(d.getArrayStringExtensionNullable()); - Assert.assertEquals(d.getArrayString().size(), 0); + Assert.assertNull(d.getArrayString()); - Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3],\"array_string\":[]}"); + Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3]}"); } @Test @@ -241,9 +240,9 @@ public class CustomTest { Assert.assertNull(d.getArrayStringNullable()); Assert.assertNull(d.getArrayStringExtensionNullable()); - Assert.assertEquals(d.getArrayString().size(), 0); + Assert.assertNull(d.getArrayString()); - Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3],\"array_string\":[]}"); + Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3]}"); } @Test diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java new file mode 100644 index 00000000000..2d9c5b371fe --- /dev/null +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java @@ -0,0 +1,65 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * 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.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NumberPropertiesOnly + */ +public class NumberPropertiesOnlyTest { + private final NumberPropertiesOnly model = new NumberPropertiesOnly(); + + /** + * Model tests for NumberPropertiesOnly + */ + @Test + public void testNumberPropertiesOnly() { + // TODO: test NumberPropertiesOnly + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson/.openapi-generator/FILES b/samples/client/echo_api/java/okhttp-gson/.openapi-generator/FILES index e9d00ee6961..e1eb9213fc4 100644 --- a/samples/client/echo_api/java/okhttp-gson/.openapi-generator/FILES +++ b/samples/client/echo_api/java/okhttp-gson/.openapi-generator/FILES @@ -13,6 +13,7 @@ docs/DataQueryAllOf.md docs/DefaultValue.md docs/FormApi.md docs/HeaderApi.md +docs/NumberPropertiesOnly.md docs/PathApi.md docs/Pet.md docs/Query.md @@ -58,6 +59,7 @@ src/main/java/org/openapitools/client/model/Category.java src/main/java/org/openapitools/client/model/DataQuery.java src/main/java/org/openapitools/client/model/DataQueryAllOf.java src/main/java/org/openapitools/client/model/DefaultValue.java +src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Query.java src/main/java/org/openapitools/client/model/StringEnumRef.java diff --git a/samples/client/echo_api/java/okhttp-gson/README.md b/samples/client/echo_api/java/okhttp-gson/README.md index a830f5579c8..3c82c336a97 100644 --- a/samples/client/echo_api/java/okhttp-gson/README.md +++ b/samples/client/echo_api/java/okhttp-gson/README.md @@ -91,12 +91,11 @@ public class Example { defaultClient.setBasePath("http://localhost:3000"); BodyApi apiInstance = new BodyApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.testEchoBodyPet(pet); + File result = apiInstance.testBinaryGif(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling BodyApi#testEchoBodyPet"); + System.err.println("Exception when calling BodyApi#testBinaryGif"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -113,6 +112,7 @@ All URIs are relative to *http://localhost:3000* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body *BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) *BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body *FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) @@ -134,6 +134,7 @@ Class | Method | HTTP request | Description - [DataQuery](docs/DataQuery.md) - [DataQueryAllOf](docs/DataQueryAllOf.md) - [DefaultValue](docs/DefaultValue.md) + - [NumberPropertiesOnly](docs/NumberPropertiesOnly.md) - [Pet](docs/Pet.md) - [Query](docs/Query.md) - [StringEnumRef](docs/StringEnumRef.md) diff --git a/samples/client/echo_api/java/okhttp-gson/api/openapi.yaml b/samples/client/echo_api/java/okhttp-gson/api/openapi.yaml index 776a22706c7..e786a332be0 100644 --- a/samples/client/echo_api/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/echo_api/java/okhttp-gson/api/openapi.yaml @@ -326,6 +326,22 @@ paths: - body x-content-type: application/json x-accepts: text/plain + /binary/gif: + post: + description: Test binary (gif) response body + operationId: test/binary/gif + responses: + "200": + content: + image/gif: + schema: + format: binary + type: string + description: Successful operation + summary: Test binary (gif) response body + tags: + - body + x-accepts: image/gif components: requestBodies: Pet: @@ -505,6 +521,19 @@ components: allOf: - $ref: '#/components/schemas/DataQuery_allOf' - $ref: '#/components/schemas/Query' + NumberPropertiesOnly: + properties: + number: + type: number + float: + format: float + type: number + double: + format: double + maximum: 50.2 + minimum: 0.8 + type: number + type: object test_form_integer_boolean_string_request: properties: integer_form: diff --git a/samples/client/echo_api/java/okhttp-gson/docs/BodyApi.md b/samples/client/echo_api/java/okhttp-gson/docs/BodyApi.md index e1892e21946..3211dfe5b52 100644 --- a/samples/client/echo_api/java/okhttp-gson/docs/BodyApi.md +++ b/samples/client/echo_api/java/okhttp-gson/docs/BodyApi.md @@ -4,10 +4,69 @@ All URIs are relative to *http://localhost:3000* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body | | [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) | | [**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body | + +# **testBinaryGif** +> File testBinaryGif() + +Test binary (gif) response body + +Test binary (gif) response body + +### 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.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + try { + File result = apiInstance.testBinaryGif(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testBinaryGif"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**File**](File.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/gif + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + # **testEchoBodyPet** > Pet testEchoBodyPet(pet) diff --git a/samples/client/echo_api/java/okhttp-gson/docs/NumberPropertiesOnly.md b/samples/client/echo_api/java/okhttp-gson/docs/NumberPropertiesOnly.md new file mode 100644 index 00000000000..7e153538475 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson/docs/NumberPropertiesOnly.md @@ -0,0 +1,15 @@ + + +# NumberPropertiesOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**number** | **BigDecimal** | | [optional] | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | + + + diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index 8345513ed98..36fe90437a1 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -98,6 +98,7 @@ public class JSON { gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DataQuery.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DataQueryAllOf.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DefaultValue.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NumberPropertiesOnly.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.CustomTypeAdapterFactory()); diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/api/BodyApi.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/api/BodyApi.java index 6717ac2686f..fcd4f4fca3d 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/api/BodyApi.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/api/BodyApi.java @@ -27,6 +27,7 @@ import com.google.gson.reflect.TypeToken; import java.io.IOException; +import java.io.File; import org.openapitools.client.model.Pet; import java.lang.reflect.Type; @@ -73,6 +74,119 @@ public class BodyApi { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for testBinaryGif + * @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 Successful operation -
    + */ + public okhttp3.Call testBinaryGifCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/binary/gif"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "image/gif" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testBinaryGifValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return testBinaryGifCall(_callback); + + } + + /** + * Test binary (gif) response body + * Test binary (gif) response body + * @return File + * @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 Successful operation -
    + */ + public File testBinaryGif() throws ApiException { + ApiResponse localVarResp = testBinaryGifWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Test binary (gif) response body + * Test binary (gif) response body + * @return ApiResponse<File> + * @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 Successful operation -
    + */ + public ApiResponse testBinaryGifWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = testBinaryGifValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Test binary (gif) response body (asynchronously) + * Test binary (gif) response body + * @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 Successful operation -
    + */ + public okhttp3.Call testBinaryGifAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testBinaryGifValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for testEchoBodyPet * @param pet Pet object that needs to be added to the store (optional) diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DefaultValue.java index dfdad0cadce..bf07815deb9 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -119,7 +119,7 @@ public class DefaultValue { public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string"; @SerializedName(SERIALIZED_NAME_ARRAY_STRING) - private List arrayString = new ArrayList<>(); + private List arrayString; public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable"; @SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE) @@ -293,6 +293,9 @@ public class DefaultValue { } public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) { + if (this.arrayStringNullable == null) { + this.arrayStringNullable = new ArrayList<>(); + } this.arrayStringNullable.add(arrayStringNullableItem); return this; } @@ -320,6 +323,9 @@ public class DefaultValue { } public DefaultValue addArrayStringExtensionNullableItem(String arrayStringExtensionNullableItem) { + if (this.arrayStringExtensionNullable == null) { + this.arrayStringExtensionNullable = new ArrayList<>(); + } this.arrayStringExtensionNullable.add(arrayStringExtensionNullableItem); return this; } diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java new file mode 100644 index 00000000000..5e13e669d94 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -0,0 +1,263 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NumberPropertiesOnly + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NumberPropertiesOnly { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_FLOAT = "float"; + @SerializedName(SERIALIZED_NAME_FLOAT) + private Float _float; + + public static final String SERIALIZED_NAME_DOUBLE = "double"; + @SerializedName(SERIALIZED_NAME_DOUBLE) + private Double _double; + + public NumberPropertiesOnly() { + } + + public NumberPropertiesOnly number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nullable + + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public NumberPropertiesOnly _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * @return _float + **/ + @javax.annotation.Nullable + + public Float getFloat() { + return _float; + } + + + public void setFloat(Float _float) { + this._float = _float; + } + + + public NumberPropertiesOnly _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 0.8 + * maximum: 50.2 + * @return _double + **/ + @javax.annotation.Nullable + + public Double getDouble() { + return _double; + } + + + public void setDouble(Double _double) { + this._double = _double; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberPropertiesOnly numberPropertiesOnly = (NumberPropertiesOnly) o; + return Objects.equals(this.number, numberPropertiesOnly.number) && + Objects.equals(this._float, numberPropertiesOnly._float) && + Objects.equals(this._double, numberPropertiesOnly._double); + } + + @Override + public int hashCode() { + return Objects.hash(number, _float, _double); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberPropertiesOnly {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("float"); + openapiFields.add("double"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NumberPropertiesOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NumberPropertiesOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NumberPropertiesOnly is not found in the empty JSON string", NumberPropertiesOnly.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NumberPropertiesOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberPropertiesOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NumberPropertiesOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NumberPropertiesOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NumberPropertiesOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NumberPropertiesOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NumberPropertiesOnly read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NumberPropertiesOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberPropertiesOnly + * @throws IOException if the JSON string is invalid with respect to NumberPropertiesOnly + */ + public static NumberPropertiesOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NumberPropertiesOnly.class); + } + + /** + * Convert an instance of NumberPropertiesOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java index c3aa75d476b..0dba821dc3b 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -70,7 +70,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -201,6 +201,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 3ef95c1c7bd..fc6bafdc270 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/okhttp-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -52,7 +52,7 @@ import org.openapitools.client.JSON; public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) - private List values = new ArrayList<>(); + private List values; public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() { } diff --git a/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java b/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java new file mode 100644 index 00000000000..a796ce5ce94 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java @@ -0,0 +1,65 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * 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.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NumberPropertiesOnly + */ +public class NumberPropertiesOnlyTest { + private final NumberPropertiesOnly model = new NumberPropertiesOnly(); + + /** + * Model tests for NumberPropertiesOnly + */ + @Test + public void testNumberPropertiesOnly() { + // TODO: test NumberPropertiesOnly + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + +} diff --git a/samples/client/echo_api/python-nextgen/.github/workflows/python.yml b/samples/client/echo_api/python-nextgen/.github/workflows/python.yml index 75e792da558..9c031b37f5a 100644 --- a/samples/client/echo_api/python-nextgen/.github/workflows/python.yml +++ b/samples/client/echo_api/python-nextgen/.github/workflows/python.yml @@ -15,12 +15,12 @@ jobs: matrix: python-version: ["3.7", "3.8", "3.9", "3.10"] - steps:s + steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }}s + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip @@ -34,4 +34,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest \ No newline at end of file + pytest diff --git a/samples/client/echo_api/python-nextgen/.openapi-generator/FILES b/samples/client/echo_api/python-nextgen/.openapi-generator/FILES index 134546f8564..96803d40eaf 100644 --- a/samples/client/echo_api/python-nextgen/.openapi-generator/FILES +++ b/samples/client/echo_api/python-nextgen/.openapi-generator/FILES @@ -11,6 +11,7 @@ docs/DataQueryAllOf.md docs/DefaultValue.md docs/FormApi.md docs/HeaderApi.md +docs/NumberPropertiesOnly.md docs/PathApi.md docs/Pet.md docs/Query.md @@ -36,6 +37,7 @@ openapi_client/models/category.py openapi_client/models/data_query.py openapi_client/models/data_query_all_of.py openapi_client/models/default_value.py +openapi_client/models/number_properties_only.py openapi_client/models/pet.py openapi_client/models/query.py openapi_client/models/string_enum_ref.py @@ -43,6 +45,7 @@ openapi_client/models/tag.py openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py openapi_client/rest.py +pyproject.toml requirements.txt setup.cfg setup.py diff --git a/samples/client/echo_api/python-nextgen/README.md b/samples/client/echo_api/python-nextgen/README.md index b945386e85c..fa00f83adf0 100644 --- a/samples/client/echo_api/python-nextgen/README.md +++ b/samples/client/echo_api/python-nextgen/README.md @@ -40,6 +40,10 @@ Then import the package: import openapi_client ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: @@ -64,15 +68,14 @@ configuration = openapi_client.Configuration( with openapi_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = openapi_client.BodyApi(api_client) - pet = openapi_client.Pet() # Pet | Pet object that needs to be added to the store (optional) try: - # Test body parameter(s) - api_response = api_instance.test_echo_body_pet(pet=pet) - print("The response of BodyApi->test_echo_body_pet:\n") + # Test binary (gif) response body + api_response = api_instance.test_binary_gif() + print("The response of BodyApi->test_binary_gif:\n") pprint(api_response) except ApiException as e: - print("Exception when calling BodyApi->test_echo_body_pet: %s\n" % e) + print("Exception when calling BodyApi->test_binary_gif: %s\n" % e) ``` @@ -82,6 +85,7 @@ All URIs are relative to *http://localhost:3000* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*BodyApi* | [**test_binary_gif**](docs/BodyApi.md#test_binary_gif) | **POST** /binary/gif | Test binary (gif) response body *BodyApi* | [**test_echo_body_pet**](docs/BodyApi.md#test_echo_body_pet) | **POST** /echo/body/Pet | Test body parameter(s) *BodyApi* | [**test_echo_body_pet_response_string**](docs/BodyApi.md#test_echo_body_pet_response_string) | **POST** /echo/body/Pet/response_string | Test empty response body *FormApi* | [**test_form_integer_boolean_string**](docs/FormApi.md#test_form_integer_boolean_string) | **POST** /form/integer/boolean/string | Test form parameter(s) @@ -103,6 +107,7 @@ Class | Method | HTTP request | Description - [DataQuery](docs/DataQuery.md) - [DataQueryAllOf](docs/DataQueryAllOf.md) - [DefaultValue](docs/DefaultValue.md) + - [NumberPropertiesOnly](docs/NumberPropertiesOnly.md) - [Pet](docs/Pet.md) - [Query](docs/Query.md) - [StringEnumRef](docs/StringEnumRef.md) diff --git a/samples/client/echo_api/python-nextgen/docs/BodyApi.md b/samples/client/echo_api/python-nextgen/docs/BodyApi.md index 3ca11a7e656..f0ba44f9747 100644 --- a/samples/client/echo_api/python-nextgen/docs/BodyApi.md +++ b/samples/client/echo_api/python-nextgen/docs/BodyApi.md @@ -4,10 +4,71 @@ All URIs are relative to *http://localhost:3000* Method | HTTP request | Description ------------- | ------------- | ------------- +[**test_binary_gif**](BodyApi.md#test_binary_gif) | **POST** /binary/gif | Test binary (gif) response body [**test_echo_body_pet**](BodyApi.md#test_echo_body_pet) | **POST** /echo/body/Pet | Test body parameter(s) [**test_echo_body_pet_response_string**](BodyApi.md#test_echo_body_pet_response_string) | **POST** /echo/body/Pet/response_string | Test empty response body +# **test_binary_gif** +> bytearray test_binary_gif() + +Test binary (gif) response body + +Test binary (gif) response body + +### Example + +```python +from __future__ import print_function +import time +import os +import openapi_client +from openapi_client.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:3000 +# See configuration.py for a list of all supported configuration parameters. +configuration = openapi_client.Configuration( + host = "http://localhost:3000" +) + + +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.BodyApi(api_client) + + try: + # Test binary (gif) response body + api_response = api_instance.test_binary_gif() + print("The response of BodyApi->test_binary_gif:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BodyApi->test_binary_gif: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**bytearray** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/gif + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[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_echo_body_pet** > Pet test_echo_body_pet(pet=pet) diff --git a/samples/client/echo_api/python-nextgen/docs/NumberPropertiesOnly.md b/samples/client/echo_api/python-nextgen/docs/NumberPropertiesOnly.md new file mode 100644 index 00000000000..e35fad694e7 --- /dev/null +++ b/samples/client/echo_api/python-nextgen/docs/NumberPropertiesOnly.md @@ -0,0 +1,30 @@ +# NumberPropertiesOnly + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | | [optional] +**float** | **float** | | [optional] +**double** | **float** | | [optional] + +## Example + +```python +from openapi_client.models.number_properties_only import NumberPropertiesOnly + +# TODO update the JSON string below +json = "{}" +# create an instance of NumberPropertiesOnly from a JSON string +number_properties_only_instance = NumberPropertiesOnly.from_json(json) +# print the JSON string representation of the object +print NumberPropertiesOnly.to_json() + +# convert the object into a dict +number_properties_only_dict = number_properties_only_instance.to_dict() +# create an instance of NumberPropertiesOnly from a dict +number_properties_only_form_dict = number_properties_only.from_dict(number_properties_only_dict) +``` +[[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/echo_api/python-nextgen/openapi_client/__init__.py b/samples/client/echo_api/python-nextgen/openapi_client/__init__.py index 347fdc2bf4e..56a61164ed2 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/__init__.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/__init__.py @@ -9,12 +9,12 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - __version__ = "1.0.0" # import apis into sdk package @@ -39,6 +39,7 @@ from openapi_client.models.category import Category from openapi_client.models.data_query import DataQuery from openapi_client.models.data_query_all_of import DataQueryAllOf from openapi_client.models.default_value import DefaultValue +from openapi_client.models.number_properties_only import NumberPropertiesOnly from openapi_client.models.pet import Pet from openapi_client.models.query import Query from openapi_client.models.string_enum_ref import StringEnumRef diff --git a/samples/client/echo_api/python-nextgen/openapi_client/api/__init__.py b/samples/client/echo_api/python-nextgen/openapi_client/api/__init__.py index 541b1a8999a..411eed92583 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/api/__init__.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/api/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - # flake8: noqa # import apis into api package @@ -8,3 +6,4 @@ from openapi_client.api.form_api import FormApi from openapi_client.api.header_api import HeaderApi from openapi_client.api.path_api import PathApi from openapi_client.api.query_api import QueryApi + diff --git a/samples/client/echo_api/python-nextgen/openapi_client/api/body_api.py b/samples/client/echo_api/python-nextgen/openapi_client/api/body_api.py index f9da2fd048f..facd438c83e 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/api/body_api.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/api/body_api.py @@ -7,12 +7,12 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError @@ -43,6 +43,138 @@ class BodyApi(object): api_client = ApiClient.get_default() self.api_client = api_client + @validate_arguments + def test_binary_gif(self, **kwargs) -> bytearray: # noqa: E501 + """Test binary (gif) response body # noqa: E501 + + Test binary (gif) response body # 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_binary_gif(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :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: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: bytearray + """ + kwargs['_return_http_data_only'] = True + return self.test_binary_gif_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + def test_binary_gif_with_http_info(self, **kwargs): # noqa: E501 + """Test binary (gif) response body # noqa: E501 + + Test binary (gif) response body # 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_binary_gif_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :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. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_binary_gif" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['image/gif']) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + '200': "bytearray", + } + + return self.api_client.call_api( + '/binary/gif', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments def test_echo_body_pet(self, pet : Annotated[Optional[Pet], Field(description="Pet object that needs to be added to the store")] = None, **kwargs) -> Pet: # noqa: E501 """Test body parameter(s) # noqa: E501 diff --git a/samples/client/echo_api/python-nextgen/openapi_client/api/form_api.py b/samples/client/echo_api/python-nextgen/openapi_client/api/form_api.py index 812ddd73aee..93ad860382f 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/api/form_api.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/api/form_api.py @@ -7,12 +7,12 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/client/echo_api/python-nextgen/openapi_client/api/header_api.py b/samples/client/echo_api/python-nextgen/openapi_client/api/header_api.py index 2b16c49995f..2a060aad18d 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/api/header_api.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/api/header_api.py @@ -7,12 +7,12 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/client/echo_api/python-nextgen/openapi_client/api/path_api.py b/samples/client/echo_api/python-nextgen/openapi_client/api/path_api.py index 13e1cea9b6d..9b22b402ab2 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/api/path_api.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/api/path_api.py @@ -7,12 +7,12 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/client/echo_api/python-nextgen/openapi_client/api/query_api.py b/samples/client/echo_api/python-nextgen/openapi_client/api/query_api.py index db829799766..aa4c8482613 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/api/query_api.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/api/query_api.py @@ -7,12 +7,12 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError @@ -22,7 +22,7 @@ from datetime import date, datetime from pydantic import StrictBool, StrictInt, StrictStr -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional from openapi_client.api_client import ApiClient @@ -45,7 +45,7 @@ class QueryApi(object): self.api_client = api_client @validate_arguments - def test_query_datetime_date_string(self, datetime_query : Optional[Union[StrictStr, datetime]] = None, date_query : Optional[Union[StrictStr, date]] = None, string_query : Optional[StrictStr] = None, **kwargs) -> str: # noqa: E501 + def test_query_datetime_date_string(self, datetime_query : Optional[datetime] = None, date_query : Optional[date] = None, string_query : Optional[StrictStr] = None, **kwargs) -> str: # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -80,7 +80,7 @@ class QueryApi(object): return self.test_query_datetime_date_string_with_http_info(datetime_query, date_query, string_query, **kwargs) # noqa: E501 @validate_arguments - def test_query_datetime_date_string_with_http_info(self, datetime_query : Optional[Union[StrictStr, datetime]] = None, date_query : Optional[Union[StrictStr, date]] = None, string_query : Optional[StrictStr] = None, **kwargs): # noqa: E501 + def test_query_datetime_date_string_with_http_info(self, datetime_query : Optional[datetime] = None, date_query : Optional[date] = None, string_query : Optional[StrictStr] = None, **kwargs): # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -363,7 +363,7 @@ class QueryApi(object): _request_auth=_params.get('_request_auth')) @validate_arguments - def test_query_style_deep_object_explode_true_object(self, query_object : Optional[Dict[str, Dict[str, StrictStr]]] = None, **kwargs) -> str: # noqa: E501 + def test_query_style_deep_object_explode_true_object(self, query_object : Optional[Dict[str, Dict[str, Any]]] = None, **kwargs) -> str: # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -394,7 +394,7 @@ class QueryApi(object): return self.test_query_style_deep_object_explode_true_object_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments - def test_query_style_deep_object_explode_true_object_with_http_info(self, query_object : Optional[Dict[str, Dict[str, StrictStr]]] = None, **kwargs): # noqa: E501 + def test_query_style_deep_object_explode_true_object_with_http_info(self, query_object : Optional[Dict[str, Dict[str, Any]]] = None, **kwargs): # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -643,7 +643,7 @@ class QueryApi(object): _request_auth=_params.get('_request_auth')) @validate_arguments - def test_query_style_form_explode_true_array_string(self, query_object : Optional[Dict[str, StrictStr]] = None, **kwargs) -> str: # noqa: E501 + def test_query_style_form_explode_true_array_string(self, query_object : Optional[Dict[str, Any]] = None, **kwargs) -> str: # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -674,7 +674,7 @@ class QueryApi(object): return self.test_query_style_form_explode_true_array_string_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments - def test_query_style_form_explode_true_array_string_with_http_info(self, query_object : Optional[Dict[str, StrictStr]] = None, **kwargs): # noqa: E501 + def test_query_style_form_explode_true_array_string_with_http_info(self, query_object : Optional[Dict[str, Any]] = None, **kwargs): # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -783,7 +783,7 @@ class QueryApi(object): _request_auth=_params.get('_request_auth')) @validate_arguments - def test_query_style_form_explode_true_object(self, query_object : Optional[Dict[str, StrictStr]] = None, **kwargs) -> str: # noqa: E501 + def test_query_style_form_explode_true_object(self, query_object : Optional[Dict[str, Any]] = None, **kwargs) -> str: # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -814,7 +814,7 @@ class QueryApi(object): return self.test_query_style_form_explode_true_object_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments - def test_query_style_form_explode_true_object_with_http_info(self, query_object : Optional[Dict[str, StrictStr]] = None, **kwargs): # noqa: E501 + def test_query_style_form_explode_true_object_with_http_info(self, query_object : Optional[Dict[str, Any]] = None, **kwargs): # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 diff --git a/samples/client/echo_api/python-nextgen/openapi_client/api_client.py b/samples/client/echo_api/python-nextgen/openapi_client/api_client.py index 0eb5185bc9f..e569b865ea9 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/api_client.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/api_client.py @@ -1,4 +1,5 @@ # coding: utf-8 + """ Echo Server API @@ -6,10 +7,11 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import import atexit import datetime @@ -37,10 +39,6 @@ class ApiClient(object): 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 @@ -66,7 +64,7 @@ class ApiClient(object): def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): - # use default configuraiton if none is provided + # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration @@ -231,7 +229,9 @@ class ApiClient(object): response_type = response_types_map.get(str(response_data.status), None) - if response_type not in ["file", "bytes"]: + if response_type == "bytearray": + response_data.data = response_data.data + else: match = None content_type = response_data.getheader('content-type') if content_type is not None: @@ -240,8 +240,9 @@ class ApiClient(object): response_data.data = response_data.data.decode(encoding) # deserialize response data - - if response_type: + if response_type == "bytearray": + return_data = response_data.data + elif response_type: return_data = self.deserialize(response_data, response_type) else: return_data = None diff --git a/samples/client/echo_api/python-nextgen/openapi_client/configuration.py b/samples/client/echo_api/python-nextgen/openapi_client/configuration.py index 059776291f5..9276d8f0499 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/configuration.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/configuration.py @@ -7,12 +7,12 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import copy import logging import multiprocessing @@ -22,7 +22,6 @@ import urllib3 import http.client as httplib from openapi_client.exceptions import ApiValueError - JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', @@ -30,10 +29,7 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { } class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. + """This class contains various settings of the API client. :param host: Base url. :param api_key: Dict to store API key(s). diff --git a/samples/client/echo_api/python-nextgen/openapi_client/exceptions.py b/samples/client/echo_api/python-nextgen/openapi_client/exceptions.py index 7b5a4e7446b..8851d062b9c 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/exceptions.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/exceptions.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/__init__.py b/samples/client/echo_api/python-nextgen/openapi_client/models/__init__.py index 2fa4419a3ab..2489f30be85 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/__init__.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/__init__.py @@ -8,18 +8,19 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - # import models into model package from openapi_client.models.bird import Bird from openapi_client.models.category import Category from openapi_client.models.data_query import DataQuery from openapi_client.models.data_query_all_of import DataQueryAllOf from openapi_client.models.default_value import DefaultValue +from openapi_client.models.number_properties_only import NumberPropertiesOnly from openapi_client.models.pet import Pet from openapi_client.models.query import Query from openapi_client.models.string_enum_ref import StringEnumRef diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/bird.py b/samples/client/echo_api/python-nextgen/openapi_client/models/bird.py index a1700cddc00..2f8814af624 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/bird.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/bird.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class Bird(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Bird """ size: Optional[StrictStr] = None color: Optional[StrictStr] = None diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/category.py b/samples/client/echo_api/python-nextgen/openapi_client/models/category.py index 7092d0bdc24..20e8ef180c2 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/category.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/category.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class Category(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Category """ id: Optional[StrictInt] = None name: Optional[StrictStr] = None diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/data_query.py b/samples/client/echo_api/python-nextgen/openapi_client/models/data_query.py index f086e5fb828..500a087fe75 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/data_query.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/data_query.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -23,10 +25,8 @@ from pydantic import BaseModel, Field, StrictStr from openapi_client.models.query import Query class DataQuery(Query): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DataQuery """ suffix: Optional[StrictStr] = Field(None, description="test suffix") text: Optional[StrictStr] = Field(None, description="Some text containing white spaces") diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/data_query_all_of.py b/samples/client/echo_api/python-nextgen/openapi_client/models/data_query_all_of.py index 4db37807afd..b0fcf04d3f9 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/data_query_all_of.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/data_query_all_of.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class DataQueryAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DataQueryAllOf """ suffix: Optional[StrictStr] = Field(None, description="test suffix") text: Optional[StrictStr] = Field(None, description="Some text containing white spaces") diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/default_value.py b/samples/client/echo_api/python-nextgen/openapi_client/models/default_value.py index 6ba3e69d2b9..0d54cfc46c2 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/default_value.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/default_value.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -23,10 +25,8 @@ from pydantic import BaseModel, StrictInt, StrictStr, conlist, validator from openapi_client.models.string_enum_ref import StringEnumRef class DefaultValue(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + to test the default value of properties """ array_string_enum_ref_default: Optional[conlist(StringEnumRef)] = None array_string_enum_default: Optional[conlist(StrictStr)] = None @@ -42,9 +42,9 @@ class DefaultValue(BaseModel): def array_string_enum_default_validate_enum(cls, v): if v is None: return v - - if v not in ('success', 'failure', 'unclassified'): - raise ValueError("must validate the enum values ('success', 'failure', 'unclassified')") + for i in v: + if i not in ('success', 'failure', 'unclassified'): + raise ValueError("each list item must be one of ('success', 'failure', 'unclassified')") return v class Config: @@ -71,15 +71,18 @@ class DefaultValue(BaseModel): }, exclude_none=True) # set to None if array_string_nullable (nullable) is None - if self.array_string_nullable is None: + # and __fields_set__ contains the field + if self.array_string_nullable is None and "array_string_nullable" in self.__fields_set__: _dict['array_string_nullable'] = None # set to None if array_string_extension_nullable (nullable) is None - if self.array_string_extension_nullable is None: + # and __fields_set__ contains the field + if self.array_string_extension_nullable is None and "array_string_extension_nullable" in self.__fields_set__: _dict['array_string_extension_nullable'] = None # set to None if string_nullable (nullable) is None - if self.string_nullable is None: + # and __fields_set__ contains the field + if self.string_nullable is None and "string_nullable" in self.__fields_set__: _dict['string_nullable'] = None return _dict diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/number_properties_only.py b/samples/client/echo_api/python-nextgen/openapi_client/models/number_properties_only.py new file mode 100644 index 00000000000..cd837770154 --- /dev/null +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/number_properties_only.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Echo Server API + + Echo Server API # noqa: E501 + + The version of the OpenAPI document: 0.1.0 + Contact: team@openapitools.org + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt, confloat, conint + +class NumberPropertiesOnly(BaseModel): + """ + NumberPropertiesOnly + """ + number: Optional[Union[StrictFloat, StrictInt]] = None + float: Optional[Union[StrictFloat, StrictInt]] = None + double: Optional[Union[confloat(le=50.2, ge=0.8, strict=True), conint(le=50, ge=1, strict=True)]] = None + __properties = ["number", "float", "double"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> NumberPropertiesOnly: + """Create an instance of NumberPropertiesOnly from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> NumberPropertiesOnly: + """Create an instance of NumberPropertiesOnly from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return NumberPropertiesOnly.parse_obj(obj) + + _obj = NumberPropertiesOnly.parse_obj({ + "number": obj.get("number"), + "float": obj.get("float"), + "double": obj.get("double") + }) + return _obj + diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/pet.py b/samples/client/echo_api/python-nextgen/openapi_client/models/pet.py index dffafa94de7..d34df26fa5c 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/pet.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/pet.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -24,10 +26,8 @@ from openapi_client.models.category import Category from openapi_client.models.tag import Tag class Pet(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Pet """ id: Optional[StrictInt] = None name: StrictStr = ... @@ -41,9 +41,8 @@ class Pet(BaseModel): def status_validate_enum(cls, v): if v is None: return v - if v not in ('available', 'pending', 'sold'): - raise ValueError("must validate the enum values ('available', 'pending', 'sold')") + raise ValueError("must be one of enum values ('available', 'pending', 'sold')") return v class Config: diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/query.py b/samples/client/echo_api/python-nextgen/openapi_client/models/query.py index a62d59ce9a1..531f366ed5c 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/query.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/query.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator class Query(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Query """ id: Optional[StrictInt] = Field(None, description="Query") outcomes: Optional[conlist(StrictStr)] = None @@ -35,9 +35,9 @@ class Query(BaseModel): def outcomes_validate_enum(cls, v): if v is None: return v - - if v not in ('SUCCESS', 'FAILURE', 'SKIPPED'): - raise ValueError("must validate the enum values ('SUCCESS', 'FAILURE', 'SKIPPED')") + for i in v: + if i not in ('SUCCESS', 'FAILURE', 'SKIPPED'): + raise ValueError("each list item must be one of ('SUCCESS', 'FAILURE', 'SKIPPED')") return v class Config: diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/string_enum_ref.py b/samples/client/echo_api/python-nextgen/openapi_client/models/string_enum_ref.py index 27741fc9573..e48c86fb0b3 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/string_enum_ref.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/string_enum_ref.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,16 +23,13 @@ from aenum import Enum, no_arg class StringEnumRef(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + StringEnumRef """ """ allowed enum values """ - SUCCESS = 'success' FAILURE = 'failure' UNCLASSIFIED = 'unclassified' diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/tag.py b/samples/client/echo_api/python-nextgen/openapi_client/models/tag.py index 8c187b78386..430b70f4519 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/tag.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/tag.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class Tag(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Tag """ id: Optional[StrictInt] = None name: Optional[StrictStr] = None diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py b/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py index 2a6f3271b26..e43c6fc5a81 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter """ size: Optional[StrictStr] = None color: Optional[StrictStr] = None diff --git a/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py b/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py index 955e3f61f95..f39267b5ac5 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import List, Optional from pydantic import BaseModel, StrictStr, conlist class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter """ values: Optional[conlist(StrictStr)] = None __properties = ["values"] diff --git a/samples/client/echo_api/python-nextgen/openapi_client/rest.py b/samples/client/echo_api/python-nextgen/openapi_client/rest.py index 10adb46f83e..33f0615ee10 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/rest.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/rest.py @@ -7,12 +7,12 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import io import json import logging diff --git a/samples/client/echo_api/python-nextgen/pyproject.toml b/samples/client/echo_api/python-nextgen/pyproject.toml new file mode 100644 index 00000000000..0a22d86748b --- /dev/null +++ b/samples/client/echo_api/python-nextgen/pyproject.toml @@ -0,0 +1,27 @@ +[tool.poetry] +name = "openapi_client" +version = "1.0.0" +description = "Echo Server API" +authors = ["OpenAPI Generator Community "] +license = "Apache 2.0" +readme = "README.md" +repository = "https://github.com/GIT_REPO_ID/GIT_USER_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = "^1.10.5" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + diff --git a/samples/client/echo_api/python-nextgen/requirements.txt b/samples/client/echo_api/python-nextgen/requirements.txt index b98ff3e6069..74ede174a0a 100644 --- a/samples/client/echo_api/python-nextgen/requirements.txt +++ b/samples/client/echo_api/python-nextgen/requirements.txt @@ -1,5 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.25.3 -pydantic >= 1.10.2 +pydantic >= 1.10.5, < 2 aenum >= 3.1.11 diff --git a/samples/client/echo_api/python-nextgen/setup.py b/samples/client/echo_api/python-nextgen/setup.py index 6e6629a0178..3915ce5c373 100644 --- a/samples/client/echo_api/python-nextgen/setup.py +++ b/samples/client/echo_api/python-nextgen/setup.py @@ -7,7 +7,9 @@ The version of the OpenAPI document: 0.1.0 Contact: team@openapitools.org - Generated by: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -25,7 +27,7 @@ PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3", "python-dateutil", - "pydantic", + "pydantic >= 1.10.5, < 2", "aenum" ] diff --git a/samples/client/echo_api/python-nextgen/test/test_manual.py b/samples/client/echo_api/python-nextgen/test/test_manual.py index cf4e3d122a2..506f6dc7ecd 100644 --- a/samples/client/echo_api/python-nextgen/test/test_manual.py +++ b/samples/client/echo_api/python-nextgen/test/test_manual.py @@ -14,6 +14,7 @@ from __future__ import absolute_import import unittest import datetime +import base64 import openapi_client from openapi_client.api.query_api import QueryApi # noqa: E501 @@ -51,16 +52,23 @@ class TestManual(unittest.TestCase): e = EchoServerResponseParser(api_response) self.assertEqual(e.path, "/query/datetime/date/string?datetime_query=2013-10-20T19%3A20%3A30.000000-0500&date_query=2013-10-20&string_query=string_query_example") - def testDateTimeQueryWithString(self): - api_instance = openapi_client.QueryApi() - datetime_query = '19:20:30 2013-10-20' # datetime | (optional) - date_query = '2013-10-20' # date | (optional) - string_query = 'string_query_example' # str | (optional) - - # Test query parameter(s) - api_response = api_instance.test_query_datetime_date_string(datetime_query=datetime_query, date_query=date_query, string_query=string_query) - e = EchoServerResponseParser(api_response) - self.assertEqual(e.path, "/query/datetime/date/string?datetime_query=19%3A20%3A30%202013-10-20&date_query=2013-10-20&string_query=string_query_example") + def testBinaryGif(self): + api_instance = openapi_client.BodyApi() + + # Test binary response + api_response = api_instance.test_binary_gif() + self.assertEqual((base64.b64encode(api_response)).decode("utf-8"), "R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==") + + def testNumberPropertiesOnly(self): + n = openapi_client.NumberPropertiesOnly.from_json('{"number": 123, "float": 456, "double": 34}') + self.assertEqual(n.number, 123) + self.assertEqual(n.float, 456) + self.assertEqual(n.double, 34) + + n = openapi_client.NumberPropertiesOnly.from_json('{"number": 123.1, "float": 456.2, "double": 34.3}') + self.assertEqual(n.number, 123.1) + self.assertEqual(n.float, 456.2) + self.assertEqual(n.double, 34.3) class EchoServerResponseParser(): def __init__(self, http_response): diff --git a/samples/client/echo_api/python-nextgen/test/test_number_properties_only.py b/samples/client/echo_api/python-nextgen/test/test_number_properties_only.py new file mode 100644 index 00000000000..68aa757f9df --- /dev/null +++ b/samples/client/echo_api/python-nextgen/test/test_number_properties_only.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Echo Server API + + Echo Server API # noqa: E501 + + The version of the OpenAPI document: 0.1.0 + Contact: team@openapitools.org + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +import unittest +import datetime + +import openapi_client +from openapi_client.models.number_properties_only import NumberPropertiesOnly # noqa: E501 +from openapi_client.rest import ApiException + +class TestNumberPropertiesOnly(unittest.TestCase): + """NumberPropertiesOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test NumberPropertiesOnly + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NumberPropertiesOnly` + """ + model = openapi_client.models.number_properties_only.NumberPropertiesOnly() # noqa: E501 + if include_optional : + return NumberPropertiesOnly( + number = 1.337, + float = 1.337, + double = '' + ) + else : + return NumberPropertiesOnly( + ) + """ + + def testNumberPropertiesOnly(self): + """Test NumberPropertiesOnly""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES index 4afed17cb82..fb5f0b603c3 100644 --- a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES +++ b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/MultipartApi.md docs/MultipartArrayRequest.md diff --git a/samples/client/others/csharp-netcore-complex-files/api/openapi.yaml b/samples/client/others/csharp-netcore-complex-files/api/openapi.yaml new file mode 100644 index 00000000000..ad6066f3a3b --- /dev/null +++ b/samples/client/others/csharp-netcore-complex-files/api/openapi.yaml @@ -0,0 +1,100 @@ +openapi: 3.0.1 +info: + title: MultipartFile test + version: 1.0.0 +servers: +- url: / +paths: + /multipart-array: + post: + description: MultipartFile array test + operationId: multipartArray + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/multipartArray_request' + responses: + "204": + description: Successful operation + tags: + - multipart + /multipart-single: + post: + description: Single MultipartFile test + operationId: multipartSingle + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/multipartSingle_request' + responses: + "204": + description: Successful operation + tags: + - multipart + /multipart-mixed: + post: + description: Mixed MultipartFile test + operationId: multipartMixed + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/multipartMixed_request' + responses: + "204": + description: Successful operation + tags: + - multipart +components: + schemas: + MultipartMixedStatus: + description: additional field as Enum + enum: + - ALLOWED + - IN_PROGRESS + - REJECTED + example: REJECTED + type: string + multipartArray_request: + properties: + files: + description: Many files + items: + format: binary + type: string + type: array + type: object + multipartSingle_request: + properties: + file: + description: One file + format: binary + type: string + type: object + multipartMixed_request_marker: + description: additional object + properties: + name: + type: string + type: object + multipartMixed_request: + properties: + status: + $ref: '#/components/schemas/MultipartMixedStatus' + marker: + $ref: '#/components/schemas/multipartMixed_request_marker' + file: + description: a file + format: binary + type: string + statusArray: + items: + $ref: '#/components/schemas/MultipartMixedStatus' + type: array + required: + - file + - status + type: object + diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 06b106b96d3..8baebd4ea54 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs index 29a02766057..d434ef6ec95 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs index 60083edbb16..faccc14b6b4 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartArrayRequest.cs @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs index 4e51e950886..c30d95968d9 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequest.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs index 8e708aa76d5..05fd815de56 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs index 76f7baae15e..c7872d5b83e 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartSingleRequest.cs @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 242934b6642..8d6a4b78ae0 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/samples/client/petstore/cpp-qt/.gitignore b/samples/client/petstore/cpp-qt/.gitignore new file mode 100644 index 00000000000..378eac25d31 --- /dev/null +++ b/samples/client/petstore/cpp-qt/.gitignore @@ -0,0 +1 @@ +build diff --git a/samples/client/petstore/cpp-qt/CMakeLists.txt b/samples/client/petstore/cpp-qt/CMakeLists.txt index 5fb20c83ec9..4ec3a21f490 100644 --- a/samples/client/petstore/cpp-qt/CMakeLists.txt +++ b/samples/client/petstore/cpp-qt/CMakeLists.txt @@ -1,20 +1,25 @@ cmake_minimum_required(VERSION 3.2) -project(cpp-qt5-petstore) +project(cpp-qt-petstore) set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Gui Test) + add_subdirectory(client) -find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Test) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test) -add_executable(${PROJECT_NAME} +add_executable(cpp-qt-petstore PetStore/main.cpp PetStore/PetApiTests.cpp PetStore/StoreApiTests.cpp PetStore/UserApiTests.cpp ) -target_link_libraries(${PROJECT_NAME} PRIVATE CppQtPetstoreClient Qt${QT_VERSION_MAJOR}::Test) +target_link_libraries(cpp-qt-petstore PRIVATE CppQtPetstoreClient Qt${QT_VERSION_MAJOR}::Test) + +enable_testing() + +add_test(NAME cpp-qt-petstore-test COMMAND cpp-qt-petstore) diff --git a/samples/client/petstore/cpp-qt/build-and-test.bash b/samples/client/petstore/cpp-qt/build-and-test.bash index 4104bdac1bc..9602f77ede5 100755 --- a/samples/client/petstore/cpp-qt/build-and-test.bash +++ b/samples/client/petstore/cpp-qt/build-and-test.bash @@ -8,14 +8,14 @@ cd build cmake .. -make +cmake --build . if [[ -z "${RUN_VALGRIND_TESTS}" ]]; then - echo "Running Qt5 Petstore Tests" - ./cpp-qt5-petstore + echo "Running Qt Petstore Tests" + ctest else - echo "Running Qt5 Petstore Tests with Valgrind" - valgrind --leak-check=full ./cpp-qt5-petstore |& tee result.log || exit 1 + echo "Running Qt Petstore Tests with Valgrind" + valgrind --leak-check=full ./cpp-qt-petstore |& tee result.log || exit 1 testCount=$(cat result.log | grep 'Finished testing of' | wc -l) if [ $testCount == 3 ] then diff --git a/samples/client/petstore/cpp-qt/client/CMakeLists.txt b/samples/client/petstore/cpp-qt/client/CMakeLists.txt index 869830afa19..fb37e4dc2d5 100644 --- a/samples/client/petstore/cpp-qt/client/CMakeLists.txt +++ b/samples/client/petstore/cpp-qt/client/CMakeLists.txt @@ -2,39 +2,51 @@ cmake_minimum_required(VERSION 3.2) project(CppQtPetstoreClient) -set(CMAKE_VERBOSE_MAKEFILE ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CXX_STANDARD_REQUIRED ON) - -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) -endif() - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() - -find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Gui) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network Gui) include(GNUInstallDirs) include(CMakePackageConfigHelpers) -file(GLOB_RECURSE HEADER_FILES "*.h") -file(GLOB_RECURSE SOURCE_FILES "*.cpp") - -add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES}) - -target_compile_options(${PROJECT_NAME} - PRIVATE - $<$,$,$>: - -Wall -Wno-unused-variable> -) +add_library(${PROJECT_NAME} + PFXApiResponse.h + PFXCategory.h + PFXOrder.h + PFXPet.h + PFXTag.h + PFXTestAnyType.h + PFXUser.h + PFXPetApi.h + PFXPrimitivesApi.h + PFXStoreApi.h + PFXUserApi.h + PFXHelpers.h + PFXHttpRequest.h + PFXObject.h + PFXEnum.h + PFXHttpFileElement.h + PFXServerConfiguration.h + PFXServerVariable.h + PFXOauth.h + PFXApiResponse.cpp + PFXCategory.cpp + PFXOrder.cpp + PFXPet.cpp + PFXTag.cpp + PFXTestAnyType.cpp + PFXUser.cpp + PFXPetApi.cpp + PFXPrimitivesApi.cpp + PFXStoreApi.cpp + PFXUserApi.cpp + PFXHelpers.cpp + PFXHttpRequest.cpp + PFXHttpFileElement.cpp + PFXOauth.cpp + ) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $ ) @@ -46,11 +58,6 @@ target_link_libraries(${PROJECT_NAME} ) -if(NOT APPLE) - find_package(OpenSSL REQUIRED) - target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto) -endif() - configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" diff --git a/samples/client/petstore/cpp-qt/client/PFXHelpers.cpp b/samples/client/petstore/cpp-qt/client/PFXHelpers.cpp index aab9ed05f20..a25beb3c517 100644 --- a/samples/client/petstore/cpp-qt/client/PFXHelpers.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXHelpers.cpp @@ -233,7 +233,7 @@ bool fromStringValue(const QString &inStr, QByteArray &value) { } else { value.clear(); value.append(inStr.toUtf8()); - return value.count() > 0; + return value.size() > 0; } } diff --git a/samples/client/petstore/cpp-ue4/OpenAPI.Build.cs b/samples/client/petstore/cpp-ue4/OpenAPI.Build.cs index f6d2f83eba8..bb8262b7433 100644 --- a/samples/client/petstore/cpp-ue4/OpenAPI.Build.cs +++ b/samples/client/petstore/cpp-ue4/OpenAPI.Build.cs @@ -22,7 +22,7 @@ public class OpenAPI : ModuleRules new string[] { "Core", - "Http", + "HTTP", "Json", } ); diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApi.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApi.cpp index 3e52679fc3e..03ef4341bee 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApi.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApi.cpp @@ -56,7 +56,7 @@ bool OpenAPIPetApi::IsValid() const void OpenAPIPetApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) { - if(RetryManager != &GetHttpRetryManager()) + if (RetryManager != &InRetryManager) { DefaultRetryManager.Reset(); RetryManager = &InRetryManager; diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp index 4708d2e8468..5e19551bda8 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp @@ -382,7 +382,7 @@ void OpenAPIPetApi::UpdatePetWithFormRequest::SetupHttpRequest(const FHttpReques // Default to Json Body request if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) { - // Form parameters + // Form parameters added to try to generate a json body when no body parameters are specified. FString JsonBody; JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); Writer->WriteObjectStart(); @@ -470,7 +470,7 @@ void OpenAPIPetApi::UploadFileRequest::SetupHttpRequest(const FHttpRequestRef& H // Default to Json Body request if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) { - // Form parameters + // Form parameters added to try to generate a json body when no body parameters are specified. FString JsonBody; JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); Writer->WriteObjectStart(); @@ -478,10 +478,7 @@ void OpenAPIPetApi::UploadFileRequest::SetupHttpRequest(const FHttpRequestRef& H Writer->WriteIdentifierPrefix(TEXT("additionalMetadata")); WriteJsonValue(Writer, AdditionalMetadata.GetValue()); } - if (File.IsSet()){ - Writer->WriteIdentifierPrefix(TEXT("file")); - WriteJsonValue(Writer, File.GetValue()); - } + UE_LOG(LogOpenAPI, Error, TEXT("Form parameter (file) was ignored, Files are not supported in json body")); Writer->WriteObjectEnd(); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApi.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApi.cpp index 04ee754d255..d0fe314e968 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApi.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApi.cpp @@ -56,7 +56,7 @@ bool OpenAPIStoreApi::IsValid() const void OpenAPIStoreApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) { - if(RetryManager != &GetHttpRetryManager()) + if (RetryManager != &InRetryManager) { DefaultRetryManager.Reset(); RetryManager = &InRetryManager; diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApi.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApi.cpp index cc231f0be31..ca934a58b3c 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApi.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApi.cpp @@ -56,7 +56,7 @@ bool OpenAPIUserApi::IsValid() const void OpenAPIUserApi::SetHttpRetryManager(FHttpRetrySystem::FManager& InRetryManager) { - if(RetryManager != &GetHttpRetryManager()) + if (RetryManager != &InRetryManager) { DefaultRetryManager.Reset(); RetryManager = &InRetryManager; diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIHelpers.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIHelpers.h index ff8497f23f9..799e218f281 100644 --- a/samples/client/petstore/cpp-ue4/Public/OpenAPIHelpers.h +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIHelpers.h @@ -103,12 +103,18 @@ FString Base64UrlEncode(const T& Value) return Base64String; } -template +template::value, int>::type = 0> inline FStringFormatArg ToStringFormatArg(const T& Value) { return FStringFormatArg(Value); } +template::value, int>::type = 0> +inline FStringFormatArg ToStringFormatArg(const T& EnumModelValue) +{ + return FStringFormatArg(T::EnumToString(EnumModelValue.Value)); +} + inline FStringFormatArg ToStringFormatArg(const FDateTime& Value) { return FStringFormatArg(Value.ToIso8601()); diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES deleted file mode 100644 index bf325d51202..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES +++ /dev/null @@ -1,25 +0,0 @@ -.gitignore -README.md -compile-mono.sh -docs/ApiResponse.md -docs/Category.md -docs/Order.md -docs/Pet.md -docs/PetApi.md -docs/StoreApi.md -docs/Tag.md -docs/User.md -docs/UserApi.md -src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs -src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs -vendor/packages.config diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md deleted file mode 100644 index 5296503208a..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# Org.OpenAPITools - the C# library for the 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. - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- SDK version: 1.0.0 -- Build package: org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen - - -## Frameworks supported -- .NET 2.0 - - -## Dependencies -- Mono compiler -- Newtonsoft.Json.7.0.1 -- RestSharp.Net2.1.1.11 - -Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator - - -## Installation -Run the following command to generate the DLL -- [Mac/Linux] `/bin/sh compile-mono.sh` -- [Windows] TODO - -Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: -```csharp -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; -``` - -## Getting Started - -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class Example - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Add a new pet to the store - apiInstance.AddPet(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); - } - } - } -} -``` - - -## 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.Model.ApiResponse](docs/ApiResponse.md) - - [Org.OpenAPITools.Model.Category](docs/Category.md) - - [Org.OpenAPITools.Model.Order](docs/Order.md) - - [Org.OpenAPITools.Model.Pet](docs/Pet.md) - - [Org.OpenAPITools.Model.Tag](docs/Tag.md) - - [Org.OpenAPITools.Model.User](docs/User.md) - - - -## Documentation for Authorization - -Authentication schemes defined for the API: - -### 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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/compile-mono.sh b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/compile-mono.sh deleted file mode 100644 index 8e6e23eba08..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/compile-mono.sh +++ /dev/null @@ -1,12 +0,0 @@ -wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; -mozroots --import --sync -mono nuget.exe install vendor/packages.config -o vendor; -mkdir -p bin; -mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\ -vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\ -System.Runtime.Serialization.dll \ --target:library \ --out:bin/Org.OpenAPITools.dll \ --recurse:'src/*.cs' \ --doc:bin/Org.OpenAPITools.xml \ --platform:anycpu diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md deleted file mode 100644 index 373f0348fe7..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/PetApi.md +++ /dev/null @@ -1,526 +0,0 @@ -# Org.OpenAPITools.Api.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** -> void AddPet (Pet body) - -Add a new pet to the store - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class AddPetExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Add a new pet to the store - apiInstance.AddPet(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); - } - } - } -} -``` - -### 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** -> void DeletePet (long? petId, string apiKey) - -Deletes a pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeletePetExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete - var apiKey = apiKey_example; // string | (optional) - - try - { - // Deletes a pet - apiInstance.DeletePet(petId, apiKey); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | - **apiKey** | **string**| | [optional] - -### 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 (List status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FindPetsByStatusExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var status = status_example; // List | Status values that need to be considered for filter - - try - { - // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **List**| Status values that need to be considered for filter | - -### 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 (List tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FindPetsByTagsExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var tags = new List(); // List | Tags to filter by - - try - { - // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List**](string.md)| Tags to filter by | - -### 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 (long? petId) - -Find pet by ID - -Returns a single pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetPetByIdExample - { - public void main() - { - // Configure API key authorization: api_key - Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY"); - // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed - // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return - - try - { - // Find pet by ID - Pet result = apiInstance.GetPetById(petId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | - -### 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** -> void UpdatePet (Pet body) - -Update an existing pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdatePetExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Update an existing pet - apiInstance.UpdatePet(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); - } - } - } -} -``` - -### 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** -> void UpdatePetWithForm (long? petId, string name, string status) - -Updates a pet in the store with form data - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdatePetWithFormExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) - - try - { - // Updates a pet in the store with form data - apiInstance.UpdatePetWithForm(petId, name, status); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | - **name** | **string**| Updated name of the pet | [optional] - **status** | **string**| Updated status of the pet | [optional] - -### 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 (long? petId, string additionalMetadata, System.IO.Stream file) - -uploads an image - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UploadFileExample - { - public void main() - { - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) - - try - { - // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | - **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] - -### 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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md deleted file mode 100644 index d68fa5efb81..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/StoreApi.md +++ /dev/null @@ -1,254 +0,0 @@ -# Org.OpenAPITools.Api.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** -> void DeleteOrder (string 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 -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeleteOrderExample - { - public void main() - { - var apiInstance = new StoreApi(); - var orderId = orderId_example; // string | ID of the order that needs to be deleted - - try - { - // Delete purchase order by ID - apiInstance.DeleteOrder(orderId); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **string**| ID of the order that needs to be deleted | - -### 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** -> Dictionary GetInventory () - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetInventoryExample - { - public void main() - { - // Configure API key authorization: api_key - Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY"); - // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed - // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); - - var apiInstance = new StoreApi(); - - try - { - // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); - } - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Dictionary** - -### 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 (long? orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetOrderByIdExample - { - public void main() - { - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched - - try - { - // Find purchase order by ID - Order result = apiInstance.GetOrderById(orderId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **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 - -[[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 body) - -Place an order for a pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class PlaceOrderExample - { - public void main() - { - var apiInstance = new StoreApi(); - var body = new Order(); // Order | order placed for purchasing the pet - - try - { - // Place an order for a pet - Order result = apiInstance.PlaceOrder(body); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); - } - } - } -} -``` - -### 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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/User.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/User.md deleted file mode 100644 index 04dd24a3423..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/User.md +++ /dev/null @@ -1,16 +0,0 @@ -# Org.OpenAPITools.Model.User -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Username** | **string** | | [optional] -**FirstName** | **string** | | [optional] -**LastName** | **string** | | [optional] -**Email** | **string** | | [optional] -**Password** | **string** | | [optional] -**Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md deleted file mode 100644 index 74ca98353aa..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md +++ /dev/null @@ -1,488 +0,0 @@ -# Org.OpenAPITools.Api.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** -> void CreateUser (User body) - -Create user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUserExample - { - public void main() - { - var apiInstance = new UserApi(); - var body = new User(); // User | Created user object - - try - { - // Create user - apiInstance.CreateUser(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); - } - } - } -} -``` - -### 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** -> void CreateUsersWithArrayInput (List body) - -Creates list of users with given input array - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUsersWithArrayInputExample - { - public void main() - { - var apiInstance = new UserApi(); - var body = new List(); // List | List of user object - - try - { - // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List**](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** -> void CreateUsersWithListInput (List body) - -Creates list of users with given input array - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUsersWithListInputExample - { - public void main() - { - var apiInstance = new UserApi(); - var body = new List(); // List | List of user object - - try - { - // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(body); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List**](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** -> void DeleteUser (string username) - -Delete user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeleteUserExample - { - public void main() - { - var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be deleted - - try - { - // Delete user - apiInstance.DeleteUser(username); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be deleted | - -### 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 (string username) - -Get user by user name - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetUserByNameExample - { - public void main() - { - var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. - - try - { - // Get user by user name - User result = apiInstance.GetUserByName(username); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **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 - -[[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 (string username, string password) - -Logs user into the system - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class LoginUserExample - { - public void main() - { - var apiInstance = new UserApi(); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text - - try - { - // Logs user into the system - string result = apiInstance.LoginUser(username, password); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The user name for login | - **password** | **string**| The password for login in clear text | - -### 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** -> void LogoutUser () - -Logs out current logged in user session - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class LogoutUserExample - { - public void main() - { - var apiInstance = new UserApi(); - - try - { - // Logs out current logged in user session - apiInstance.LogoutUser(); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); - } - } - } -} -``` - -### 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** -> void UpdateUser (string username, User body) - -Updated user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdateUserExample - { - public void main() - { - var apiInstance = new UserApi(); - var username = username_example; // string | name that need to be deleted - var body = new User(); // User | Updated user object - - try - { - // Updated user - apiInstance.UpdateUser(username, body); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| name that need to be deleted | - **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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/nuget.exe b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/nuget.exe deleted file mode 100644 index 0cc40884a0d..00000000000 Binary files a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/nuget.exe and /dev/null differ diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs deleted file mode 100644 index 7a6131e249e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs +++ /dev/null @@ -1,431 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IPetApi - { - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// - void AddPet (Pet body); - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// - void DeletePet (long? petId, string apiKey); - /// - /// Finds Pets by status Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - /// List<Pet> - List FindPetsByStatus (List status); - /// - /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - [Obsolete] - List FindPetsByTags (List tags); - /// - /// Find pet by ID Returns a single pet - /// - /// ID of pet to return - /// Pet - Pet GetPetById (long? petId); - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// - void UpdatePet (Pet body); - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - void UpdatePetWithForm (long? petId, string name, string status); - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class PetApi : IPetApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public PetApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public PetApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// - public void AddPet (Pet body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling AddPet"); - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// - public void DeletePet (long? petId, string apiKey) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Finds Pets by status Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - /// List<Pet> - public List FindPetsByStatus (List status) - { - - // verify the required parameter 'status' is set - if (status == null) throw new ApiException(400, "Missing required parameter 'status' when calling FindPetsByStatus"); - - - var path = "/pet/findByStatus"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage); - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - [Obsolete] - public List FindPetsByTags (List tags) - { - - // verify the required parameter 'tags' is set - if (tags == null) throw new ApiException(400, "Missing required parameter 'tags' when calling FindPetsByTags"); - - - var path = "/pet/findByTags"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage); - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Find pet by ID Returns a single pet - /// - /// ID of pet to return - /// Pet - public Pet GetPetById (long? petId) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage); - - return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); - } - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// - public void UpdatePet (Pet body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdatePet"); - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - public void UpdatePetWithForm (long? petId, string name, string status) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter -if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); - - - var path = "/pet/{petId}/uploadImage"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter -if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.ErrorMessage, response.ErrorMessage); - - return (ApiResponse) ApiClient.Deserialize(response.Content, typeof(ApiResponse), response.Headers); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs deleted file mode 100644 index 423d179cdbe..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs +++ /dev/null @@ -1,236 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IStoreApi - { - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - /// - void DeleteOrder (string orderId); - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary<string, int?> - Dictionary GetInventory (); - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// ID of pet that needs to be fetched - /// Order - Order GetOrderById (long? orderId); - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - Order PlaceOrder (Order body); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class StoreApi : IStoreApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public StoreApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public StoreApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - /// - public void DeleteOrder (string orderId) - { - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary<string, int?> - public Dictionary GetInventory () - { - - - var path = "/store/inventory"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage); - - return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); - } - - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// ID of pet that needs to be fetched - /// Order - public Order GetOrderById (long? orderId) - { - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage); - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - public Order PlaceOrder (Order body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling PlaceOrder"); - - - var path = "/store/order"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage); - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs deleted file mode 100644 index 3f453e6b9b2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs +++ /dev/null @@ -1,420 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IUserApi - { - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - /// - void CreateUser (User body); - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - void CreateUsersWithArrayInput (List body); - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - void CreateUsersWithListInput (List body); - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - void DeleteUser (string username); - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - User GetUserByName (string username); - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - string LoginUser (string username, string password); - /// - /// Logs out current logged in user session - /// - /// - void LogoutUser (); - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - void UpdateUser (string username, User body); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class UserApi : IUserApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public UserApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public UserApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - /// - public void CreateUser (User body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUser"); - - - var path = "/user"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - public void CreateUsersWithArrayInput (List body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithArrayInput"); - - - var path = "/user/createWithArray"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - public void CreateUsersWithListInput (List body) - { - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithListInput"); - - - var path = "/user/createWithList"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - public void DeleteUser (string username) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - public User GetUserByName (string username) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage); - - return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - public string LoginUser (string username, string password) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling LoginUser"); - - // verify the required parameter 'password' is set - if (password == null) throw new ApiException(400, "Missing required parameter 'password' when calling LoginUser"); - - - var path = "/user/login"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter - if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage); - - return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); - } - - /// - /// Logs out current logged in user session - /// - /// - public void LogoutUser () - { - - - var path = "/user/logout"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - public void UpdateUser (string username, User body) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdateUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(body); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs deleted file mode 100644 index 7b0d472a06e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs +++ /dev/null @@ -1,297 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text.RegularExpressions; -using System.IO; -using System.Web; -using System.Linq; -using System.Net; -using System.Text; -using Newtonsoft.Json; -using RestSharp; -using RestSharp.Extensions; - -namespace Org.OpenAPITools.Client -{ - /// - /// API client is mainly responsible for making the HTTP call to the API backend. - /// - public class ApiClient - { - private readonly Dictionary _defaultHeaderMap = new Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// The base path. - public ApiClient(String basePath="http://petstore.swagger.io/v2") - { - BasePath = basePath; - RestClient = new RestClient(BasePath); - } - - /// - /// Gets or sets the base path. - /// - /// The base path - public string BasePath { get; set; } - - /// - /// Gets or sets the RestClient. - /// - /// An instance of the RestClient - public RestClient RestClient { get; set; } - - /// - /// Gets the default header. - /// - public Dictionary DefaultHeader - { - get { return _defaultHeaderMap; } - } - - /// - /// Makes the HTTP request (Sync). - /// - /// URL path. - /// HTTP method. - /// Query parameters. - /// HTTP body (POST request). - /// Header parameters. - /// Form parameters. - /// File parameters. - /// Authentication settings. - /// Object - public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, String[] authSettings) - { - - var request = new RestRequest(path, method); - - UpdateParamsForAuth(queryParams, headerParams, authSettings); - - // add default header, if any - foreach(var defaultHeader in _defaultHeaderMap) - request.AddHeader(defaultHeader.Key, defaultHeader.Value); - - // add header parameter, if any - foreach(var param in headerParams) - request.AddHeader(param.Key, param.Value); - - // add query parameter, if any - foreach(var param in queryParams) - request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost); - - // add form parameter, if any - foreach(var param in formParams) - request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost); - - // add file parameter, if any - foreach(var param in fileParams) - request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); - - if (postBody != null) // http body (model) parameter - request.AddParameter("application/json", postBody, ParameterType.RequestBody); - - return (Object)RestClient.Execute(request); - - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - public void AddDefaultHeader(string key, string value) - { - _defaultHeaderMap.Add(key, value); - } - - /// - /// Escape string (url-encoded). - /// - /// String to be escaped. - /// Escaped string. - public string EscapeString(string str) - { - return RestSharp.Contrib.HttpUtility.UrlEncode(str); - } - - /// - /// Create FileParameter based on Stream. - /// - /// Parameter name. - /// Input stream. - /// FileParameter. - public FileParameter ParameterToFile(string name, Stream stream) - { - if (stream is FileStream) - return FileParameter.Create(name, stream.ReadAsBytes(), Path.GetFileName(((FileStream)stream).Name)); - else - return FileParameter.Create(name, stream.ReadAsBytes(), "no_file_name_provided"); - } - - /// - /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. - /// If parameter is a list of string, join the list with ",". - /// Otherwise just return the string. - /// - /// The parameter (header, path, query, form). - /// Formatted string. - public string ParameterToString(object obj) - { - if (obj is DateTime) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return ((DateTime)obj).ToString (Configuration.DateTimeFormat); - else if (obj is bool) - return (bool)obj ? "true" : "false"; - else if (obj is List) - return String.Join(",", (obj as List).ToArray()); - else - return Convert.ToString (obj); - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// HTTP body (e.g. string, JSON). - /// Object type. - /// HTTP headers. - /// Object representation of the JSON string. - public object Deserialize(string content, Type type, IList headers=null) - { - if (type == typeof(Object)) // return an object - { - return content; - } - - if (type == typeof(Stream)) - { - var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) - ? Path.GetTempPath() - : Configuration.TempFolderPath; - - var fileName = filePath + Guid.NewGuid(); - if (headers != null) - { - var regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); - var match = regex.Match(headers.ToString()); - if (match.Success) - fileName = filePath + match.Value.Replace("\"", "").Replace("'", ""); - } - File.WriteAllText(fileName, content); - return new FileStream(fileName, FileMode.Open); - - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return ConvertType(content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(content, type); - } - catch (IOException e) - { - throw new ApiException(500, e.Message); - } - } - - /// - /// Serialize an object into JSON string. - /// - /// Object. - /// JSON string. - public string Serialize(object obj) - { - try - { - return obj != null ? JsonConvert.SerializeObject(obj) : null; - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - /// - /// Get the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix (string apiKeyIdentifier) - { - var apiKeyValue = ""; - Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); - var apiKeyPrefix = ""; - if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) - return apiKeyPrefix + " " + apiKeyValue; - else - return apiKeyValue; - } - - /// - /// Update parameters based on authentication. - /// - /// Query parameters. - /// Header parameters. - /// Authentication settings. - public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) - { - if (authSettings == null || authSettings.Length == 0) - return; - - foreach (string auth in authSettings) - { - // determine which one to use - switch(auth) - { - case "api_key": - headerParams["api_key"] = GetApiKeyWithPrefix("api_key"); - break; - case "petstore_auth": - headerParams["Authorization"] = "Bearer " + Configuration.AccessToken; - break; - default: - //TODO show warning about security definition not found - break; - } - } - } - - /// - /// Encode string in base64 format. - /// - /// String to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - var textByte = System.Text.Encoding.UTF8.GetBytes(text); - return System.Convert.ToBase64String(textByte); - } - - /// - /// Dynamically cast the object into target type. - /// - /// Object to be casted - /// Target type - /// Casted object - public static Object ConvertType(Object fromObject, Type toObject) { - return Convert.ChangeType(fromObject, toObject); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs deleted file mode 100644 index 7985897b93e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace Org.OpenAPITools.Client { - /// - /// API Exception - /// - public class ApiException : Exception { - /// - /// Gets or sets the error code (HTTP status code) - /// - /// The error code (HTTP status code). - public int ErrorCode { get; set; } - - /// - /// Gets or sets the error content (body json object) - /// - /// The error content (Http response body). - public Object ErrorContent { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public ApiException() {} - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - public ApiException(int errorCode, string message) : base(message) { - this.ErrorCode = errorCode; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - /// Error content. - public ApiException(int errorCode, string message, Object errorContent = null) : base(message) { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; - } - - } - -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs deleted file mode 100644 index 10bd0088bb7..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs +++ /dev/null @@ -1,138 +0,0 @@ -using System; -using System.Reflection; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace Org.OpenAPITools.Client -{ - /// - /// Represents a set of configuration settings - /// - public class Configuration - { - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "1.0.0"; - - /// - /// Gets or sets the default API client for making HTTP calls. - /// - /// The API client. - public static ApiClient DefaultApiClient = new ApiClient(); - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public static String Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public static String Password { get; set; } - - /// - /// Gets or sets the access token (Bearer/OAuth authentication). - /// - /// The access token. - public static String AccessToken { get; set; } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public static Dictionary ApiKey = new Dictionary(); - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - public static Dictionary ApiKeyPrefix = new Dictionary(); - - private static string _tempFolderPath = Path.GetTempPath(); - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public static String TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (String.IsNullOrEmpty(value)) - { - _tempFolderPath = value; - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - Directory.CreateDirectory(value); - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - _tempFolderPath = value; - else - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - - private const string ISO8601_DATETIME_FORMAT = "o"; - - private static string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public static String DateTimeFormat - { - get - { - return _dateTimeFormat; - } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Returns a string with essential information for debugging. - /// - public static String ToDebugReport() - { - String report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; - report += " OS: " + Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + Assembly - .GetExecutingAssembly() - .GetReferencedAssemblies() - .Where(x => x.Name == "System.Core").First().Version.ToString() + "\n"; - report += " Version of the API: 1.0.0\n"; - report += " SDK Package Version: 1.0.0\n"; - - return report; - } - } -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs deleted file mode 100644 index 648aaeba5b1..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// Describes the result of uploading an image resource - /// - [DataContract] - public class ApiResponse { - /// - /// Gets or Sets Code - /// - [DataMember(Name="code", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "code")] - public int? Code { get; set; } - - /// - /// Gets or Sets Type - /// - [DataMember(Name="type", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or Sets Message - /// - [DataMember(Name="message", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class ApiResponse {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs deleted file mode 100644 index 847279502e2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A category for a pet - /// - [DataContract] - public class Category { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject.cs deleted file mode 100644 index 2de88324c58..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// - /// - [DataContract] - public class InlineObject { - /// - /// Updated name of the pet - /// - /// Updated name of the pet - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Updated status of the pet - /// - /// Updated status of the pet - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class InlineObject {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject1.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject1.cs deleted file mode 100644 index 03d1fa0c786..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/InlineObject1.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// - /// - [DataContract] - public class InlineObject1 { - /// - /// Additional data to pass to server - /// - /// Additional data to pass to server - [DataMember(Name="additionalMetadata", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "additionalMetadata")] - public string AdditionalMetadata { get; set; } - - /// - /// file to upload - /// - /// file to upload - [DataMember(Name="file", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "file")] - public System.IO.Stream File { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class InlineObject1 {\n"); - sb.Append(" AdditionalMetadata: ").Append(AdditionalMetadata).Append("\n"); - sb.Append(" File: ").Append(File).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs deleted file mode 100644 index c19511ca3f8..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// An order for a pets from the pet store - /// - [DataContract] - public class Order { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets PetId - /// - [DataMember(Name="petId", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "petId")] - public long? PetId { get; set; } - - /// - /// Gets or Sets Quantity - /// - [DataMember(Name="quantity", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "quantity")] - public int? Quantity { get; set; } - - /// - /// Gets or Sets ShipDate - /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "shipDate")] - public DateTime? ShipDate { get; set; } - - /// - /// Order Status - /// - /// Order Status - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or Sets Complete - /// - [DataMember(Name="complete", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "complete")] - public bool? Complete { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Order {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PetId: ").Append(PetId).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); - sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Complete: ").Append(Complete).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs deleted file mode 100644 index 71ec62aa9c8..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A pet for sale in the pet store - /// - [DataContract] - public class Pet { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name="category", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "category")] - public Category Category { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or Sets PhotoUrls - /// - [DataMember(Name="photoUrls", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "photoUrls")] - public List PhotoUrls { get; set; } - - /// - /// Gets or Sets Tags - /// - [DataMember(Name="tags", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "tags")] - public List Tags { get; set; } - - /// - /// pet status in the store - /// - /// pet status in the store - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs deleted file mode 100644 index 6399695a50a..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A tag for a pet - /// - [DataContract] - public class Tag { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Tag {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs deleted file mode 100644 index c6af059dcdc..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A User who is purchasing from the pet store - /// - [DataContract] - public class User { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Username - /// - [DataMember(Name="username", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } - - /// - /// Gets or Sets FirstName - /// - [DataMember(Name="firstName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "firstName")] - public string FirstName { get; set; } - - /// - /// Gets or Sets LastName - /// - [DataMember(Name="lastName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "lastName")] - public string LastName { get; set; } - - /// - /// Gets or Sets Email - /// - [DataMember(Name="email", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "email")] - public string Email { get; set; } - - /// - /// Gets or Sets Password - /// - [DataMember(Name="password", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// Gets or Sets Phone - /// - [DataMember(Name="phone", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "phone")] - public string Phone { get; set; } - - /// - /// User Status - /// - /// User Status - [DataMember(Name="userStatus", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "userStatus")] - public int? UserStatus { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class User {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Username: ").Append(Username).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/vendor/packages.config b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/vendor/packages.config deleted file mode 100644 index 7b9cf186303..00000000000 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/vendor/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md deleted file mode 100644 index 6b861dfd723..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# Org.OpenAPITools - the C# library for the 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. - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- SDK version: 1.0.0 -- Build package: org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen - - -## Frameworks supported -- .NET 2.0 - - -## Dependencies -- Mono compiler -- Newtonsoft.Json.7.0.1 -- RestSharp.Net2.1.1.11 - -Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator - - -## Installation -Run the following command to generate the DLL -- [Mac/Linux] `/bin/sh compile-mono.sh` -- [Windows] TODO - -Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: -```csharp -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; -``` - -## Getting Started - -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class Example - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Add a new pet to the store - apiInstance.AddPet(pet); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); - } - } - } -} -``` - - -## 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.Model.ApiResponse](docs/ApiResponse.md) - - [Org.OpenAPITools.Model.Category](docs/Category.md) - - [Org.OpenAPITools.Model.Order](docs/Order.md) - - [Org.OpenAPITools.Model.Pet](docs/Pet.md) - - [Org.OpenAPITools.Model.Tag](docs/Tag.md) - - [Org.OpenAPITools.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/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh deleted file mode 100644 index 8e6e23eba08..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh +++ /dev/null @@ -1,12 +0,0 @@ -wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; -mozroots --import --sync -mono nuget.exe install vendor/packages.config -o vendor; -mkdir -p bin; -mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\ -vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\ -System.Runtime.Serialization.dll \ --target:library \ --out:bin/Org.OpenAPITools.dll \ --recurse:'src/*.cs' \ --doc:bin/Org.OpenAPITools.xml \ --platform:anycpu diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md deleted file mode 100644 index 984bd5ca063..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Order.md +++ /dev/null @@ -1,14 +0,0 @@ -# Org.OpenAPITools.Model.Order -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] -**Status** | **string** | Order Status | [optional] -**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/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md deleted file mode 100644 index ce9fe873cd2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md +++ /dev/null @@ -1,14 +0,0 @@ -# Org.OpenAPITools.Model.Pet -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] -**Name** | **string** | | -**PhotoUrls** | **List** | | -**Tags** | [**List**](Tag.md) | | [optional] -**Status** | **string** | pet status in the store | [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/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md deleted file mode 100644 index 0051c617a1d..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md +++ /dev/null @@ -1,534 +0,0 @@ -# Org.OpenAPITools.Api.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** -> void AddPet (Pet pet) - -Add a new pet to the store - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class AddPetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Add a new pet to the store - apiInstance.AddPet(pet); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**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** -> void DeletePet (long? petId, string apiKey) - -Deletes a pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeletePetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete - var apiKey = apiKey_example; // string | (optional) - - try - { - // Deletes a pet - apiInstance.DeletePet(petId, apiKey); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | - **apiKey** | **string**| | [optional] - -### 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 (List status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FindPetsByStatusExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var status = status_example; // List | Status values that need to be considered for filter - - try - { - // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **List**| Status values that need to be considered for filter | - -### 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 (List tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class FindPetsByTagsExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var tags = new List(); // List | Tags to filter by - - try - { - // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List**](string.md)| Tags to filter by | - -### 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 (long? petId) - -Find pet by ID - -Returns a single pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetPetByIdExample - { - public void main() - { - - // Configure API key authorization: api_key - Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY"); - // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed - // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return - - try - { - // Find pet by ID - Pet result = apiInstance.GetPetById(petId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | - -### 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** -> void UpdatePet (Pet pet) - -Update an existing pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdatePetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store - - try - { - // Update an existing pet - apiInstance.UpdatePet(pet); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**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** -> void UpdatePetWithForm (long? petId, string name, string status) - -Updates a pet in the store with form data - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdatePetWithFormExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) - - try - { - // Updates a pet in the store with form data - apiInstance.UpdatePetWithForm(petId, name, status); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | - **name** | **string**| Updated name of the pet | [optional] - **status** | **string**| Updated status of the pet | [optional] - -### 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 (long? petId, string additionalMetadata, System.IO.Stream file) - -uploads an image - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UploadFileExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: petstore_auth - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) - - try - { - // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | - **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] - -### 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/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md deleted file mode 100644 index 58e85fb6eb6..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md +++ /dev/null @@ -1,258 +0,0 @@ -# Org.OpenAPITools.Api.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** -> void DeleteOrder (string 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 -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeleteOrderExample - { - public void main() - { - - var apiInstance = new StoreApi(); - var orderId = orderId_example; // string | ID of the order that needs to be deleted - - try - { - // Delete purchase order by ID - apiInstance.DeleteOrder(orderId); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **string**| ID of the order that needs to be deleted | - -### 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** -> Dictionary GetInventory () - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetInventoryExample - { - public void main() - { - - // Configure API key authorization: api_key - Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY"); - // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed - // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); - - var apiInstance = new StoreApi(); - - try - { - // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); - } - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Dictionary** - -### 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 (long? orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetOrderByIdExample - { - public void main() - { - - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched - - try - { - // Find purchase order by ID - Order result = apiInstance.GetOrderById(orderId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **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 - -[[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) - -Place an order for a pet - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class PlaceOrderExample - { - public void main() - { - - var apiInstance = new StoreApi(); - var order = new Order(); // Order | order placed for purchasing the pet - - try - { - // Place an order for a pet - Order result = apiInstance.PlaceOrder(order); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); - } - } - } -} -``` - -### 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**: 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/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md deleted file mode 100644 index 04dd24a3423..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/User.md +++ /dev/null @@ -1,16 +0,0 @@ -# Org.OpenAPITools.Model.User -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Username** | **string** | | [optional] -**FirstName** | **string** | | [optional] -**LastName** | **string** | | [optional] -**Email** | **string** | | [optional] -**Password** | **string** | | [optional] -**Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [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/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md deleted file mode 100644 index dad1e505005..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md +++ /dev/null @@ -1,496 +0,0 @@ -# Org.OpenAPITools.Api.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** -> void CreateUser (User user) - -Create user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - var user = new User(); // User | Created user object - - try - { - // Create user - apiInstance.CreateUser(user); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**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** -> void CreateUsersWithArrayInput (List user) - -Creates list of users with given input array - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUsersWithArrayInputExample - { - public void main() - { - - var apiInstance = new UserApi(); - var user = new List(); // List | List of user object - - try - { - // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(user); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List**](List.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** -> void CreateUsersWithListInput (List user) - -Creates list of users with given input array - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class CreateUsersWithListInputExample - { - public void main() - { - - var apiInstance = new UserApi(); - var user = new List(); // List | List of user object - - try - { - // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(user); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List**](List.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** -> void DeleteUser (string username) - -Delete user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class DeleteUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be deleted - - try - { - // Delete user - apiInstance.DeleteUser(username); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be deleted | - -### 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 (string username) - -Get user by user name - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class GetUserByNameExample - { - public void main() - { - - var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. - - try - { - // Get user by user name - User result = apiInstance.GetUserByName(username); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **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 - -[[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 (string username, string password) - -Logs user into the system - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class LoginUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text - - try - { - // Logs user into the system - string result = apiInstance.LoginUser(username, password); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The user name for login | - **password** | **string**| The password for login in clear text | - -### 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** -> void LogoutUser () - -Logs out current logged in user session - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class LogoutUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - - try - { - // Logs out current logged in user session - apiInstance.LogoutUser(); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); - } - } - } -} -``` - -### 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** -> void UpdateUser (string username, User user) - -Updated user - -This can only be done by the logged in user. - -### Example -```csharp -using System; -using System.Diagnostics; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Example -{ - public class UpdateUserExample - { - public void main() - { - - var apiInstance = new UserApi(); - var username = username_example; // string | name that need to be deleted - var user = new User(); // User | Updated user object - - try - { - // Updated user - apiInstance.UpdateUser(username, user); - } - catch (Exception e) - { - Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| name that need to be deleted | - **user** | [**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/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs deleted file mode 100644 index 66e0f6ab5cc..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs +++ /dev/null @@ -1,429 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IPetApi - { - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// - void AddPet (Pet pet); - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// - void DeletePet (long? petId, string apiKey); - /// - /// Finds Pets by status Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - /// List<Pet> - List FindPetsByStatus (List status); - /// - /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - List FindPetsByTags (List tags); - /// - /// Find pet by ID Returns a single pet - /// - /// ID of pet to return - /// Pet - Pet GetPetById (long? petId); - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// - void UpdatePet (Pet pet); - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - void UpdatePetWithForm (long? petId, string name, string status); - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class PetApi : IPetApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public PetApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public PetApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// - public void AddPet (Pet pet) - { - - // verify the required parameter 'pet' is set - if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling AddPet"); - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(pet); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// - public void DeletePet (long? petId, string apiKey) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Finds Pets by status Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - /// List<Pet> - public List FindPetsByStatus (List status) - { - - // verify the required parameter 'status' is set - if (status == null) throw new ApiException(400, "Missing required parameter 'status' when calling FindPetsByStatus"); - - - var path = "/pet/findByStatus"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage); - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - /// List<Pet> - public List FindPetsByTags (List tags) - { - - // verify the required parameter 'tags' is set - if (tags == null) throw new ApiException(400, "Missing required parameter 'tags' when calling FindPetsByTags"); - - - var path = "/pet/findByTags"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage); - - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); - } - - /// - /// Find pet by ID Returns a single pet - /// - /// ID of pet to return - /// Pet - public Pet GetPetById (long? petId) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage); - - return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); - } - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// - public void UpdatePet (Pet pet) - { - - // verify the required parameter 'pet' is set - if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling UpdatePet"); - - - var path = "/pet"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(pet); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// - public void UpdatePetWithForm (long? petId, string name, string status) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); - - - var path = "/pet/{petId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter -if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); // form parameter - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file) - { - - // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); - - - var path = "/pet/{petId}/uploadImage"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter -if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); - - // authentication setting, if any - String[] authSettings = new String[] { "petstore_auth" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.ErrorMessage, response.ErrorMessage); - - return (ApiResponse) ApiClient.Deserialize(response.Content, typeof(ApiResponse), response.Headers); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs deleted file mode 100644 index c23c321d637..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs +++ /dev/null @@ -1,236 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IStoreApi - { - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - /// - void DeleteOrder (string orderId); - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary<string, int?> - Dictionary GetInventory (); - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// ID of pet that needs to be fetched - /// Order - Order GetOrderById (long? orderId); - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - Order PlaceOrder (Order order); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class StoreApi : IStoreApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public StoreApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public StoreApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - /// - public void DeleteOrder (string orderId) - { - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Returns pet inventories by status Returns a map of status codes to quantities - /// - /// Dictionary<string, int?> - public Dictionary GetInventory () - { - - - var path = "/store/inventory"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { "api_key" }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage); - - return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); - } - - /// - /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// ID of pet that needs to be fetched - /// Order - public Order GetOrderById (long? orderId) - { - - // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); - - - var path = "/store/order/{orderId}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage); - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// Order - public Order PlaceOrder (Order order) - { - - // verify the required parameter 'order' is set - if (order == null) throw new ApiException(400, "Missing required parameter 'order' when calling PlaceOrder"); - - - var path = "/store/order"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(order); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage); - - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs deleted file mode 100644 index 60a0ccac599..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs +++ /dev/null @@ -1,420 +0,0 @@ -using System; -using System.Collections.Generic; -using RestSharp; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; - -namespace Org.OpenAPITools.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IUserApi - { - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - /// - void CreateUser (User user); - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - void CreateUsersWithArrayInput (List user); - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - void CreateUsersWithListInput (List user); - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - void DeleteUser (string username); - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - User GetUserByName (string username); - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - string LoginUser (string username, string password); - /// - /// Logs out current logged in user session - /// - /// - void LogoutUser (); - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - void UpdateUser (string username, User user); - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public class UserApi : IUserApi - { - /// - /// Initializes a new instance of the class. - /// - /// an instance of ApiClient (optional) - /// - public UserApi(ApiClient apiClient = null) - { - if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; - else - this.ApiClient = apiClient; - } - - /// - /// Initializes a new instance of the class. - /// - /// - public UserApi(String basePath) - { - this.ApiClient = new ApiClient(basePath); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - /// The base path - public void SetBasePath(String basePath) - { - this.ApiClient.BasePath = basePath; - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - /// The base path - public String GetBasePath(String basePath) - { - return this.ApiClient.BasePath; - } - - /// - /// Gets or sets the API client. - /// - /// An instance of the ApiClient - public ApiClient ApiClient {get; set;} - - /// - /// Create user This can only be done by the logged in user. - /// - /// Created user object - /// - public void CreateUser (User user) - { - - // verify the required parameter 'user' is set - if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUser"); - - - var path = "/user"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(user); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - public void CreateUsersWithArrayInput (List user) - { - - // verify the required parameter 'user' is set - if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithArrayInput"); - - - var path = "/user/createWithArray"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(user); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// - public void CreateUsersWithListInput (List user) - { - - // verify the required parameter 'user' is set - if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithListInput"); - - - var path = "/user/createWithList"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(user); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Delete user This can only be done by the logged in user. - /// - /// The name that needs to be deleted - /// - public void DeleteUser (string username) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// User - public User GetUserByName (string username) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage); - - return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// string - public string LoginUser (string username, string password) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling LoginUser"); - - // verify the required parameter 'password' is set - if (password == null) throw new ApiException(400, "Missing required parameter 'password' when calling LoginUser"); - - - var path = "/user/login"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter - if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage); - - return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); - } - - /// - /// Logs out current logged in user session - /// - /// - public void LogoutUser () - { - - - var path = "/user/logout"; - path = path.Replace("{format}", "json"); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - /// - /// Updated user This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - /// - public void UpdateUser (string username, User user) - { - - // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - - // verify the required parameter 'user' is set - if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling UpdateUser"); - - - var path = "/user/{username}"; - path = path.Replace("{format}", "json"); - path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username)); - - var queryParams = new Dictionary(); - var headerParams = new Dictionary(); - var formParams = new Dictionary(); - var fileParams = new Dictionary(); - String postBody = null; - - postBody = ApiClient.Serialize(user); // http body (model) parameter - - // authentication setting, if any - String[] authSettings = new String[] { }; - - // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); - - if (((int)response.StatusCode) >= 400) - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content); - else if (((int)response.StatusCode) == 0) - throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage); - - return; - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs deleted file mode 100644 index 5903fde02ad..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs +++ /dev/null @@ -1,297 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text.RegularExpressions; -using System.IO; -using System.Web; -using System.Linq; -using System.Net; -using System.Text; -using Newtonsoft.Json; -using RestSharp; -using RestSharp.Extensions; - -namespace Org.OpenAPITools.Client -{ - /// - /// API client is mainly responsible for making the HTTP call to the API backend. - /// - public class ApiClient - { - private readonly Dictionary _defaultHeaderMap = new Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// The base path. - public ApiClient(String basePath="http://petstore.swagger.io/v2") - { - BasePath = basePath; - RestClient = new RestClient(BasePath); - } - - /// - /// Gets or sets the base path. - /// - /// The base path - public string BasePath { get; set; } - - /// - /// Gets or sets the RestClient. - /// - /// An instance of the RestClient - public RestClient RestClient { get; set; } - - /// - /// Gets the default header. - /// - public Dictionary DefaultHeader - { - get { return _defaultHeaderMap; } - } - - /// - /// Makes the HTTP request (Sync). - /// - /// URL path. - /// HTTP method. - /// Query parameters. - /// HTTP body (POST request). - /// Header parameters. - /// Form parameters. - /// File parameters. - /// Authentication settings. - /// Object - public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, String[] authSettings) - { - - var request = new RestRequest(path, method); - - UpdateParamsForAuth(queryParams, headerParams, authSettings); - - // add default header, if any - foreach(var defaultHeader in _defaultHeaderMap) - request.AddHeader(defaultHeader.Key, defaultHeader.Value); - - // add header parameter, if any - foreach(var param in headerParams) - request.AddHeader(param.Key, param.Value); - - // add query parameter, if any - foreach(var param in queryParams) - request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost); - - // add form parameter, if any - foreach(var param in formParams) - request.AddParameter(param.Key, param.Value, ParameterType.GetOrPost); - - // add file parameter, if any - foreach(var param in fileParams) - request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); - - if (postBody != null) // http body (model) parameter - request.AddParameter("application/json", postBody, ParameterType.RequestBody); - - return (Object)RestClient.Execute(request); - - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - public void AddDefaultHeader(string key, string value) - { - _defaultHeaderMap.Add(key, value); - } - - /// - /// Escape string (url-encoded). - /// - /// String to be escaped. - /// Escaped string. - public string EscapeString(string str) - { - return RestSharp.Contrib.HttpUtility.UrlEncode(str); - } - - /// - /// Create FileParameter based on Stream. - /// - /// Parameter name. - /// Input stream. - /// FileParameter. - public FileParameter ParameterToFile(string name, Stream stream) - { - if (stream is FileStream) - return FileParameter.Create(name, stream.ReadAsBytes(), Path.GetFileName(((FileStream)stream).Name)); - else - return FileParameter.Create(name, stream.ReadAsBytes(), "no_file_name_provided"); - } - - /// - /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. - /// If parameter is a list of string, join the list with ",". - /// Otherwise just return the string. - /// - /// The parameter (header, path, query, form). - /// Formatted string. - public string ParameterToString(object obj) - { - if (obj is DateTime) - // Return a formatted date string - Can be customized with Configuration.DateTimeFormat - // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 - // For example: 2009-06-15T13:45:30.0000000 - return ((DateTime)obj).ToString (Configuration.DateTimeFormat); - else if (obj is List) - return String.Join(",", (obj as List).ToArray()); - else - return Convert.ToString (obj); - } - - /// - /// Deserialize the JSON string into a proper object. - /// - /// HTTP body (e.g. string, JSON). - /// Object type. - /// HTTP headers. - /// Object representation of the JSON string. - public object Deserialize(string content, Type type, IList headers=null) - { - if (type == typeof(Object)) // return an object - { - return content; - } - - if (type == typeof(Stream)) - { - var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) - ? Path.GetTempPath() - : Configuration.TempFolderPath; - - var fileName = filePath + Guid.NewGuid(); - if (headers != null) - { - var regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); - var match = regex.Match(headers.ToString()); - if (match.Success) - fileName = filePath + match.Value.Replace("\"", "").Replace("'", ""); - } - File.WriteAllText(fileName, content); - return new FileStream(fileName, FileMode.Open); - - } - - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object - { - return DateTime.Parse(content, null, System.Globalization.DateTimeStyles.RoundtripKind); - } - - if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type - { - return ConvertType(content, type); - } - - // at this point, it must be a model (json) - try - { - return JsonConvert.DeserializeObject(content, type); - } - catch (IOException e) - { - throw new ApiException(500, e.Message); - } - } - - /// - /// Serialize an object into JSON string. - /// - /// Object. - /// JSON string. - public string Serialize(object obj) - { - try - { - return obj != null ? JsonConvert.SerializeObject(obj) : null; - } - catch (Exception e) - { - throw new ApiException(500, e.Message); - } - } - - /// - /// Get the API key with prefix. - /// - /// API key identifier (authentication scheme). - /// API key with prefix. - public string GetApiKeyWithPrefix (string apiKeyIdentifier) - { - var apiKeyValue = ""; - Configuration.ApiKey.TryGetValue (apiKeyIdentifier, out apiKeyValue); - var apiKeyPrefix = ""; - if (Configuration.ApiKeyPrefix.TryGetValue (apiKeyIdentifier, out apiKeyPrefix)) - return apiKeyPrefix + " " + apiKeyValue; - else - return apiKeyValue; - } - - /// - /// Update parameters based on authentication. - /// - /// Query parameters. - /// Header parameters. - /// Authentication settings. - public void UpdateParamsForAuth(Dictionary queryParams, Dictionary headerParams, string[] authSettings) - { - if (authSettings == null || authSettings.Length == 0) - return; - - foreach (string auth in authSettings) - { - // determine which one to use - switch(auth) - { - case "api_key": - headerParams["api_key"] = GetApiKeyWithPrefix("api_key"); - - break; - case "petstore_auth": - - //TODO support oauth - break; - default: - //TODO show warning about security definition not found - break; - } - } - } - - /// - /// Encode string in base64 format. - /// - /// String to be encoded. - /// Encoded string. - public static string Base64Encode(string text) - { - var textByte = System.Text.Encoding.UTF8.GetBytes(text); - return System.Convert.ToBase64String(textByte); - } - - /// - /// Dynamically cast the object into target type. - /// - /// Object to be casted - /// Target type - /// Casted object - public static Object ConvertType(Object fromObject, Type toObject) { - return Convert.ChangeType(fromObject, toObject); - } - - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs deleted file mode 100644 index 7985897b93e..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace Org.OpenAPITools.Client { - /// - /// API Exception - /// - public class ApiException : Exception { - /// - /// Gets or sets the error code (HTTP status code) - /// - /// The error code (HTTP status code). - public int ErrorCode { get; set; } - - /// - /// Gets or sets the error content (body json object) - /// - /// The error content (Http response body). - public Object ErrorContent { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public ApiException() {} - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - public ApiException(int errorCode, string message) : base(message) { - this.ErrorCode = errorCode; - } - - /// - /// Initializes a new instance of the class. - /// - /// HTTP status code. - /// Error message. - /// Error content. - public ApiException(int errorCode, string message, Object errorContent = null) : base(message) { - this.ErrorCode = errorCode; - this.ErrorContent = errorContent; - } - - } - -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs deleted file mode 100644 index 7546607fa99..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Reflection; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace Org.OpenAPITools.Client -{ - /// - /// Represents a set of configuration settings - /// - public class Configuration - { - - /// - /// Version of the package. - /// - /// Version of the package. - public const string Version = "1.0.0"; - - /// - /// Gets or sets the default API client for making HTTP calls. - /// - /// The API client. - public static ApiClient DefaultApiClient = new ApiClient(); - - /// - /// Gets or sets the username (HTTP basic authentication). - /// - /// The username. - public static String Username { get; set; } - - /// - /// Gets or sets the password (HTTP basic authentication). - /// - /// The password. - public static String Password { get; set; } - - /// - /// Gets or sets the API key based on the authentication name. - /// - /// The API key. - public static Dictionary ApiKey = new Dictionary(); - - /// - /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. - /// - /// The prefix of the API key. - public static Dictionary ApiKeyPrefix = new Dictionary(); - - private static string _tempFolderPath = Path.GetTempPath(); - - /// - /// Gets or sets the temporary folder path to store the files downloaded from the server. - /// - /// Folder path. - public static String TempFolderPath - { - get { return _tempFolderPath; } - - set - { - if (String.IsNullOrEmpty(value)) - { - _tempFolderPath = value; - return; - } - - // create the directory if it does not exist - if (!Directory.Exists(value)) - Directory.CreateDirectory(value); - - // check if the path contains directory separator at the end - if (value[value.Length - 1] == Path.DirectorySeparatorChar) - _tempFolderPath = value; - else - _tempFolderPath = value + Path.DirectorySeparatorChar; - } - } - - private const string ISO8601_DATETIME_FORMAT = "o"; - - private static string _dateTimeFormat = ISO8601_DATETIME_FORMAT; - - /// - /// Gets or sets the date time format used when serializing in the ApiClient - /// By default, it's set to ISO 8601 - "o", for others see: - /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// No validation is done to ensure that the string you're providing is valid - /// - /// The DateTimeFormat string - public static String DateTimeFormat - { - get - { - return _dateTimeFormat; - } - set - { - if (string.IsNullOrEmpty(value)) - { - // Never allow a blank or null string, go back to the default - _dateTimeFormat = ISO8601_DATETIME_FORMAT; - return; - } - - // Caution, no validation when you choose date time format other than ISO 8601 - // Take a look at the above links - _dateTimeFormat = value; - } - } - - /// - /// Returns a string with essential information for debugging. - /// - public static String ToDebugReport() - { - String report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; - report += " OS: " + Environment.OSVersion + "\n"; - report += " .NET Framework Version: " + Assembly - .GetExecutingAssembly() - .GetReferencedAssemblies() - .Where(x => x.Name == "System.Core").First().Version.ToString() + "\n"; - report += " Version of the API: 1.0.0\n"; - report += " SDK Package Version: 1.0.0\n"; - - return report; - } - } -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs deleted file mode 100644 index 648aaeba5b1..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// Describes the result of uploading an image resource - /// - [DataContract] - public class ApiResponse { - /// - /// Gets or Sets Code - /// - [DataMember(Name="code", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "code")] - public int? Code { get; set; } - - /// - /// Gets or Sets Type - /// - [DataMember(Name="type", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or Sets Message - /// - [DataMember(Name="message", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class ApiResponse {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs deleted file mode 100644 index 847279502e2..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A category for a pet - /// - [DataContract] - public class Category { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs deleted file mode 100644 index c19511ca3f8..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// An order for a pets from the pet store - /// - [DataContract] - public class Order { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets PetId - /// - [DataMember(Name="petId", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "petId")] - public long? PetId { get; set; } - - /// - /// Gets or Sets Quantity - /// - [DataMember(Name="quantity", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "quantity")] - public int? Quantity { get; set; } - - /// - /// Gets or Sets ShipDate - /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "shipDate")] - public DateTime? ShipDate { get; set; } - - /// - /// Order Status - /// - /// Order Status - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or Sets Complete - /// - [DataMember(Name="complete", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "complete")] - public bool? Complete { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Order {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PetId: ").Append(PetId).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); - sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Complete: ").Append(Complete).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs deleted file mode 100644 index 71ec62aa9c8..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A pet for sale in the pet store - /// - [DataContract] - public class Pet { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name="category", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "category")] - public Category Category { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or Sets PhotoUrls - /// - [DataMember(Name="photoUrls", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "photoUrls")] - public List PhotoUrls { get; set; } - - /// - /// Gets or Sets Tags - /// - [DataMember(Name="tags", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "tags")] - public List Tags { get; set; } - - /// - /// pet status in the store - /// - /// pet status in the store - [DataMember(Name="status", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs deleted file mode 100644 index 6399695a50a..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A tag for a pet - /// - [DataContract] - public class Tag { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class Tag {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs deleted file mode 100644 index c6af059dcdc..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Model { - - /// - /// A User who is purchasing from the pet store - /// - [DataContract] - public class User { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "id")] - public long? Id { get; set; } - - /// - /// Gets or Sets Username - /// - [DataMember(Name="username", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } - - /// - /// Gets or Sets FirstName - /// - [DataMember(Name="firstName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "firstName")] - public string FirstName { get; set; } - - /// - /// Gets or Sets LastName - /// - [DataMember(Name="lastName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "lastName")] - public string LastName { get; set; } - - /// - /// Gets or Sets Email - /// - [DataMember(Name="email", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "email")] - public string Email { get; set; } - - /// - /// Gets or Sets Password - /// - [DataMember(Name="password", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// Gets or Sets Phone - /// - [DataMember(Name="phone", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "phone")] - public string Phone { get; set; } - - /// - /// User Status - /// - /// User Status - [DataMember(Name="userStatus", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "userStatus")] - public int? UserStatus { get; set; } - - - /// - /// Get the string presentation of the object - /// - /// String presentation of the object - public override string ToString() { - var sb = new StringBuilder(); - sb.Append("class User {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Username: ").Append(Username).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Get the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - -} -} diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config deleted file mode 100644 index 7b9cf186303..00000000000 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/vendor/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES index 733114e3828..838976ae425 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/Activity.md docs/ActivityOutputElementRepresentation.md @@ -50,6 +51,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/List.md +docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -84,6 +86,8 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -164,6 +168,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -196,6 +201,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md index 46d61ab2f54..786ac93aab8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md @@ -106,6 +106,7 @@ 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 | *DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello *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 | @@ -192,6 +193,7 @@ Class | Method | HTTP request | Description - [Model.HealthCheckResult](docs/HealthCheckResult.md) - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Model.List](docs/List.md) + - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -224,6 +226,8 @@ Class | Method | HTTP request | Description - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/api/openapi.yaml similarity index 69% rename from samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml rename to samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/api/openapi.yaml index 658d8a96b30..7942c294dac 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -9,7 +9,30 @@ info: title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io:80/v2 +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable tags: - description: Everything about your Pets name: pet @@ -18,81 +41,77 @@ tags: - description: Operations about user name: user paths: - /pet: - post: - operationId: addPet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + /hello: + get: + description: Hello + operationId: Hello responses: "200": - content: {} - description: successful operation + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: "405": - content: {} description: Invalid input security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: - "200": - content: {} - description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - description: Status values that need to be considered for filter + - deprecated: true + description: Status values that need to be considered for filter explode: false in: query name: status @@ -122,18 +141,15 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Finds Pets by status tags: - pet - x-accepts: application/json - x-tags: - - tag: pet /pet/findByTags: get: deprecated: true @@ -150,7 +166,6 @@ paths: items: type: string type: array - uniqueItems: true style: form responses: "200": @@ -160,48 +175,45 @@ paths: items: $ref: '#/components/schemas/Pet' type: array - uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array - uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Finds Pets by tags tags: - pet - x-accepts: application/json - x-tags: - - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: - "200": - content: {} - description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -210,20 +222,19 @@ paths: summary: Deletes a pet tags: - pet - x-accepts: application/json - x-tags: - - tag: pet get: description: Returns a single pet operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,29 +246,27 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] summary: Find pet by ID tags: - pet - x-accepts: application/json - x-tags: - - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +274,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -274,21 +282,20 @@ paths: summary: Updates a pet in the store with form data tags: - pet - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -308,10 +315,6 @@ paths: summary: uploads an image tags: - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet /store/inventory: get: description: Returns a map of status codes to quantities @@ -331,15 +334,13 @@ paths: summary: Returns pet inventories by status tags: - store - x-accepts: application/json - x-tags: - - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,16 +356,10 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: store /store/order/{order_id}: delete: description: For valid response try integer IDs with value < 1000. Anything @@ -372,30 +367,28 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: - store - x-accepts: application/json - x-tags: - - tag: store get: description: For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +397,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,104 +409,74 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: - store - x-accepts: application/json - x-tags: - - tag: store /user: post: description: This can only be done by the logged in user. operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,69 +490,66 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: - user - x-accepts: application/json - x-tags: - - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: - user - x-accepts: application/json - x-tags: - - tag: user /user/{username}: delete: description: This can only be done by the logged in user. operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: - user - x-accepts: application/json - x-tags: - - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,60 +561,45 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: - user - x-accepts: application/json - x-tags: - - tag: user put: description: This can only be done by the logged in user. operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /fake_classname_test: patch: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,62 +612,70 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ /fake: delete: description: Fake endpoint to test group parameters (optional) operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong + security: + - bearer_test: [] summary: Fake endpoint to test group parameters (optional) tags: - fake x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake get: description: To test enum parameters operationId: testEnumParameters @@ -730,6 +684,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +695,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +706,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +722,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +733,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,28 +765,17 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake patch: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,55 +786,42 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake post: - description: |- + description: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] - summary: |- + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake /fake/outer/number: post: description: Test serialization of outer number types operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,22 +831,26 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/outer/string: post: description: Test serialization of outer string types operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,22 +860,16 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/outer/boolean: post: description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,22 +879,16 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/outer/composite: post: description: Test serialization of object with outer number type operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,33 +898,24 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,25 +928,21 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,64 +951,15 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - /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-content-type: application/xml - x-accepts: application/json - x-tags: - - tag: fake /another-fake/dummy: patch: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,11 +970,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? /fake/body-with-file-schema: put: description: "For this test, the body for this request much reference a schema\ @@ -1114,21 +983,15 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/test-query-parameters: put: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1000,17 @@ paths: type: string type: array style: form - - in: query + - explode: false + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1172,36 +1038,37 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake - x-accepts: application/json - x-tags: - - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' description: successful operation security: - petstore_auth: @@ -1210,18 +1077,95 @@ paths: summary: uploads an image (required) tags: - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string Order: example: petId: 6 quantity: 1 id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 + shipDate: 2020-02-02T20:20:20.000222Z complete: false status: placed properties: @@ -1235,6 +1179,7 @@ components: format: int32 type: integer shipDate: + example: 2020-02-02T20:20:20.000222Z format: date-time type: string status: @@ -1272,9 +1217,13 @@ components: lastName: lastName password: password userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" phone: phone + objectWithNoDeclaredProps: "{}" id: 0 + anyTypePropNullable: "" email: email + anyTypeProp: "" username: username properties: id: @@ -1297,6 +1246,25 @@ components: description: User Status format: int32 type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true type: object xml: name: User @@ -1343,7 +1311,6 @@ components: items: type: string type: array - uniqueItems: true xml: name: photoUrl wrapped: true @@ -1381,21 +1348,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1373,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1383,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1390,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1442,11 +1397,12 @@ components: Cat: allOf: - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' + Address: + additionalProperties: + type: integer + type: object Animal: discriminator: propertyName: className @@ -1468,18 +1424,30 @@ components: integer: maximum: 100 minimum: 10 + multipleOf: 2 type: integer int32: format: int32 maximum: 200 minimum: 20 type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true int64: format: int64 type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true number: maximum: 543.2 minimum: 32.1 + multipleOf: 32.5 type: number float: format: float @@ -1491,20 +1459,24 @@ components: maximum: 123.4 minimum: 67.8 type: number + decimal: + format: number + type: string 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: + example: 2020-02-02 format: date type: string dateTime: + example: 2007-12-03T10:15:30+01:00 format: date-time type: string uuid: @@ -1516,8 +1488,14 @@ components: maxLength: 64 minLength: 10 type: string - BigDecimal: - format: number + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1552,6 +1530,11 @@ components: - -1 format: int32 type: integer + enum_integer_only: + enum: + - 2 + - -2 + type: integer enum_number: enum: - 1.1 @@ -1560,120 +1543,52 @@ components: type: number outerEnum: $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' required: - enum_string_required type: object AdditionalPropertiesClass: properties: - map_string: + map_property: additionalProperties: type: string 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: + map_of_map_property: additionalProperties: additionalProperties: type: string type: object type: object - map_map_anytype: + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: additionalProperties: - additionalProperties: - properties: {} - type: object - type: object + type: string type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string type: object MixedPropertiesAndAdditionalPropertiesClass: properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string uuid: format: uuid type: string @@ -1780,6 +1695,8 @@ components: JustNumber: type: number type: object + x-cls-compliant: true + x-com-visible: true ArrayOfNumberOnly: properties: ArrayNumber: @@ -1816,7 +1733,28 @@ components: - placed - approved - delivered + nullable: true type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer OuterComposite: example: my_string: my_string @@ -1866,243 +1804,405 @@ components: description: Test capitalization type: string type: object - TypeHolderDefault: + _special_model.name_: properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: + $special[property.name]: + format: int64 type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what + _special_model.name_: 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 - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - 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: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - 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: - 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: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - 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: - namespace: http://a.com/schema - prefix: pre + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2246,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2197,7 +2296,9 @@ components: format: date type: string dateTime: + default: 2010-02-01T10:20:10.11111+01:00 description: None + example: 2020-02-02T20:20:20.22222Z format: date-time type: string password: @@ -2239,6 +2340,16 @@ components: required: - requiredFile type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' Dog_allOf: properties: breed: @@ -2251,15 +2362,16 @@ components: type: boolean type: object example: null - BigCat_allOf: + ChildCat_allOf: properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars + name: type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true type: object example: null securitySchemes: @@ -2282,4 +2394,11 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/DefaultApi.md index 265fec1a6f9..72d1733f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient-ConditionalSerialization/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FormatTest.md index 39a70be7ad4..1664a9d7c72 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FormatTest.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/LiteralStringClass.md new file mode 100644 index 00000000000..6d3e0d50c1f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..0e5568637b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..7213b3ca8d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..74dc17b9f4a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -0,0 +1,77 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..4def0dcda9c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e9df66daf2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 06b106b96d3..8baebd4ea54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs index 0ae306612df..1b487bc9248 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -65,6 +65,27 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse GetCountryWithHttpInfo(string country, int operationIndex = 0); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + List Hello(int operationIndex = 0); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + ApiResponse> HelloWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -122,6 +143,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -510,5 +554,131 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + public List Hello(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = HelloWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + public Org.OpenAPITools.Client.ApiResponse> HelloWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/hello", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await HelloWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/hello", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index 8b0ba33499b..f64cfebe67d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); + var response = await client.PostAsync(request).ConfigureAwait(false); return $"{response.TokenType} {response.AccessToken}"; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ClientUtils.cs index 608bdbc195a..85ec4341271 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs index 62b70440f67..637dce49d4c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 7395af5fbf1..e1920e20d8a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 4c371eb457b..b005c28e326 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -391,7 +391,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs index 6d4cbf3cb87..652a0df9259 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className = default(string), string color = @"red") { // to ensure "className" is required (not null) if (className == null) @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs index 5b0f3df7b73..e1f52990262 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -212,7 +212,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs index 11b480ef63b..d89f2a65e76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs @@ -180,17 +180,17 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs index f856ba9072c..b94dcf102a9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 7ad65647a78..193c10bb3f8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 4c42444cc8c..f8dad465958 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs index 6914c6b657a..75497d4a83f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs index 48f7f67df9f..cb351f94bb2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs index 084e55f92a0..e5c63d320e9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs index 8262f21f86c..8dcb3eb95cb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs index dbf1d37b035..c9711efcee0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs @@ -321,7 +321,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs index a9643944cca..6619281fd6c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// declawed. /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = @"Cat", string color = @"red") : base(className, color) { this._Declawed = declawed; if (this.Declawed != null) @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/CatAllOf.cs index d97b2bc88a5..5b5f9e03d73 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs index dd09bcdc936..ffe96e0f991 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + public Category(long id = default(long), string name = @"default-name") { // to ensure "name" is required (not null) if (name == null) @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs index c7201b1c4ae..43796f651f4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs @@ -191,7 +191,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index 81bcbec5a90..a6ebaf37143 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs index f5c0e910e73..acfee052180 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 21713f5742a..c280a8974d5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs index c4b7fbf1410..d3c569e876a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 0b464c99403..1d394e4a98c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -49,6 +49,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [JsonConverter(typeof(OpenAPIDateConverter))] [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] public DateTime DateOnlyProperty @@ -146,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 2e0a59ec8e2..2fc41119de4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs index 268c386ae2e..f360181923f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// breed. /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = @"Dog", string color = @"red") : base(className, color) { this._Breed = breed; if (this.Breed != null) @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DogAllOf.cs index e462064842a..f6e4e068c9b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs index b0a657793d9..f52bb31aab2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs @@ -239,7 +239,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs index e63ee79f3ea..67d6845f5e4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs index 6d8fb03b7f5..7470b9876ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs @@ -526,7 +526,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 153f0fff2bd..72beac2a696 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs index 6f16bbf6964..28c03a1168e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 333c81d6505..eea3c2b0d8c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs index dcbf1143534..05dbdea1c07 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// bar (default to "bar"). - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { this.AdditionalProperties = new Dictionary(); } @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 121fba3414f..93db2191545 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs index 4787323d3a9..bd57007c09a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs @@ -45,7 +45,9 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// unsignedInteger. /// int64. + /// unsignedLong. /// number (required). /// _float. /// _double. @@ -59,7 +61,7 @@ namespace Org.OpenAPITools.Model /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { this._Number = number; // to ensure "_byte" is required (not null) @@ -85,11 +87,21 @@ namespace Org.OpenAPITools.Model { this._flagInt32 = true; } + this._UnsignedInteger = unsignedInteger; + if (this.UnsignedInteger != null) + { + this._flagUnsignedInteger = true; + } this._Int64 = int64; if (this.Int64 != null) { this._flagInt64 = true; } + this._UnsignedLong = unsignedLong; + if (this.UnsignedLong != null) + { + this._flagUnsignedLong = true; + } this._Float = _float; if (this.Float != null) { @@ -187,6 +199,30 @@ namespace Org.OpenAPITools.Model return _flagInt32; } /// + /// Gets or Sets UnsignedInteger + /// + [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] + public uint UnsignedInteger + { + get{ return _UnsignedInteger;} + set + { + _UnsignedInteger = value; + _flagUnsignedInteger = true; + } + } + private uint _UnsignedInteger; + private bool _flagUnsignedInteger; + + /// + /// Returns false as UnsignedInteger should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeUnsignedInteger() + { + return _flagUnsignedInteger; + } + /// /// Gets or Sets Int64 /// [DataMember(Name = "int64", EmitDefaultValue = false)] @@ -211,6 +247,30 @@ namespace Org.OpenAPITools.Model return _flagInt64; } /// + /// Gets or Sets UnsignedLong + /// + [DataMember(Name = "unsigned_long", EmitDefaultValue = false)] + public ulong UnsignedLong + { + get{ return _UnsignedLong;} + set + { + _UnsignedLong = value; + _flagUnsignedLong = true; + } + } + private ulong _UnsignedLong; + private bool _flagUnsignedLong; + + /// + /// Returns false as UnsignedLong should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeUnsignedLong() + { + return _flagUnsignedLong; + } + /// /// Gets or Sets Number /// [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] @@ -381,6 +441,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [JsonConverter(typeof(OpenAPIDateConverter))] [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] public DateTime Date @@ -406,6 +467,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [DataMember(Name = "dateTime", EmitDefaultValue = false)] public DateTime DateTime { @@ -430,6 +492,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { @@ -541,7 +604,9 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); @@ -600,7 +665,9 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); @@ -654,7 +721,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) @@ -680,6 +747,18 @@ namespace Org.OpenAPITools.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + // Number (decimal) maximum if (this.Number > (decimal)543.2) { @@ -717,7 +796,7 @@ namespace Org.OpenAPITools.Model } // String (string) pattern - Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); @@ -736,14 +815,14 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 4b26f24f31c..e188accf045 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 52099a7095e..2d4a1cd404f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 57cfec9a09d..be78dcda54e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index d20bedcd923..9506ad4eeb4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs index 872d8d8b8fd..355b11be2d0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..ddfb8b005d2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,179 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + [DataContract(Name = "LiteralStringClass")] + public partial class LiteralStringClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username"). + /// unescapedLiteralString (default to "C:\Users\username"). + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [DataMember(Name = "escapedLiteralString", EmitDefaultValue = false)] + public string EscapedLiteralString + { + get{ return _EscapedLiteralString;} + set + { + _EscapedLiteralString = value; + _flagEscapedLiteralString = true; + } + } + private string _EscapedLiteralString; + private bool _flagEscapedLiteralString; + + /// + /// Returns false as EscapedLiteralString should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeEscapedLiteralString() + { + return _flagEscapedLiteralString; + } + /// + /// Gets or Sets UnescapedLiteralString + /// + [DataMember(Name = "unescapedLiteralString", EmitDefaultValue = false)] + public string UnescapedLiteralString + { + get{ return _UnescapedLiteralString;} + set + { + _UnescapedLiteralString = value; + _flagUnescapedLiteralString = true; + } + } + private string _UnescapedLiteralString; + private bool _flagUnescapedLiteralString; + + /// + /// Returns false as UnescapedLiteralString should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeUnescapedLiteralString() + { + return _flagUnescapedLiteralString; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as LiteralStringClass).AreEqual; + } + + /// + /// Returns true if LiteralStringClass instances are equal + /// + /// Instance of LiteralStringClass to be compared + /// Boolean + public bool Equals(LiteralStringClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EscapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.EscapedLiteralString.GetHashCode(); + } + if (this.UnescapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.UnescapedLiteralString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs index 7e7093e3d0f..a511fb8d51d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs @@ -270,7 +270,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index de88a24f150..219e8b48501 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -250,10 +250,10 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs index 1491add2e7b..e878c99d745 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs index 50543b26323..354d9791fc4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs index bfda0b00520..aec6d2cbb30 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs index 25779b92e2d..fb4d4412478 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs @@ -520,7 +520,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableGuidClass.cs index a0b744f5a67..158ba22ebd8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -49,6 +49,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = true)] public Guid? Uuid { @@ -145,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs index 585e3eadb7f..961b7abff84 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -145,7 +145,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index de9baa3fe2f..4b0cb91fae1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -250,7 +250,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs index 4dcea3ebe1d..e01f5fe1ec0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs @@ -200,6 +200,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [DataMember(Name = "shipDate", EmitDefaultValue = false)] public DateTime ShipDate { @@ -330,7 +331,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs index cf4ea1fc9b6..aa9774cb4db 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -209,7 +209,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs index 49bed679864..769c3612f3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// petType (required) (default to "ParentPet"). - public ParentPet(string petType = "ParentPet") : base(petType) + public ParentPet(string petType = @"ParentPet") : base(petType) { this.AdditionalProperties = new Dictionary(); } @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs index 9fea569bb1e..dcb61fb9d47 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs @@ -191,6 +191,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { @@ -354,7 +355,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 2b8f0a9cd3f..e0b72eab7ee 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index f5f1b145160..384dd874ec1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs index 709c50b9351..8ebfb712680 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 0577d1ddf73..ca4361588ff 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs index 9f5c4295bf3..10ec59fceb6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 318daa0c8aa..8902d281127 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs index 9a4d9fc482a..92fa55597f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs index cb9f2aa96f5..7e585a09d97 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..649c68cec4a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,154 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + [DataContract(Name = "TestCollectionEndingWithWordList")] + public partial class TestCollectionEndingWithWordList : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public TestCollectionEndingWithWordList(string value = default(string)) + { + this._Value = value; + if (this.Value != null) + { + this._flagValue = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value + { + get{ return _Value;} + set + { + _Value = value; + _flagValue = true; + } + } + private string _Value; + private bool _flagValue; + + /// + /// Returns false as Value should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeValue() + { + return _flagValue; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordList).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordList instances are equal + /// + /// Instance of TestCollectionEndingWithWordList to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordList input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..ae18b47cd80 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,154 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + [DataContract(Name = "TestCollectionEndingWithWordListObject")] + public partial class TestCollectionEndingWithWordListObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList. + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList = default(List)) + { + this._TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + if (this.TestCollectionEndingWithWordList != null) + { + this._flagTestCollectionEndingWithWordList = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [DataMember(Name = "TestCollectionEndingWithWordList", EmitDefaultValue = false)] + public List TestCollectionEndingWithWordList + { + get{ return _TestCollectionEndingWithWordList;} + set + { + _TestCollectionEndingWithWordList = value; + _flagTestCollectionEndingWithWordList = true; + } + } + private List _TestCollectionEndingWithWordList; + private bool _flagTestCollectionEndingWithWordList; + + /// + /// Returns false as TestCollectionEndingWithWordList should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeTestCollectionEndingWithWordList() + { + return _flagTestCollectionEndingWithWordList; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordListObject).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordListObject instances are equal + /// + /// Instance of TestCollectionEndingWithWordListObject to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordListObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TestCollectionEndingWithWordList != null) + { + hashCode = (hashCode * 59) + this.TestCollectionEndingWithWordList.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs index d26983a6d97..9032c9cdbb0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs index 5eb84346ec8..72b23434c90 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs @@ -529,7 +529,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs index d844993eb20..91d3f6b6c87 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs @@ -218,7 +218,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs index 615d245b478..160aefdde05 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 242934b6642..8d6a4b78ae0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES index ff892217def..35efa408b97 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/apis/AnotherFakeApi.md docs/apis/DefaultApi.md @@ -53,6 +54,7 @@ docs/models/HasOnlyReadOnly.md docs/models/HealthCheckResult.md docs/models/IsoscelesTriangle.md docs/models/List.md +docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -85,6 +87,8 @@ docs/models/ShapeOrNull.md docs/models/SimpleQuadrilateral.md docs/models/SpecialModelName.md docs/models/Tag.md +docs/models/TestCollectionEndingWithWordList.md +docs/models/TestCollectionEndingWithWordListObject.md docs/models/Triangle.md docs/models/TriangleInterface.md docs/models/User.md @@ -170,6 +174,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -202,6 +207,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml similarity index 69% rename from samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml rename to samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml index 658d8a96b30..7942c294dac 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -9,7 +9,30 @@ info: title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io:80/v2 +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable tags: - description: Everything about your Pets name: pet @@ -18,81 +41,77 @@ tags: - description: Operations about user name: user paths: - /pet: - post: - operationId: addPet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + /hello: + get: + description: Hello + operationId: Hello responses: "200": - content: {} - description: successful operation + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: "405": - content: {} description: Invalid input security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: - "200": - content: {} - description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - description: Status values that need to be considered for filter + - deprecated: true + description: Status values that need to be considered for filter explode: false in: query name: status @@ -122,18 +141,15 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Finds Pets by status tags: - pet - x-accepts: application/json - x-tags: - - tag: pet /pet/findByTags: get: deprecated: true @@ -150,7 +166,6 @@ paths: items: type: string type: array - uniqueItems: true style: form responses: "200": @@ -160,48 +175,45 @@ paths: items: $ref: '#/components/schemas/Pet' type: array - uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array - uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets summary: Finds Pets by tags tags: - pet - x-accepts: application/json - x-tags: - - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: - "200": - content: {} - description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -210,20 +222,19 @@ paths: summary: Deletes a pet tags: - pet - x-accepts: application/json - x-tags: - - tag: pet get: description: Returns a single pet operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,29 +246,27 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] summary: Find pet by ID tags: - pet - x-accepts: application/json - x-tags: - - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +274,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -274,21 +282,20 @@ paths: summary: Updates a pet in the store with form data tags: - pet - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -308,10 +315,6 @@ paths: summary: uploads an image tags: - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet /store/inventory: get: description: Returns a map of status codes to quantities @@ -331,15 +334,13 @@ paths: summary: Returns pet inventories by status tags: - store - x-accepts: application/json - x-tags: - - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,16 +356,10 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: store /store/order/{order_id}: delete: description: For valid response try integer IDs with value < 1000. Anything @@ -372,30 +367,28 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: - store - x-accepts: application/json - x-tags: - - tag: store get: description: For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +397,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,104 +409,74 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: - store - x-accepts: application/json - x-tags: - - tag: store /user: post: description: This can only be done by the logged in user. operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,69 +490,66 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: - user - x-accepts: application/json - x-tags: - - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: - user - x-accepts: application/json - x-tags: - - tag: user /user/{username}: delete: description: This can only be done by the logged in user. operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: - user - x-accepts: application/json - x-tags: - - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,60 +561,45 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: - user - x-accepts: application/json - x-tags: - - tag: user put: description: This can only be done by the logged in user. operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /fake_classname_test: patch: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,62 +612,70 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ /fake: delete: description: Fake endpoint to test group parameters (optional) operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong + security: + - bearer_test: [] summary: Fake endpoint to test group parameters (optional) tags: - fake x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake get: description: To test enum parameters operationId: testEnumParameters @@ -730,6 +684,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +695,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +706,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +722,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +733,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,28 +765,17 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake patch: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,55 +786,42 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake post: - description: |- + description: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] - summary: |- + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake /fake/outer/number: post: description: Test serialization of outer number types operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,22 +831,26 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/outer/string: post: description: Test serialization of outer string types operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,22 +860,16 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/outer/boolean: post: description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,22 +879,16 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/outer/composite: post: description: Test serialization of object with outer number type operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,33 +898,24 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,25 +928,21 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/body-with-query-params: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,64 +951,15 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - /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-content-type: application/xml - x-accepts: application/json - x-tags: - - tag: fake /another-fake/dummy: patch: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,11 +970,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? /fake/body-with-file-schema: put: description: "For this test, the body for this request much reference a schema\ @@ -1114,21 +983,15 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/test-query-parameters: put: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1000,17 @@ paths: type: string type: array style: form - - in: query + - explode: false + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1172,36 +1038,37 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake - x-accepts: application/json - x-tags: - - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' description: successful operation security: - petstore_auth: @@ -1210,18 +1077,95 @@ paths: summary: uploads an image (required) tags: - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string Order: example: petId: 6 quantity: 1 id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 + shipDate: 2020-02-02T20:20:20.000222Z complete: false status: placed properties: @@ -1235,6 +1179,7 @@ components: format: int32 type: integer shipDate: + example: 2020-02-02T20:20:20.000222Z format: date-time type: string status: @@ -1272,9 +1217,13 @@ components: lastName: lastName password: password userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" phone: phone + objectWithNoDeclaredProps: "{}" id: 0 + anyTypePropNullable: "" email: email + anyTypeProp: "" username: username properties: id: @@ -1297,6 +1246,25 @@ components: description: User Status format: int32 type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true type: object xml: name: User @@ -1343,7 +1311,6 @@ components: items: type: string type: array - uniqueItems: true xml: name: photoUrl wrapped: true @@ -1381,21 +1348,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1373,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1383,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1390,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1442,11 +1397,12 @@ components: Cat: allOf: - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' + Address: + additionalProperties: + type: integer + type: object Animal: discriminator: propertyName: className @@ -1468,18 +1424,30 @@ components: integer: maximum: 100 minimum: 10 + multipleOf: 2 type: integer int32: format: int32 maximum: 200 minimum: 20 type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true int64: format: int64 type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true number: maximum: 543.2 minimum: 32.1 + multipleOf: 32.5 type: number float: format: float @@ -1491,20 +1459,24 @@ components: maximum: 123.4 minimum: 67.8 type: number + decimal: + format: number + type: string 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: + example: 2020-02-02 format: date type: string dateTime: + example: 2007-12-03T10:15:30+01:00 format: date-time type: string uuid: @@ -1516,8 +1488,14 @@ components: maxLength: 64 minLength: 10 type: string - BigDecimal: - format: number + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1552,6 +1530,11 @@ components: - -1 format: int32 type: integer + enum_integer_only: + enum: + - 2 + - -2 + type: integer enum_number: enum: - 1.1 @@ -1560,120 +1543,52 @@ components: type: number outerEnum: $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' required: - enum_string_required type: object AdditionalPropertiesClass: properties: - map_string: + map_property: additionalProperties: type: string 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: + map_of_map_property: additionalProperties: additionalProperties: type: string type: object type: object - map_map_anytype: + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: additionalProperties: - additionalProperties: - properties: {} - type: object - type: object + type: string type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string type: object MixedPropertiesAndAdditionalPropertiesClass: properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string uuid: format: uuid type: string @@ -1780,6 +1695,8 @@ components: JustNumber: type: number type: object + x-cls-compliant: true + x-com-visible: true ArrayOfNumberOnly: properties: ArrayNumber: @@ -1816,7 +1733,28 @@ components: - placed - approved - delivered + nullable: true type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer OuterComposite: example: my_string: my_string @@ -1866,243 +1804,405 @@ components: description: Test capitalization type: string type: object - TypeHolderDefault: + _special_model.name_: properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: + $special[property.name]: + format: int64 type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what + _special_model.name_: 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 - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - 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: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - 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: - 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: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - 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: - namespace: http://a.com/schema - prefix: pre + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2246,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2197,7 +2296,9 @@ components: format: date type: string dateTime: + default: 2010-02-01T10:20:10.11111+01:00 description: None + example: 2020-02-02T20:20:20.22222Z format: date-time type: string password: @@ -2239,6 +2340,16 @@ components: required: - requiredFile type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' Dog_allOf: properties: breed: @@ -2251,15 +2362,16 @@ components: type: boolean type: object example: null - BigCat_allOf: + ChildCat_allOf: properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars + name: type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true type: object example: null securitySchemes: @@ -2282,4 +2394,11 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md index 82d8c6cb2c7..fe3740c7b6e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md index 4e34a6d18b3..b176ed40f3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/FormatTest.md @@ -19,6 +19,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **StringProperty** | **string** | | [optional] +**UnsignedInteger** | **uint** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [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/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/LiteralStringClass.md new file mode 100644 index 00000000000..78202190965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..5c5eb22d9a8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..cfa933cc576 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs index d79076dcd63..bfdfc0d172a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -60,5 +60,25 @@ namespace Org.OpenAPITools.Test.Api var response = await _instance.FooGetAsync(); Assert.IsType(response); } + + /// + /// Test GetCountry + /// + [Fact (Skip = "not implemented")] + public async Task GetCountryAsyncTest() + { + string country = default; + await _instance.GetCountryAsync(country); + } + + /// + /// Test Hello + /// + [Fact (Skip = "not implemented")] + public async Task HelloAsyncTest() + { + var response = await _instance.HelloAsync(); + Assert.IsType>(response); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs index 174a7e333af..94e3f6fe7fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityTests.cs index c7479a3c343..03049757efe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs index 95bd1593503..92c9b0708a9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AnimalTests.cs index 8c38ac47af7..c4b0b209a91 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AnimalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs index a2a9a2d49de..9b85782ecd4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs index 0610780d65d..d52d7930bb2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleTests.cs index e0bd59e7732..6e10936831f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs index 8f046a0bf6b..14b87779757 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs index 53b2fe30fdb..82b117e28c2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs index df87ba3aaaa..d0dea235061 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs index 6f31ba2029b..f86e93c73ca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaTests.cs index 6cb6c62ffd0..57083de2697 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs index 9798a17577b..62e066a4fc3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs index b84c7c85a7d..b2dffa3c803 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs index 3498bb0c152..a59e2faf42d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatTests.cs index 402a476d079..506c917ef4d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CategoryTests.cs index 822f8241fa0..d4f8fa6bdb1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CategoryTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs index d4de4c47417..d43ae8711b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs index f1b0aa1005c..4deace3c3a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs index 2e6c120d8fa..ba942072dd7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs index 3f2f96e73a1..93bb0120f1d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs index 087d38674bb..f089b42b81d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs index f98989439ed..5825715de0c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs index 85ecbfdda55..607a7db80ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs index 1e86d761507..0b64ef242be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogTests.cs index ef2eabfca31..164893d05a6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DrawingTests.cs index c38867cb5ae..81cb6fa4013 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DrawingTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs index ee3d000f32f..f7da9372776 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs index e2fc2d02282..8b152665a90 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs index 60e3aca92bd..8cff9853a04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs index 9ab78a59779..ccf950daf3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs index 9836a779bf0..ac711bc52d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileTests.cs index 4f0e7079bc8..6ddf36e3b3f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs index b7313941a69..3a34eb830b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooTests.cs index c0bdf85f9b0..583fec1a869 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index d3a978bdc4c..cee4ce9c80f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; @@ -176,6 +175,22 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'StringProperty' } /// + /// Test the property 'UnsignedInteger' + /// + [Fact] + public void UnsignedIntegerTest() + { + // TODO unit test for the property 'UnsignedInteger' + } + /// + /// Test the property 'UnsignedLong' + /// + [Fact] + public void UnsignedLongTest() + { + // TODO unit test for the property 'UnsignedLong' + } + /// /// Test the property 'Uuid' /// [Fact] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs index 3ef884e59c6..27433724a6a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitTests.cs index 9ab6b7f2781..ca0d7778511 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs index 036c5641cf4..ae3fb07857b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs index 182cf7350b7..eee8d61e4fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs index d9a07efcf9a..b5cac232be4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs index d29edf5dd10..9a618a94825 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs index 2fed6f0b4cc..60103ce0814 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ListTests.cs index 398a4644921..859c553af6d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ListTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..7e31808e097 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MammalTests.cs index 0889d80a708..f036aec8e7d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MammalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MapTestTests.cs index 0dc95aa6b23..975acebd3bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MapTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs index d94f882e0a2..fd9d3deca41 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; @@ -79,6 +78,14 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'Uuid' } + /// + /// Test the property 'UuidWithPattern' + /// + [Fact] + public void UuidWithPatternTest() + { + // TODO unit test for the property 'UuidWithPattern' + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs index 31f2a754314..09a24ecc6a8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs index 40b3700ce95..973df04edba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NameTests.cs index 523b3e050aa..c2024c83ac2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NameTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs index adf7c14f131..5fab915d647 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs index ed52163e5c2..5f208e16e82 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs index 734d03e5e7a..3476391608d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs index 5db923c1d3f..be8649eda4e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs index 9e9b651f818..2b962665b0c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OrderTests.cs index 10682e72f21..7c83fb4ca0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OrderTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs index 8c176d9f94c..173aa6b07c0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs index 9f6d8b52b6c..1aeee70f3d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs index e51365edb27..1fa418e64f9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs index 36e6a060f97..3225b846de0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs index b38c693d1a1..5474da73214 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs index 34cae43eac1..0d8b6863baf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PetTests.cs index 66cfbf7bdb5..4899ef39cf9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PetTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PigTests.cs index 0e85eabf160..95949c3b099 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs index 98aad34f4b4..cd8ea904c9f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs index 42243bd29c0..c846d9c5661 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs index e15b2c5c749..26c0dcaf06a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs index 7e99972f26e..8ced65980fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReturnTests.cs index 9969564490d..919961faa02 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReturnTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs index cad95d2963c..da3ee273f06 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs index 3129f3775c8..49ae5aa0208 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs index a33da20eda6..4791f74d1a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeTests.cs index b2d995af504..2772e17b595 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs index 0221971c076..d6736b399b6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs index 1a5bb10af80..0efee731657 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TagTests.cs index 92a5f823659..d9390261061 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TagTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..6204d80fb4f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..4068363f13b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs index 924d6b42d7f..ad87002d06e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleTests.cs index 9701da6a541..8942407fa8e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/UserTests.cs index a464c80c84c..6f96a87cdf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/UserTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/WhaleTests.cs index 91a7b21f213..c1403b7f0e7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/WhaleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZebraTests.cs index 08b1c6056c9..b567a8ab958 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZebraTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 96b9fd0c60e..c3b726795f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 6ef3d1665dd..69ad0c187e5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -149,12 +149,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -166,17 +166,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -202,9 +202,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCall123TestSpecialTags(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterCall123TestSpecialTags(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -229,70 +229,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnCall123TestSpecialTags(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; - request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Patch; + httpRequestMessageLocalVar.Method = HttpMethod.Patch; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/another-fake/dummy", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/another-fake/dummy", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCall123TestSpecialTags(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCall123TestSpecialTags(apiResponseLocalVar, modelClient); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCall123TestSpecialTags(e, "/another-fake/dummy", uriBuilder.Path, modelClient); + OnErrorCall123TestSpecialTags(e, "/another-fake/dummy", uriBuilderLocalVar.Path, modelClient); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs index ec823694979..656a95f7ea2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -95,6 +95,38 @@ namespace Org.OpenAPITools.IApi /// Cancellation Token to cancel the request. /// Task of ApiResponse<object?> Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Guid>?>> + Task?>> HelloWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Guid>> + Task> HelloAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Guid>?> + Task?> HelloOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null); } } @@ -180,12 +212,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -196,17 +228,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -222,8 +254,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterFooGet(ApiResponse apiResponse) + /// + protected virtual void AfterFooGet(ApiResponse apiResponseLocalVar) { } @@ -246,57 +278,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnFooGet(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/foo"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/foo"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/foo", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/foo", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFooGet(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFooGet(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFooGet(e, "/foo", uriBuilder.Path); + OnErrorFooGet(e, "/foo", uriBuilderLocalVar.Path); throw; } } @@ -310,12 +342,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -327,17 +359,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -363,9 +395,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetCountry(ApiResponse apiResponse, string country) + protected virtual void AfterGetCountry(ApiResponse apiResponseLocalVar, string country) { } @@ -390,67 +422,196 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { country = OnGetCountry(country); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/country"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/country"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); + formParameterLocalVars.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/country", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/country", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetCountry(apiResponse, country); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetCountry(apiResponseLocalVar, country); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetCountry(e, "/country", uriBuilder.Path, country); + OnErrorGetCountry(e, "/country", uriBuilderLocalVar.Path, country); + throw; + } + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> HelloAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?> apiResponseLocalVar = await HelloWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); + + return apiResponseLocalVar.Content; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task?> HelloOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse?>? apiResponseLocalVar = null; + try + { + apiResponseLocalVar = await HelloWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content + : null; + } + + /// + /// Validates the request parameters + /// + /// + protected virtual void OnHello() + { + return; + } + + /// + /// Processes the server response + /// + /// + protected virtual void AfterHello(ApiResponse?> apiResponseLocalVar) + { + } + + /// + /// Processes the server response + /// + /// + /// + /// + protected virtual void OnErrorHello(Exception exception, string pathFormat, string path) + { + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task?>> HelloWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + OnHello(); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/hello"; + + + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/hello", uriBuilderLocalVar.Path)); + + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + ApiResponse?> apiResponseLocalVar = new ApiResponse?>(httpResponseMessageLocalVar, responseContentLocalVar); + + if (apiResponseLocalVar.IsSuccessStatusCode) + { + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterHello(apiResponseLocalVar); + } + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorHello(e, "/hello", uriBuilderLocalVar.Path); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs index 3398f5f8f42..3a2112ef8ec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs @@ -728,12 +728,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -744,17 +744,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -770,8 +770,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterFakeHealthGet(ApiResponse apiResponse) + /// + protected virtual void AfterFakeHealthGet(ApiResponse apiResponseLocalVar) { } @@ -794,57 +794,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnFakeHealthGet(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/health", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/health", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeHealthGet(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeHealthGet(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeHealthGet(e, "/fake/health", uriBuilder.Path); + OnErrorFakeHealthGet(e, "/fake/health", uriBuilderLocalVar.Path); throw; } } @@ -858,12 +858,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content.Value; + return apiResponseLocalVar.Content.Value; } /// @@ -875,17 +875,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterBooleanSerializeOrDefaultAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -902,9 +902,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterBooleanSerialize(ApiResponse apiResponse, bool? body) + protected virtual void AfterFakeOuterBooleanSerialize(ApiResponse apiResponseLocalVar, bool? body) { } @@ -929,70 +929,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { body = OnFakeOuterBooleanSerialize(body); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/boolean", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/boolean", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterBooleanSerialize(apiResponse, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterBooleanSerialize(apiResponseLocalVar, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterBooleanSerialize(e, "/fake/outer/boolean", uriBuilder.Path, body); + OnErrorFakeOuterBooleanSerialize(e, "/fake/outer/boolean", uriBuilderLocalVar.Path, body); throw; } } @@ -1006,12 +1006,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterCompositeSerializeAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1023,17 +1023,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterCompositeSerializeOrDefaultAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1050,9 +1050,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterCompositeSerialize(ApiResponse apiResponse, OuterComposite? outerComposite) + protected virtual void AfterFakeOuterCompositeSerialize(ApiResponse apiResponseLocalVar, OuterComposite? outerComposite) { } @@ -1077,70 +1077,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite? outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { outerComposite = OnFakeOuterCompositeSerialize(outerComposite); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; - request.Content = (outerComposite as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(outerComposite, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (outerComposite as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(outerComposite, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/composite", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/composite", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterCompositeSerialize(apiResponse, outerComposite); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterCompositeSerialize(apiResponseLocalVar, outerComposite); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterCompositeSerialize(e, "/fake/outer/composite", uriBuilder.Path, outerComposite); + OnErrorFakeOuterCompositeSerialize(e, "/fake/outer/composite", uriBuilderLocalVar.Path, outerComposite); throw; } } @@ -1154,12 +1154,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content.Value; + return apiResponseLocalVar.Content.Value; } /// @@ -1171,17 +1171,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterNumberSerializeOrDefaultAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1198,9 +1198,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterNumberSerialize(ApiResponse apiResponse, decimal? body) + protected virtual void AfterFakeOuterNumberSerialize(ApiResponse apiResponseLocalVar, decimal? body) { } @@ -1225,70 +1225,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { body = OnFakeOuterNumberSerialize(body); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/number", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/number", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterNumberSerialize(apiResponse, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterNumberSerialize(apiResponseLocalVar, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterNumberSerialize(e, "/fake/outer/number", uriBuilder.Path, body); + OnErrorFakeOuterNumberSerialize(e, "/fake/outer/number", uriBuilderLocalVar.Path, body); throw; } } @@ -1303,12 +1303,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1321,17 +1321,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1358,10 +1358,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, Guid requiredStringUuid, string? body) + protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponseLocalVar, Guid requiredStringUuid, string? body) { } @@ -1388,78 +1388,78 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body); - requiredStringUuid = validatedParameters.Item1; - body = validatedParameters.Item2; + var validatedParameterLocalVars = OnFakeOuterStringSerialize(requiredStringUuid, body); + requiredStringUuid = validatedParameterLocalVars.Item1; + body = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString()!); + parseQueryStringLocalVar["required_string_uuid"] = requiredStringUuid.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/string", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/string", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterStringSerialize(apiResponseLocalVar, requiredStringUuid, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body); + OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilderLocalVar.Path, requiredStringUuid, body); throw; } } @@ -1472,12 +1472,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse?> result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse?> apiResponseLocalVar = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1488,17 +1488,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task?> GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse?>? result = null; + ApiResponse?>? apiResponseLocalVar = null; try { - result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1514,8 +1514,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterGetArrayOfEnums(ApiResponse?> apiResponse) + /// + protected virtual void AfterGetArrayOfEnums(ApiResponse?> apiResponseLocalVar) { } @@ -1538,57 +1538,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task?>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnGetArrayOfEnums(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/array-of-enums", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/array-of-enums", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse?> apiResponse = new ApiResponse?>(responseMessage, responseContent); + ApiResponse?> apiResponseLocalVar = new ApiResponse?>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetArrayOfEnums(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetArrayOfEnums(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetArrayOfEnums(e, "/fake/array-of-enums", uriBuilder.Path); + OnErrorGetArrayOfEnums(e, "/fake/array-of-enums", uriBuilderLocalVar.Path); throw; } } @@ -1602,12 +1602,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1619,17 +1619,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1655,9 +1655,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestBodyWithFileSchema(ApiResponse apiResponse, FileSchemaTestClass fileSchemaTestClass) + protected virtual void AfterTestBodyWithFileSchema(ApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass) { } @@ -1682,61 +1682,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { fileSchemaTestClass = OnTestBodyWithFileSchema(fileSchemaTestClass); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; - request.Content = (fileSchemaTestClass as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (fileSchemaTestClass as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-file-schema", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/body-with-file-schema", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestBodyWithFileSchema(apiResponse, fileSchemaTestClass); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestBodyWithFileSchema(apiResponseLocalVar, fileSchemaTestClass); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestBodyWithFileSchema(e, "/fake/body-with-file-schema", uriBuilder.Path, fileSchemaTestClass); + OnErrorTestBodyWithFileSchema(e, "/fake/body-with-file-schema", uriBuilderLocalVar.Path, fileSchemaTestClass); throw; } } @@ -1751,12 +1751,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1769,17 +1769,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1809,10 +1809,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterTestBodyWithQueryParams(ApiResponse apiResponse, User user, string query) + protected virtual void AfterTestBodyWithQueryParams(ApiResponse apiResponseLocalVar, User user, string query) { } @@ -1839,69 +1839,69 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestBodyWithQueryParamsWithHttpInfoAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestBodyWithQueryParams(user, query); - user = validatedParameters.Item1; - query = validatedParameters.Item2; + var validatedParameterLocalVars = OnTestBodyWithQueryParams(user, query); + user = validatedParameterLocalVars.Item1; + query = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["query"] = Uri.EscapeDataString(query.ToString()!); + parseQueryStringLocalVar["query"] = query.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-query-params", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/body-with-query-params", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestBodyWithQueryParams(apiResponse, user, query); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestBodyWithQueryParams(apiResponseLocalVar, user, query); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestBodyWithQueryParams(e, "/fake/body-with-query-params", uriBuilder.Path, user, query); + OnErrorTestBodyWithQueryParams(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, user, query); throw; } } @@ -1915,12 +1915,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1932,17 +1932,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1968,9 +1968,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestClientModel(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterTestClientModel(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -1995,70 +1995,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnTestClientModel(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Patch; + httpRequestMessageLocalVar.Method = HttpMethod.Patch; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestClientModel(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestClientModel(apiResponseLocalVar, modelClient); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestClientModel(e, "/fake", uriBuilder.Path, modelClient); + OnErrorTestClientModel(e, "/fake", uriBuilderLocalVar.Path, modelClient); throw; } } @@ -2085,12 +2085,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEndpointParametersAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream? binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string? _string = null, string? password = null, string? callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2115,17 +2115,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEndpointParametersOrDefaultAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream? binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string? _string = null, string? password = null, string? callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2173,7 +2173,7 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// @@ -2188,7 +2188,7 @@ namespace Org.OpenAPITools.Api /// /// /// - protected virtual void AfterTestEndpointParameters(ApiResponse apiResponse, byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date, System.IO.Stream? binary, float? _float, int? integer, int? int32, long? int64, string? _string, string? password, string? callback, DateTime? dateTime) + protected virtual void AfterTestEndpointParameters(ApiResponse apiResponseLocalVar, byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date, System.IO.Stream? binary, float? _float, int? integer, int? int32, long? int64, string? _string, string? password, string? callback, DateTime? dateTime) { } @@ -2239,134 +2239,134 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestEndpointParametersWithHttpInfoAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream? binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string? _string = null, string? password = null, string? callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestEndpointParameters(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); - _byte = validatedParameters.Item1; - number = validatedParameters.Item2; - _double = validatedParameters.Item3; - patternWithoutDelimiter = validatedParameters.Item4; - date = validatedParameters.Item5; - binary = validatedParameters.Item6; - _float = validatedParameters.Item7; - integer = validatedParameters.Item8; - int32 = validatedParameters.Item9; - int64 = validatedParameters.Item10; - _string = validatedParameters.Item11; - password = validatedParameters.Item12; - callback = validatedParameters.Item13; - dateTime = validatedParameters.Item14; + var validatedParameterLocalVars = OnTestEndpointParameters(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + _byte = validatedParameterLocalVars.Item1; + number = validatedParameterLocalVars.Item2; + _double = validatedParameterLocalVars.Item3; + patternWithoutDelimiter = validatedParameterLocalVars.Item4; + date = validatedParameterLocalVars.Item5; + binary = validatedParameterLocalVars.Item6; + _float = validatedParameterLocalVars.Item7; + integer = validatedParameterLocalVars.Item8; + int32 = validatedParameterLocalVars.Item9; + int64 = validatedParameterLocalVars.Item10; + _string = validatedParameterLocalVars.Item11; + password = validatedParameterLocalVars.Item12; + callback = validatedParameterLocalVars.Item13; + dateTime = validatedParameterLocalVars.Item14; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); + formParameterLocalVars.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); - formParams.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + formParameterLocalVars.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); - formParams.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); + formParameterLocalVars.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); - formParams.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + formParameterLocalVars.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); if (date != null) - formParams.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); + formParameterLocalVars.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); if (binary != null) - multipartContent.Add(new StreamContent(binary)); + multipartContentLocalVar.Add(new StreamContent(binary)); if (_float != null) - formParams.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); + formParameterLocalVars.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); if (integer != null) - formParams.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); + formParameterLocalVars.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); if (int32 != null) - formParams.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); + formParameterLocalVars.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); if (int64 != null) - formParams.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); + formParameterLocalVars.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); if (_string != null) - formParams.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); + formParameterLocalVars.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); if (password != null) - formParams.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); + formParameterLocalVars.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); if (callback != null) - formParams.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); + formParameterLocalVars.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); if (dateTime != null) - formParams.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); + formParameterLocalVars.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + BasicToken basicTokenLocalVar = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(basicToken); + tokenBaseLocalVars.Add(basicTokenLocalVar); - basicToken.UseInHeader(request, ""); + basicTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestEndpointParameters(apiResponse, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestEndpointParameters(apiResponseLocalVar, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestEndpointParameters(e, "/fake", uriBuilder.Path, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + OnErrorTestEndpointParameters(e, "/fake", uriBuilderLocalVar.Path, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); throw; } } @@ -2387,12 +2387,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEnumParametersAsync(List? enumHeaderStringArray = null, List? enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List? enumFormStringArray = null, string? enumHeaderString = null, string? enumQueryString = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2411,17 +2411,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEnumParametersOrDefaultAsync(List? enumHeaderStringArray = null, List? enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List? enumFormStringArray = null, string? enumHeaderString = null, string? enumQueryString = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2445,7 +2445,7 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// @@ -2454,7 +2454,7 @@ namespace Org.OpenAPITools.Api /// /// /// - protected virtual void AfterTestEnumParameters(ApiResponse apiResponse, List? enumHeaderStringArray, List? enumQueryStringArray, double? enumQueryDouble, int? enumQueryInteger, List? enumFormStringArray, string? enumHeaderString, string? enumQueryString, string? enumFormString) + protected virtual void AfterTestEnumParameters(ApiResponse apiResponseLocalVar, List? enumHeaderStringArray, List? enumQueryStringArray, double? enumQueryDouble, int? enumQueryInteger, List? enumFormStringArray, string? enumHeaderString, string? enumQueryString, string? enumFormString) { } @@ -2493,98 +2493,98 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestEnumParametersWithHttpInfoAsync(List? enumHeaderStringArray = null, List? enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List? enumFormStringArray = null, string? enumHeaderString = null, string? enumQueryString = null, string? enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); - enumHeaderStringArray = validatedParameters.Item1; - enumQueryStringArray = validatedParameters.Item2; - enumQueryDouble = validatedParameters.Item3; - enumQueryInteger = validatedParameters.Item4; - enumFormStringArray = validatedParameters.Item5; - enumHeaderString = validatedParameters.Item6; - enumQueryString = validatedParameters.Item7; - enumFormString = validatedParameters.Item8; + var validatedParameterLocalVars = OnTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + enumHeaderStringArray = validatedParameterLocalVars.Item1; + enumQueryStringArray = validatedParameterLocalVars.Item2; + enumQueryDouble = validatedParameterLocalVars.Item3; + enumQueryInteger = validatedParameterLocalVars.Item4; + enumFormStringArray = validatedParameterLocalVars.Item5; + enumHeaderString = validatedParameterLocalVars.Item6; + enumQueryString = validatedParameterLocalVars.Item7; + enumFormString = validatedParameterLocalVars.Item8; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray != null) - parseQueryString["enum_query_string_array"] = Uri.EscapeDataString(enumQueryStringArray.ToString()!); + parseQueryStringLocalVar["enum_query_string_array"] = enumQueryStringArray.ToString(); if (enumQueryDouble != null) - parseQueryString["enum_query_double"] = Uri.EscapeDataString(enumQueryDouble.ToString()!); + parseQueryStringLocalVar["enum_query_double"] = enumQueryDouble.ToString(); if (enumQueryInteger != null) - parseQueryString["enum_query_integer"] = Uri.EscapeDataString(enumQueryInteger.ToString()!); + parseQueryStringLocalVar["enum_query_integer"] = enumQueryInteger.ToString(); if (enumQueryString != null) - parseQueryString["enum_query_string"] = Uri.EscapeDataString(enumQueryString.ToString()!); + parseQueryStringLocalVar["enum_query_string"] = enumQueryString.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); if (enumHeaderStringArray != null) - request.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); + httpRequestMessageLocalVar.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); if (enumHeaderString != null) - request.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); + httpRequestMessageLocalVar.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (enumFormStringArray != null) - formParams.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (enumFormStringArray != null) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); if (enumFormString != null) - formParams.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); + formParameterLocalVars.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestEnumParameters(apiResponse, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestEnumParameters(apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestEnumParameters(e, "/fake", uriBuilder.Path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + OnErrorTestEnumParameters(e, "/fake", uriBuilderLocalVar.Path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); throw; } } @@ -2603,12 +2603,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2625,17 +2625,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2672,14 +2672,14 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// /// /// /// - protected virtual void AfterTestGroupParameters(ApiResponse apiResponse, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup, int? stringGroup, long? int64Group) + protected virtual void AfterTestGroupParameters(ApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup, int? stringGroup, long? int64Group) { } @@ -2714,83 +2714,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestGroupParametersWithHttpInfoAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); - requiredBooleanGroup = validatedParameters.Item1; - requiredStringGroup = validatedParameters.Item2; - requiredInt64Group = validatedParameters.Item3; - booleanGroup = validatedParameters.Item4; - stringGroup = validatedParameters.Item5; - int64Group = validatedParameters.Item6; + var validatedParameterLocalVars = OnTestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + requiredBooleanGroup = validatedParameterLocalVars.Item1; + requiredStringGroup = validatedParameterLocalVars.Item2; + requiredInt64Group = validatedParameterLocalVars.Item3; + booleanGroup = validatedParameterLocalVars.Item4; + stringGroup = validatedParameterLocalVars.Item5; + int64Group = validatedParameterLocalVars.Item6; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["required_string_group"] = Uri.EscapeDataString(requiredStringGroup.ToString()!); - parseQueryString["required_int64_group"] = Uri.EscapeDataString(requiredInt64Group.ToString()!); + parseQueryStringLocalVar["required_string_group"] = requiredStringGroup.ToString(); + parseQueryStringLocalVar["required_int64_group"] = requiredInt64Group.ToString(); if (stringGroup != null) - parseQueryString["string_group"] = Uri.EscapeDataString(stringGroup.ToString()!); + parseQueryStringLocalVar["string_group"] = stringGroup.ToString(); if (int64Group != null) - parseQueryString["int64_group"] = Uri.EscapeDataString(int64Group.ToString()!); + parseQueryStringLocalVar["int64_group"] = int64Group.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + httpRequestMessageLocalVar.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); if (booleanGroup != null) - request.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); + httpRequestMessageLocalVar.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + BearerToken bearerTokenLocalVar = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(bearerToken); + tokenBaseLocalVars.Add(bearerTokenLocalVar); - bearerToken.UseInHeader(request, ""); + bearerTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - request.Method = HttpMethod.Delete; + httpRequestMessageLocalVar.Method = HttpMethod.Delete; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestGroupParameters(apiResponse, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestGroupParameters(apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestGroupParameters(e, "/fake", uriBuilder.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + OnErrorTestGroupParameters(e, "/fake", uriBuilderLocalVar.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); throw; } } @@ -2804,12 +2804,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2821,17 +2821,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2857,9 +2857,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestInlineAdditionalProperties(ApiResponse apiResponse, Dictionary requestBody) + protected virtual void AfterTestInlineAdditionalProperties(ApiResponse apiResponseLocalVar, Dictionary requestBody) { } @@ -2884,61 +2884,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { requestBody = OnTestInlineAdditionalProperties(requestBody); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; - request.Content = (requestBody as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/inline-additionalProperties", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestInlineAdditionalProperties(apiResponse, requestBody); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestInlineAdditionalProperties(apiResponseLocalVar, requestBody); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestInlineAdditionalProperties(e, "/fake/inline-additionalProperties", uriBuilder.Path, requestBody); + OnErrorTestInlineAdditionalProperties(e, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path, requestBody); throw; } } @@ -2953,12 +2953,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2971,17 +2971,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -3011,10 +3011,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterTestJsonFormData(ApiResponse apiResponse, string param, string param2) + protected virtual void AfterTestJsonFormData(ApiResponse apiResponseLocalVar, string param, string param2) { } @@ -3041,73 +3041,73 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestJsonFormData(param, param2); - param = validatedParameters.Item1; - param2 = validatedParameters.Item2; + var validatedParameterLocalVars = OnTestJsonFormData(param, param2); + param = validatedParameterLocalVars.Item1; + param2 = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + formParameterLocalVars.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); - formParams.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + formParameterLocalVars.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/jsonFormData", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/jsonFormData", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestJsonFormData(apiResponse, param, param2); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestJsonFormData(apiResponseLocalVar, param, param2); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestJsonFormData(e, "/fake/jsonFormData", uriBuilder.Path, param, param2); + OnErrorTestJsonFormData(e, "/fake/jsonFormData", uriBuilderLocalVar.Path, param, param2); throw; } } @@ -3125,12 +3125,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -3146,17 +3146,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -3198,13 +3198,13 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// /// /// - protected virtual void AfterTestQueryParameterCollectionFormat(ApiResponse apiResponse, List pipe, List ioutil, List http, List url, List context) + protected virtual void AfterTestQueryParameterCollectionFormat(ApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context) { } @@ -3237,63 +3237,63 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - pipe = validatedParameters.Item1; - ioutil = validatedParameters.Item2; - http = validatedParameters.Item3; - url = validatedParameters.Item4; - context = validatedParameters.Item5; + var validatedParameterLocalVars = OnTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + pipe = validatedParameterLocalVars.Item1; + ioutil = validatedParameterLocalVars.Item2; + http = validatedParameterLocalVars.Item3; + url = validatedParameterLocalVars.Item4; + context = validatedParameterLocalVars.Item5; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["pipe"] = Uri.EscapeDataString(pipe.ToString()!); - parseQueryString["ioutil"] = Uri.EscapeDataString(ioutil.ToString()!); - parseQueryString["http"] = Uri.EscapeDataString(http.ToString()!); - parseQueryString["url"] = Uri.EscapeDataString(url.ToString()!); - parseQueryString["context"] = Uri.EscapeDataString(context.ToString()!); + parseQueryStringLocalVar["pipe"] = pipe.ToString(); + parseQueryStringLocalVar["ioutil"] = ioutil.ToString(); + parseQueryStringLocalVar["http"] = http.ToString(); + parseQueryStringLocalVar["url"] = url.ToString(); + parseQueryStringLocalVar["context"] = context.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/test-query-parameters", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/test-query-parameters", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestQueryParameterCollectionFormat(apiResponse, pipe, ioutil, http, url, context); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestQueryParameterCollectionFormat(apiResponseLocalVar, pipe, ioutil, http, url, context); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestQueryParameterCollectionFormat(e, "/fake/test-query-parameters", uriBuilder.Path, pipe, ioutil, http, url, context); + OnErrorTestQueryParameterCollectionFormat(e, "/fake/test-query-parameters", uriBuilderLocalVar.Path, pipe, ioutil, http, url, context); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 7dab9b6adab..60455e19b93 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -149,12 +149,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -166,17 +166,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -202,9 +202,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestClassname(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterTestClassname(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -229,83 +229,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnTestClassname(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInQuery(request, uriBuilder, parseQueryString, "api_key_query"); + apiKeyTokenLocalVar.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query"); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Patch; + httpRequestMessageLocalVar.Method = HttpMethod.Patch; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake_classname_test", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake_classname_test", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestClassname(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestClassname(apiResponseLocalVar, modelClient); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestClassname(e, "/fake_classname_test", uriBuilder.Path, modelClient); + OnErrorTestClassname(e, "/fake_classname_test", uriBuilderLocalVar.Path, modelClient); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs index 75c71e51628..a617fe18d11 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs @@ -450,12 +450,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -467,17 +467,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -503,9 +503,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterAddPet(ApiResponse apiResponse, Pet pet) + protected virtual void AfterAddPet(ApiResponse apiResponseLocalVar, Pet pet) { } @@ -530,84 +530,84 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { pet = OnAddPet(pet); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - var url = request.RequestUri = new Uri("http://petstore.swagger.io/v2"); - uriBuilder.Host = url.Authority; - uriBuilder.Scheme = url.Scheme; - uriBuilder.Path = url.AbsolutePath; + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; - request.Content = (pet as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); string[] contentTypes = new string[] { "application/json", "application/xml" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterAddPet(apiResponse, pet); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterAddPet(apiResponseLocalVar, pet); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorAddPet(e, "/pet", uriBuilder.Path, pet); + OnErrorAddPet(e, "/pet", uriBuilderLocalVar.Path, pet); throw; } } @@ -622,12 +622,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeletePetAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -640,17 +640,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeletePetOrDefaultAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -677,10 +677,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterDeletePet(ApiResponse apiResponse, long petId, string? apiKey) + protected virtual void AfterDeletePet(ApiResponse apiResponseLocalVar, long petId, string? apiKey) { } @@ -707,64 +707,64 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeletePetWithHttpInfoAsync(long petId, string? apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnDeletePet(petId, apiKey); - petId = validatedParameters.Item1; - apiKey = validatedParameters.Item2; + var validatedParameterLocalVars = OnDeletePet(petId, apiKey); + petId = validatedParameterLocalVars.Item1; + apiKey = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); if (apiKey != null) - request.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); if (apiKey != null) + httpRequestMessageLocalVar.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - request.Method = HttpMethod.Delete; + httpRequestMessageLocalVar.Method = HttpMethod.Delete; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeletePet(apiResponse, petId, apiKey); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeletePet(apiResponseLocalVar, petId, apiKey); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeletePet(e, "/pet/{petId}", uriBuilder.Path, petId, apiKey); + OnErrorDeletePet(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, apiKey); throw; } } @@ -778,12 +778,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse?> result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + ApiResponse?> apiResponseLocalVar = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -795,17 +795,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task?> FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse?>? result = null; + ApiResponse?>? apiResponseLocalVar = null; try { - result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -831,9 +831,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFindPetsByStatus(ApiResponse?> apiResponse, List status) + protected virtual void AfterFindPetsByStatus(ApiResponse?> apiResponseLocalVar, List status) { } @@ -858,86 +858,86 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task?>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { status = OnFindPetsByStatus(status); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["status"] = Uri.EscapeDataString(status.ToString()!); + parseQueryStringLocalVar["status"] = status.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByStatus", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/findByStatus", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse?> apiResponse = new ApiResponse?>(responseMessage, responseContent); + ApiResponse?> apiResponseLocalVar = new ApiResponse?>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterFindPetsByStatus(apiResponse, status); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFindPetsByStatus(apiResponseLocalVar, status); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFindPetsByStatus(e, "/pet/findByStatus", uriBuilder.Path, status); + OnErrorFindPetsByStatus(e, "/pet/findByStatus", uriBuilderLocalVar.Path, status); throw; } } @@ -951,12 +951,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse?> result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + ApiResponse?> apiResponseLocalVar = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -968,17 +968,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task?> FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse?>? result = null; + ApiResponse?>? apiResponseLocalVar = null; try { - result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1004,9 +1004,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFindPetsByTags(ApiResponse?> apiResponse, List tags) + protected virtual void AfterFindPetsByTags(ApiResponse?> apiResponseLocalVar, List tags) { } @@ -1031,86 +1031,86 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task?>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { tags = OnFindPetsByTags(tags); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["tags"] = Uri.EscapeDataString(tags.ToString()!); + parseQueryStringLocalVar["tags"] = tags.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByTags", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/findByTags", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse?> apiResponse = new ApiResponse?>(responseMessage, responseContent); + ApiResponse?> apiResponseLocalVar = new ApiResponse?>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterFindPetsByTags(apiResponse, tags); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFindPetsByTags(apiResponseLocalVar, tags); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFindPetsByTags(e, "/pet/findByTags", uriBuilder.Path, tags); + OnErrorFindPetsByTags(e, "/pet/findByTags", uriBuilderLocalVar.Path, tags); throw; } } @@ -1124,12 +1124,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1141,17 +1141,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1177,9 +1177,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetPetById(ApiResponse apiResponse, long petId) + protected virtual void AfterGetPetById(ApiResponse apiResponseLocalVar, long petId) { } @@ -1204,67 +1204,67 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { petId = OnGetPetById(petId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); List tokens = new List(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInHeader(request, "api_key"); + apiKeyTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "api_key"); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetPetById(apiResponse, petId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetPetById(apiResponseLocalVar, petId); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetPetById(e, "/pet/{petId}", uriBuilder.Path, petId); + OnErrorGetPetById(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId); throw; } } @@ -1278,12 +1278,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1295,17 +1295,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1331,9 +1331,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterUpdatePet(ApiResponse apiResponse, Pet pet) + protected virtual void AfterUpdatePet(ApiResponse apiResponseLocalVar, Pet pet) { } @@ -1358,84 +1358,84 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { pet = OnUpdatePet(pet); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - var url = request.RequestUri = new Uri("http://petstore.swagger.io/v2"); - uriBuilder.Host = url.Authority; - uriBuilder.Scheme = url.Scheme; - uriBuilder.Path = url.AbsolutePath; + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; - request.Content = (pet as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content!.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); string[] contentTypes = new string[] { "application/json", "application/xml" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdatePet(apiResponse, pet); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdatePet(apiResponseLocalVar, pet); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdatePet(e, "/pet", uriBuilder.Path, pet); + OnErrorUpdatePet(e, "/pet", uriBuilderLocalVar.Path, pet); throw; } } @@ -1451,12 +1451,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetWithFormAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1470,17 +1470,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetWithFormOrDefaultAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1508,11 +1508,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUpdatePetWithForm(ApiResponse apiResponse, long petId, string? name, string? status) + protected virtual void AfterUpdatePetWithForm(ApiResponse apiResponseLocalVar, long petId, string? name, string? status) { } @@ -1541,83 +1541,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string? name = null, string? status = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUpdatePetWithForm(petId, name, status); - petId = validatedParameters.Item1; - name = validatedParameters.Item2; - status = validatedParameters.Item3; + var validatedParameterLocalVars = OnUpdatePetWithForm(petId, name, status); + petId = validatedParameterLocalVars.Item1; + name = validatedParameterLocalVars.Item2; + status = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (name != null) - formParams.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (name != null) + formParameterLocalVars.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); if (status != null) - formParams.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); + formParameterLocalVars.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdatePetWithForm(apiResponse, petId, name, status); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdatePetWithForm(apiResponseLocalVar, petId, name, status); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdatePetWithForm(e, "/pet/{petId}", uriBuilder.Path, petId, name, status); + OnErrorUpdatePetWithForm(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, name, status); throw; } } @@ -1633,12 +1633,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileAsync(long petId, System.IO.Stream? file = null, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1652,17 +1652,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileOrDefaultAsync(long petId, System.IO.Stream? file = null, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1690,11 +1690,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUploadFile(ApiResponse apiResponse, long petId, System.IO.Stream? file, string? additionalMetadata) + protected virtual void AfterUploadFile(ApiResponse apiResponseLocalVar, long petId, System.IO.Stream? file, string? additionalMetadata) { } @@ -1723,92 +1723,92 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UploadFileWithHttpInfoAsync(long petId, System.IO.Stream? file = null, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUploadFile(petId, file, additionalMetadata); - petId = validatedParameters.Item1; - file = validatedParameters.Item2; - additionalMetadata = validatedParameters.Item3; + var validatedParameterLocalVars = OnUploadFile(petId, file, additionalMetadata); + petId = validatedParameterLocalVars.Item1; + file = validatedParameterLocalVars.Item2; + additionalMetadata = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (file != null) - multipartContent.Add(new StreamContent(file)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (file != null) + multipartContentLocalVar.Add(new StreamContent(file)); if (additionalMetadata != null) - formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "multipart/form-data" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}/uploadImage", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUploadFile(apiResponse, petId, file, additionalMetadata); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUploadFile(apiResponseLocalVar, petId, file, additionalMetadata); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUploadFile(e, "/pet/{petId}/uploadImage", uriBuilder.Path, petId, file, additionalMetadata); + OnErrorUploadFile(e, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path, petId, file, additionalMetadata); throw; } } @@ -1824,12 +1824,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1843,17 +1843,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1884,11 +1884,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUploadFileWithRequiredFile(ApiResponse apiResponse, System.IO.Stream requiredFile, long petId, string? additionalMetadata) + protected virtual void AfterUploadFileWithRequiredFile(ApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, string? additionalMetadata) { } @@ -1917,92 +1917,92 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UploadFileWithRequiredFileWithHttpInfoAsync(System.IO.Stream requiredFile, long petId, string? additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); - requiredFile = validatedParameters.Item1; - petId = validatedParameters.Item2; - additionalMetadata = validatedParameters.Item3; + var validatedParameterLocalVars = OnUploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); + requiredFile = validatedParameterLocalVars.Item1; + petId = validatedParameterLocalVars.Item2; + additionalMetadata = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); multipartContent.Add(new StreamContent(requiredFile)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); multipartContentLocalVar.Add(new StreamContent(requiredFile)); if (additionalMetadata != null) - formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "multipart/form-data" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUploadFileWithRequiredFile(apiResponse, requiredFile, petId, additionalMetadata); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUploadFileWithRequiredFile(apiResponseLocalVar, requiredFile, petId, additionalMetadata); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUploadFileWithRequiredFile(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilder.Path, requiredFile, petId, additionalMetadata); + OnErrorUploadFileWithRequiredFile(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path, requiredFile, petId, additionalMetadata); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/StoreApi.cs index 2b65bdae6b9..29533089eb7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/StoreApi.cs @@ -251,12 +251,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -268,17 +268,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -304,9 +304,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterDeleteOrder(ApiResponse apiResponse, string orderId) + protected virtual void AfterDeleteOrder(ApiResponse apiResponseLocalVar, string orderId) { } @@ -331,48 +331,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { orderId = OnDeleteOrder(orderId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = HttpMethod.Delete; + httpRequestMessageLocalVar.Method = HttpMethod.Delete; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order/{order_id}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeleteOrder(apiResponse, orderId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeleteOrder(apiResponseLocalVar, orderId); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeleteOrder(e, "/store/order/{order_id}", uriBuilder.Path, orderId); + OnErrorDeleteOrder(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); throw; } } @@ -385,12 +385,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse?> result = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse?> apiResponseLocalVar = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -401,17 +401,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task?> GetInventoryOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse?>? result = null; + ApiResponse?>? apiResponseLocalVar = null; try { - result = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -427,8 +427,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterGetInventory(ApiResponse?> apiResponse) + /// + protected virtual void AfterGetInventory(ApiResponse?> apiResponseLocalVar) { } @@ -451,66 +451,66 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task?>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnGetInventory(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; - List tokens = new List(); + List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInHeader(request, "api_key"); + apiKeyTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "api_key"); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/inventory", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/inventory", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse?> apiResponse = new ApiResponse?>(responseMessage, responseContent); + ApiResponse?> apiResponseLocalVar = new ApiResponse?>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetInventory(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetInventory(apiResponseLocalVar); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetInventory(e, "/store/inventory", uriBuilder.Path); + OnErrorGetInventory(e, "/store/inventory", uriBuilderLocalVar.Path); throw; } } @@ -524,12 +524,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -541,17 +541,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -577,9 +577,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetOrderById(ApiResponse apiResponse, long orderId) + protected virtual void AfterGetOrderById(ApiResponse apiResponseLocalVar, long orderId) { } @@ -604,58 +604,58 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { orderId = OnGetOrderById(orderId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order/{order_id}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetOrderById(apiResponse, orderId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetOrderById(apiResponseLocalVar, orderId); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetOrderById(e, "/store/order/{order_id}", uriBuilder.Path, orderId); + OnErrorGetOrderById(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); throw; } } @@ -669,12 +669,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -686,17 +686,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -722,9 +722,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterPlaceOrder(ApiResponse apiResponse, Order order) + protected virtual void AfterPlaceOrder(ApiResponse apiResponseLocalVar, Order order) { } @@ -749,71 +749,71 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { order = OnPlaceOrder(order); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order"; - request.Content = (order as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (order as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterPlaceOrder(apiResponse, order); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterPlaceOrder(apiResponseLocalVar, order); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorPlaceOrder(e, "/store/order", uriBuilder.Path, order); + OnErrorPlaceOrder(e, "/store/order", uriBuilderLocalVar.Path, order); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/UserApi.cs index a570b8d3112..e73ad7f0437 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/UserApi.cs @@ -397,12 +397,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -414,17 +414,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -450,9 +450,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUser(ApiResponse apiResponse, User user) + protected virtual void AfterCreateUser(ApiResponse apiResponseLocalVar, User user) { } @@ -477,61 +477,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUser(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUser(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUser(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUser(e, "/user", uriBuilder.Path, user); + OnErrorCreateUser(e, "/user", uriBuilderLocalVar.Path, user); throw; } } @@ -545,12 +545,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -562,17 +562,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -598,9 +598,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUsersWithArrayInput(ApiResponse apiResponse, List user) + protected virtual void AfterCreateUsersWithArrayInput(ApiResponse apiResponseLocalVar, List user) { } @@ -625,61 +625,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUsersWithArrayInput(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithArray", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/createWithArray", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUsersWithArrayInput(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUsersWithArrayInput(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUsersWithArrayInput(e, "/user/createWithArray", uriBuilder.Path, user); + OnErrorCreateUsersWithArrayInput(e, "/user/createWithArray", uriBuilderLocalVar.Path, user); throw; } } @@ -693,12 +693,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -710,17 +710,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -746,9 +746,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUsersWithListInput(ApiResponse apiResponse, List user) + protected virtual void AfterCreateUsersWithListInput(ApiResponse apiResponseLocalVar, List user) { } @@ -773,61 +773,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUsersWithListInput(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithList", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/createWithList", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUsersWithListInput(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUsersWithListInput(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUsersWithListInput(e, "/user/createWithList", uriBuilder.Path, user); + OnErrorCreateUsersWithListInput(e, "/user/createWithList", uriBuilderLocalVar.Path, user); throw; } } @@ -841,12 +841,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -858,17 +858,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -894,9 +894,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterDeleteUser(ApiResponse apiResponse, string username) + protected virtual void AfterDeleteUser(ApiResponse apiResponseLocalVar, string username) { } @@ -921,48 +921,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { username = OnDeleteUser(username); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = HttpMethod.Delete; + httpRequestMessageLocalVar.Method = HttpMethod.Delete; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeleteUser(apiResponse, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeleteUser(apiResponseLocalVar, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeleteUser(e, "/user/{username}", uriBuilder.Path, username); + OnErrorDeleteUser(e, "/user/{username}", uriBuilderLocalVar.Path, username); throw; } } @@ -976,12 +976,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -993,17 +993,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1029,9 +1029,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetUserByName(ApiResponse apiResponse, string username) + protected virtual void AfterGetUserByName(ApiResponse apiResponseLocalVar, string username) { } @@ -1056,58 +1056,58 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { username = OnGetUserByName(username); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetUserByName(apiResponse, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetUserByName(apiResponseLocalVar, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetUserByName(e, "/user/{username}", uriBuilder.Path, username); + OnErrorGetUserByName(e, "/user/{username}", uriBuilderLocalVar.Path, username); throw; } } @@ -1122,12 +1122,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1140,17 +1140,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1180,10 +1180,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterLoginUser(ApiResponse apiResponse, string username, string password) + protected virtual void AfterLoginUser(ApiResponse apiResponseLocalVar, string username, string password) { } @@ -1210,67 +1210,67 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnLoginUser(username, password); - username = validatedParameters.Item1; - password = validatedParameters.Item2; + var validatedParameterLocalVars = OnLoginUser(username, password); + username = validatedParameterLocalVars.Item1; + password = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/login"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["username"] = Uri.EscapeDataString(username.ToString()!); - parseQueryString["password"] = Uri.EscapeDataString(password.ToString()!); + parseQueryStringLocalVar["username"] = username.ToString(); + parseQueryStringLocalVar["password"] = password.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/login", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/login", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterLoginUser(apiResponse, username, password); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterLoginUser(apiResponseLocalVar, username, password); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorLoginUser(e, "/user/login", uriBuilder.Path, username, password); + OnErrorLoginUser(e, "/user/login", uriBuilderLocalVar.Path, username, password); throw; } } @@ -1283,12 +1283,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1299,17 +1299,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1325,8 +1325,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterLogoutUser(ApiResponse apiResponse) + /// + protected virtual void AfterLogoutUser(ApiResponse apiResponseLocalVar) { } @@ -1349,48 +1349,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnLogoutUser(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/logout", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/logout", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterLogoutUser(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterLogoutUser(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorLogoutUser(e, "/user/logout", uriBuilder.Path); + OnErrorLogoutUser(e, "/user/logout", uriBuilderLocalVar.Path); throw; } } @@ -1405,12 +1405,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1423,17 +1423,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1463,10 +1463,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterUpdateUser(ApiResponse apiResponse, User user, string username) + protected virtual void AfterUpdateUser(ApiResponse apiResponseLocalVar, User user, string username) { } @@ -1493,63 +1493,63 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdateUserWithHttpInfoAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUpdateUser(user, username); - user = validatedParameters.Item1; - username = validatedParameters.Item2; + var validatedParameterLocalVars = OnUpdateUser(user, username); + user = validatedParameterLocalVars.Item1; + username = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string? contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string? contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdateUser(apiResponse, user, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdateUser(apiResponseLocalVar, user, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdateUser(e, "/user/{username}", uriBuilder.Path, user, username); + OnErrorUpdateUser(e, "/user/{username}", uriBuilderLocalVar.Path, user, username); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ClientUtils.cs index e23f5314802..4cb4f694a0d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -12,10 +12,13 @@ using System; using System.IO; using System.Linq; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -97,7 +100,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -124,9 +127,50 @@ namespace Org.OpenAPITools.Client // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + if (obj is ChildCatAllOf.PetTypeEnum childCatAllOfPetTypeEnum) + return ChildCatAllOf.PetTypeEnumToJsonValue(childCatAllOfPetTypeEnum); + if (obj is EnumArrays.ArrayEnumEnum enumArraysArrayEnumEnum) + return EnumArrays.ArrayEnumEnumToJsonValue(enumArraysArrayEnumEnum); + if (obj is EnumArrays.JustSymbolEnum enumArraysJustSymbolEnum) + return EnumArrays.JustSymbolEnumToJsonValue(enumArraysJustSymbolEnum); + if (obj is EnumClass enumClass) + return EnumClassConverter.ToJsonValue(enumClass); + if (obj is EnumTest.EnumIntegerEnum enumTestEnumIntegerEnum) + return EnumTest.EnumIntegerEnumToJsonValue(enumTestEnumIntegerEnum).ToString(); + if (obj is EnumTest.EnumIntegerOnlyEnum enumTestEnumIntegerOnlyEnum) + return EnumTest.EnumIntegerOnlyEnumToJsonValue(enumTestEnumIntegerOnlyEnum).ToString(); + if (obj is EnumTest.EnumNumberEnum enumTestEnumNumberEnum) + return EnumTest.EnumNumberEnumToJsonValue(enumTestEnumNumberEnum).ToString(); + if (obj is EnumTest.EnumStringEnum enumTestEnumStringEnum) + return EnumTest.EnumStringEnumToJsonValue(enumTestEnumStringEnum); + if (obj is EnumTest.EnumStringRequiredEnum enumTestEnumStringRequiredEnum) + return EnumTest.EnumStringRequiredEnumToJsonValue(enumTestEnumStringRequiredEnum); + if (obj is MapTest.InnerEnum mapTestInnerEnum) + return MapTest.InnerEnumToJsonValue(mapTestInnerEnum); + if (obj is Order.StatusEnum orderStatusEnum) + return Order.StatusEnumToJsonValue(orderStatusEnum); + if (obj is OuterEnum outerEnum) + return OuterEnumConverter.ToJsonValue(outerEnum); + if (obj is OuterEnumDefaultValue outerEnumDefaultValue) + return OuterEnumDefaultValueConverter.ToJsonValue(outerEnumDefaultValue); + if (obj is OuterEnumInteger outerEnumInteger) + return OuterEnumIntegerConverter.ToJsonValue(outerEnumInteger).ToString(); + if (obj is OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) + return OuterEnumIntegerDefaultValueConverter.ToJsonValue(outerEnumIntegerDefaultValue).ToString(); + if (obj is Pet.StatusEnum petStatusEnum) + return Pet.StatusEnumToJsonValue(petStatusEnum); + if (obj is Zebra.TypeEnum zebraTypeEnum) + return Zebra.TypeEnumToJsonValue(zebraTypeEnum); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs index bb0457c6e9d..71992dc8d86 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -71,6 +71,6 @@ namespace Org.OpenAPITools.Client /// /// public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs index d3a7b947bc7..90d2174e4a3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Client if (dateTimeValue == null) writer.WriteNullValue(); else - writer.WriteStringValue(dateTimeValue.Value.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs index 834af932817..4b882f79e6a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -92,6 +92,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new HealthCheckResultJsonConverter()); _jsonOptions.Converters.Add(new IsoscelesTriangleJsonConverter()); _jsonOptions.Converters.Add(new ListJsonConverter()); + _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); @@ -128,6 +129,8 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new SimpleQuadrilateralJsonConverter()); _jsonOptions.Converters.Add(new SpecialModelNameJsonConverter()); _jsonOptions.Converters.Add(new TagJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); _jsonOptions.Converters.Add(new TriangleJsonConverter()); _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); _jsonOptions.Converters.Add(new UserJsonConverter()); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs index adfde11e807..15d4250d9d0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Activity(Dictionary> activityOutputs) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (activityOutputs == null) - throw new ArgumentNullException("activityOutputs is a required property for Activity and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ActivityOutputs = activityOutputs; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "activity_outputs": - activityOutputs = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + activityOutputs = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (activityOutputs == null) + throw new ArgumentNullException(nameof(activityOutputs), "Property is required for class Activity."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Activity(activityOutputs); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index e1dc7b48ed1..40a36583b66 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ActivityOutputElementRepresentation(string prop1, Object prop2) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (prop1 == null) - throw new ArgumentNullException("prop1 is a required property for ActivityOutputElementRepresentation and cannot be null."); - - if (prop2 == null) - throw new ArgumentNullException("prop2 is a required property for ActivityOutputElementRepresentation and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Prop1 = prop1; Prop2 = prop2; } @@ -86,12 +74,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -141,7 +130,8 @@ namespace Org.OpenAPITools.Model prop1 = utf8JsonReader.GetString(); break; case "prop2": - prop2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + prop2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -149,6 +139,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (prop1 == null) + throw new ArgumentNullException(nameof(prop1), "Property is required for class ActivityOutputElementRepresentation."); + + if (prop2 == null) + throw new ArgumentNullException(nameof(prop2), "Property is required for class ActivityOutputElementRepresentation."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ActivityOutputElementRepresentation(prop1, prop2); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 855558ff890..3a2dfec5141 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -44,33 +44,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public AdditionalPropertiesClass(Object emptyMap, Dictionary> mapOfMapProperty, Dictionary mapProperty, Object mapWithUndeclaredPropertiesAnytype1, Object mapWithUndeclaredPropertiesAnytype2, Dictionary mapWithUndeclaredPropertiesAnytype3, Dictionary mapWithUndeclaredPropertiesString, Object? anytype1 = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mapProperty == null) - throw new ArgumentNullException("mapProperty is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapOfMapProperty == null) - throw new ArgumentNullException("mapOfMapProperty is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype1 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype1 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype2 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype2 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype3 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype3 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (emptyMap == null) - throw new ArgumentNullException("emptyMap is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesString == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesString is a required property for AdditionalPropertiesClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EmptyMap = emptyMap; MapOfMapProperty = mapOfMapProperty; MapProperty = mapProperty; @@ -156,12 +129,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -214,28 +188,36 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "empty_map": - emptyMap = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + emptyMap = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_of_map_property": - mapOfMapProperty = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfMapProperty = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_property": - mapProperty = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapProperty = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_1": - mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_2": - mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_3": - mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_string": - mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "anytype_1": - anytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -243,6 +225,33 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mapProperty == null) + throw new ArgumentNullException(nameof(mapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (mapOfMapProperty == null) + throw new ArgumentNullException(nameof(mapOfMapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype1 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype1), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype2 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype2), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype3 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype3), "Property is required for class AdditionalPropertiesClass."); + + if (emptyMap == null) + throw new ArgumentNullException(nameof(emptyMap), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesString == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new AdditionalPropertiesClass(emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString, anytype1); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs index 3070edb4001..a2d20ac42f2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs @@ -36,20 +36,8 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - public Animal(string className, string color = "red") + public Animal(string className, string color = @"red") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for Animal and cannot be null."); - - if (color == null) - throw new ArgumentNullException("color is a required property for Animal and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; Color = color; } @@ -86,12 +74,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -159,6 +148,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Animal."); + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class Animal."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Animal(className, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs index 3d8432fe462..6afa4417f37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -39,21 +39,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ApiResponse(int code, string message, string type) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (code == null) - throw new ArgumentNullException("code is a required property for ApiResponse and cannot be null."); - - if (type == null) - throw new ArgumentNullException("type is a required property for ApiResponse and cannot be null."); - - if (message == null) - throw new ArgumentNullException("message is a required property for ApiResponse and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Code = code; Message = message; Type = type; @@ -98,12 +83,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -151,7 +137,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "code": - code = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + code = utf8JsonReader.GetInt32(); break; case "message": message = utf8JsonReader.GetString(); @@ -165,6 +152,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (code == null) + throw new ArgumentNullException(nameof(code), "Property is required for class ApiResponse."); + + if (type == null) + throw new ArgumentNullException(nameof(type), "Property is required for class ApiResponse."); + + if (message == null) + throw new ArgumentNullException(nameof(message), "Property is required for class ApiResponse."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ApiResponse(code, message, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs index b71acea3d36..f084f92dbf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Apple(string cultivar, string origin) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (cultivar == null) - throw new ArgumentNullException("cultivar is a required property for Apple and cannot be null."); - - if (origin == null) - throw new ArgumentNullException("origin is a required property for Apple and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Cultivar = cultivar; Origin = origin; } @@ -86,22 +74,23 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); @@ -163,6 +152,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (cultivar == null) + throw new ArgumentNullException(nameof(cultivar), "Property is required for class Apple."); + + if (origin == null) + throw new ArgumentNullException(nameof(origin), "Property is required for class Apple."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Apple(cultivar, origin); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs index 352169dc60a..1abcf6887a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public AppleReq(string cultivar, bool mealy) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (cultivar == null) - throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null."); - - if (mealy == null) - throw new ArgumentNullException("mealy is a required property for AppleReq and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Cultivar = cultivar; Mealy = mealy; } @@ -79,12 +67,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -134,7 +123,8 @@ namespace Org.OpenAPITools.Model cultivar = utf8JsonReader.GetString(); break; case "mealy": - mealy = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mealy = utf8JsonReader.GetBoolean(); break; default: break; @@ -142,6 +132,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (cultivar == null) + throw new ArgumentNullException(nameof(cultivar), "Property is required for class AppleReq."); + + if (mealy == null) + throw new ArgumentNullException(nameof(mealy), "Property is required for class AppleReq."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new AppleReq(cultivar, mealy); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 1d20521b20e..8700ec16e3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayArrayNumber == null) - throw new ArgumentNullException("arrayArrayNumber is a required property for ArrayOfArrayOfNumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayArrayNumber = arrayArrayNumber; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "ArrayArrayNumber": - arrayArrayNumber = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayNumber = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayArrayNumber == null) + throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 2a3bfde63f3..9a906125a67 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayOfNumberOnly(List arrayNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayNumber == null) - throw new ArgumentNullException("arrayNumber is a required property for ArrayOfNumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayNumber = arrayNumber; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "ArrayNumber": - arrayNumber = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNumber = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayNumber == null) + throw new ArgumentNullException(nameof(arrayNumber), "Property is required for class ArrayOfNumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayOfNumberOnly(arrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs index 275cbe9514d..a607deec738 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -39,21 +39,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayTest(List> arrayArrayOfInteger, List> arrayArrayOfModel, List arrayOfString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayOfString == null) - throw new ArgumentNullException("arrayOfString is a required property for ArrayTest and cannot be null."); - - if (arrayArrayOfInteger == null) - throw new ArgumentNullException("arrayArrayOfInteger is a required property for ArrayTest and cannot be null."); - - if (arrayArrayOfModel == null) - throw new ArgumentNullException("arrayArrayOfModel is a required property for ArrayTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayArrayOfInteger = arrayArrayOfInteger; ArrayArrayOfModel = arrayArrayOfModel; ArrayOfString = arrayOfString; @@ -98,12 +83,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -151,13 +137,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_array_of_integer": - arrayArrayOfInteger = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfInteger = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_array_of_model": - arrayArrayOfModel = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfModel = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_of_string": - arrayOfString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayOfString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -165,6 +154,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayOfString == null) + throw new ArgumentNullException(nameof(arrayOfString), "Property is required for class ArrayTest."); + + if (arrayArrayOfInteger == null) + throw new ArgumentNullException(nameof(arrayArrayOfInteger), "Property is required for class ArrayTest."); + + if (arrayArrayOfModel == null) + throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is required for class ArrayTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs index 6b0800e2c0f..bcade3d067b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Banana(decimal lengthCm) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (lengthCm == null) - throw new ArgumentNullException("lengthCm is a required property for Banana and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - LengthCm = lengthCm; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "lengthCm": - lengthCm = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = utf8JsonReader.GetDecimal(); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (lengthCm == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is required for class Banana."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Banana(lengthCm); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs index 2c3af06b69d..68e1f8b576c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public BananaReq(decimal lengthCm, bool sweet) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (lengthCm == null) - throw new ArgumentNullException("lengthCm is a required property for BananaReq and cannot be null."); - - if (sweet == null) - throw new ArgumentNullException("sweet is a required property for BananaReq and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - LengthCm = lengthCm; Sweet = sweet; } @@ -79,12 +67,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,10 +120,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "lengthCm": - lengthCm = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = utf8JsonReader.GetDecimal(); break; case "sweet": - sweet = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sweet = utf8JsonReader.GetBoolean(); break; default: break; @@ -142,6 +133,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (lengthCm == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is required for class BananaReq."); + + if (sweet == null) + throw new ArgumentNullException(nameof(sweet), "Property is required for class BananaReq."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new BananaReq(lengthCm, sweet); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs index acf6515437b..55402711a4d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public BasquePig(string className) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for BasquePig and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class BasquePig."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new BasquePig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs index 7ce8d8ff649..9633267213b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs @@ -42,30 +42,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Capitalization(string aTTNAME, string capitalCamel, string capitalSnake, string sCAETHFlowPoints, string smallCamel, string smallSnake) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (smallCamel == null) - throw new ArgumentNullException("smallCamel is a required property for Capitalization and cannot be null."); - - if (capitalCamel == null) - throw new ArgumentNullException("capitalCamel is a required property for Capitalization and cannot be null."); - - if (smallSnake == null) - throw new ArgumentNullException("smallSnake is a required property for Capitalization and cannot be null."); - - if (capitalSnake == null) - throw new ArgumentNullException("capitalSnake is a required property for Capitalization and cannot be null."); - - if (sCAETHFlowPoints == null) - throw new ArgumentNullException("sCAETHFlowPoints is a required property for Capitalization and cannot be null."); - - if (aTTNAME == null) - throw new ArgumentNullException("aTTNAME is a required property for Capitalization and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ATT_NAME = aTTNAME; CapitalCamel = capitalCamel; CapitalSnake = capitalSnake; @@ -135,12 +111,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -214,6 +191,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (smallCamel == null) + throw new ArgumentNullException(nameof(smallCamel), "Property is required for class Capitalization."); + + if (capitalCamel == null) + throw new ArgumentNullException(nameof(capitalCamel), "Property is required for class Capitalization."); + + if (smallSnake == null) + throw new ArgumentNullException(nameof(smallSnake), "Property is required for class Capitalization."); + + if (capitalSnake == null) + throw new ArgumentNullException(nameof(capitalSnake), "Property is required for class Capitalization."); + + if (sCAETHFlowPoints == null) + throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is required for class Capitalization."); + + if (aTTNAME == null) + throw new ArgumentNullException(nameof(aTTNAME), "Property is required for class Capitalization."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs index fd222ece114..7dd556c2132 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Cat.cs @@ -38,7 +38,7 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - internal Cat(Dictionary dictionary, CatAllOf catAllOf, string className, string color = "red") : base(className, color) + internal Cat(Dictionary dictionary, CatAllOf catAllOf, string className, string color = @"red") : base(className, color) { Dictionary = dictionary; CatAllOf = catAllOf; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs index e5c54bbf47b..88a9b2164cf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public CatAllOf(bool declawed) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (declawed == null) - throw new ArgumentNullException("declawed is a required property for CatAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Declawed = declawed; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "declawed": - declawed = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + declawed = utf8JsonReader.GetBoolean(); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (declawed == null) + throw new ArgumentNullException(nameof(declawed), "Property is required for class CatAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new CatAllOf(declawed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs index 40760ae96fc..3a7ed4397ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs @@ -36,20 +36,8 @@ namespace Org.OpenAPITools.Model /// id /// name (default to "default-name") [JsonConstructor] - public Category(long id, string name = "default-name") + public Category(long id, string name = @"default-name") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Category and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Category and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; Name = name; } @@ -86,12 +74,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -138,7 +127,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); @@ -149,6 +139,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Category."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Category."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Category(id, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index 32aedbbc9c5..b9f826f1d53 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ChildCatAllOf(string name, PetTypeEnum petType = PetTypeEnum.ChildCat) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for ChildCatAllOf and cannot be null."); - - if (petType == null) - throw new ArgumentNullException("petType is a required property for ChildCatAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Name = name; PetType = petType; } @@ -125,12 +113,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -189,6 +178,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class ChildCatAllOf."); + + if (petType == null) + throw new ArgumentNullException(nameof(petType), "Property is required for class ChildCatAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ChildCatAllOf(name, petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs index da7dc6abac1..576db4b59c3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ClassModel(string classProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (classProperty == null) - throw new ArgumentNullException("classProperty is a required property for ClassModel and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassProperty = classProperty; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (classProperty == null) + throw new ArgumentNullException(nameof(classProperty), "Property is required for class ClassModel."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ClassModel(classProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index b2bb1ac0d87..9619880abf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -70,12 +70,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs index 85fe617e5cd..e33b6275984 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DanishPig(string className) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for DanishPig and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class DanishPig."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DanishPig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 4ed685bcfd4..391564594c4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -37,21 +37,13 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DateOnlyClass(DateTime dateOnlyProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (dateOnlyProperty == null) - throw new ArgumentNullException("dateOnlyProperty is a required property for DateOnlyClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DateOnlyProperty = dateOnlyProperty; } /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [JsonPropertyName("dateOnlyProperty")] public DateTime DateOnlyProperty { get; set; } @@ -74,12 +66,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -93,7 +86,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize DateOnlyProperty /// - public static string DateOnlyPropertyFormat { get; set; } = "yyyy-MM-dd"; + public static string DateOnlyPropertyFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// A Json reader. @@ -130,7 +123,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "dateOnlyProperty": - dateOnlyProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOnlyProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -138,6 +132,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (dateOnlyProperty == null) + throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is required for class DateOnlyClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DateOnlyClass(dateOnlyProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs index d45666b9644..858fdcc62b0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DeprecatedObject(string name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for DeprecatedObject and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Name = name; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class DeprecatedObject."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DeprecatedObject(name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs index ef7bfd2e9e3..b05156f1233 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Dog.cs @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - internal Dog(DogAllOf dogAllOf, string className, string color = "red") : base(className, color) + internal Dog(DogAllOf dogAllOf, string className, string color = @"red") : base(className, color) { DogAllOf = dogAllOf; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs index ed252b23eaa..c31395c91b8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DogAllOf(string breed) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (breed == null) - throw new ArgumentNullException("breed is a required property for DogAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Breed = breed; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (breed == null) + throw new ArgumentNullException(nameof(breed), "Property is required for class DogAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DogAllOf(breed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs index 59da7b09ba9..361f3dd8399 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs @@ -40,21 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Drawing(Shape mainShape, ShapeOrNull shapeOrNull, List shapes, NullableShape? nullableShape = default) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mainShape == null) - throw new ArgumentNullException("mainShape is a required property for Drawing and cannot be null."); - - if (shapeOrNull == null) - throw new ArgumentNullException("shapeOrNull is a required property for Drawing and cannot be null."); - - if (shapes == null) - throw new ArgumentNullException("shapes is a required property for Drawing and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - MainShape = mainShape; ShapeOrNull = shapeOrNull; Shapes = shapes; @@ -101,12 +86,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -155,16 +141,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "mainShape": - mainShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mainShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "shapeOrNull": - shapeOrNull = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapeOrNull = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "shapes": - shapes = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapes = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "nullableShape": - nullableShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nullableShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -172,6 +162,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mainShape == null) + throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing."); + + if (shapeOrNull == null) + throw new ArgumentNullException(nameof(shapeOrNull), "Property is required for class Drawing."); + + if (shapes == null) + throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Drawing(mainShape, shapeOrNull, shapes, nullableShape); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs index 8fbd4d1f573..ec7849c2894 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public EnumArrays(List arrayEnum, JustSymbolEnum justSymbol) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (justSymbol == null) - throw new ArgumentNullException("justSymbol is a required property for EnumArrays and cannot be null."); - - if (arrayEnum == null) - throw new ArgumentNullException("arrayEnum is a required property for EnumArrays and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayEnum = arrayEnum; JustSymbol = justSymbol; } @@ -146,7 +134,7 @@ namespace Org.OpenAPITools.Model public static string JustSymbolEnumToJsonValue(JustSymbolEnum value) { if (value == JustSymbolEnum.GreaterThanOrEqualTo) - return ">="; + return ">="; if (value == JustSymbolEnum.Dollar) return "$"; @@ -186,12 +174,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -238,7 +227,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_enum": - arrayEnum = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayEnum = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); @@ -250,6 +240,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (justSymbol == null) + throw new ArgumentNullException(nameof(justSymbol), "Property is required for class EnumArrays."); + + if (arrayEnum == null) + throw new ArgumentNullException(nameof(arrayEnum), "Property is required for class EnumArrays."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new EnumArrays(arrayEnum, justSymbol); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs index 8bc6e269703..9634aceecd2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs @@ -45,36 +45,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public EnumTest(EnumIntegerEnum enumInteger, EnumIntegerOnlyEnum enumIntegerOnly, EnumNumberEnum enumNumber, EnumStringEnum enumString, EnumStringRequiredEnum enumStringRequired, OuterEnumDefaultValue outerEnumDefaultValue, OuterEnumInteger outerEnumInteger, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue, OuterEnum? outerEnum = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (enumString == null) - throw new ArgumentNullException("enumString is a required property for EnumTest and cannot be null."); - - if (enumStringRequired == null) - throw new ArgumentNullException("enumStringRequired is a required property for EnumTest and cannot be null."); - - if (enumInteger == null) - throw new ArgumentNullException("enumInteger is a required property for EnumTest and cannot be null."); - - if (enumIntegerOnly == null) - throw new ArgumentNullException("enumIntegerOnly is a required property for EnumTest and cannot be null."); - - if (enumNumber == null) - throw new ArgumentNullException("enumNumber is a required property for EnumTest and cannot be null."); - - if (outerEnumInteger == null) - throw new ArgumentNullException("outerEnumInteger is a required property for EnumTest and cannot be null."); - - if (outerEnumDefaultValue == null) - throw new ArgumentNullException("outerEnumDefaultValue is a required property for EnumTest and cannot be null."); - - if (outerEnumIntegerDefaultValue == null) - throw new ArgumentNullException("outerEnumIntegerDefaultValue is a required property for EnumTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EnumInteger = enumInteger; EnumIntegerOnly = enumIntegerOnly; EnumNumber = enumNumber; @@ -427,12 +397,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -486,13 +457,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "enum_integer": - enumInteger = (EnumTest.EnumIntegerEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumInteger = (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32(); break; case "enum_integer_only": - enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32(); break; case "enum_number": - enumNumber = (EnumTest.EnumNumberEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumNumber = (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32(); break; case "enum_string": string enumStringRawValue = utf8JsonReader.GetString(); @@ -524,6 +498,36 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (enumString == null) + throw new ArgumentNullException(nameof(enumString), "Property is required for class EnumTest."); + + if (enumStringRequired == null) + throw new ArgumentNullException(nameof(enumStringRequired), "Property is required for class EnumTest."); + + if (enumInteger == null) + throw new ArgumentNullException(nameof(enumInteger), "Property is required for class EnumTest."); + + if (enumIntegerOnly == null) + throw new ArgumentNullException(nameof(enumIntegerOnly), "Property is required for class EnumTest."); + + if (enumNumber == null) + throw new ArgumentNullException(nameof(enumNumber), "Property is required for class EnumTest."); + + if (outerEnumInteger == null) + throw new ArgumentNullException(nameof(outerEnumInteger), "Property is required for class EnumTest."); + + if (outerEnumDefaultValue == null) + throw new ArgumentNullException(nameof(outerEnumDefaultValue), "Property is required for class EnumTest."); + + if (outerEnumIntegerDefaultValue == null) + throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is required for class EnumTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new EnumTest(enumInteger, enumIntegerOnly, enumNumber, enumString, enumStringRequired, outerEnumDefaultValue, outerEnumInteger, outerEnumIntegerDefaultValue, outerEnum); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 1e4a0880df5..f7ec9ae58ea 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -70,12 +70,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs index 6b69a19c48a..7cc77e435e6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public File(string sourceURI) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (sourceURI == null) - throw new ArgumentNullException("sourceURI is a required property for File and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - SourceURI = sourceURI; } @@ -75,12 +66,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -134,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (sourceURI == null) + throw new ArgumentNullException(nameof(sourceURI), "Property is required for class File."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new File(sourceURI); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 8b420dd5dc2..9e311213aec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public FileSchemaTestClass(File file, List files) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (file == null) - throw new ArgumentNullException("file is a required property for FileSchemaTestClass and cannot be null."); - - if (files == null) - throw new ArgumentNullException("files is a required property for FileSchemaTestClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - File = file; Files = files; } @@ -86,12 +74,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -138,10 +127,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "file": - file = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + file = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "files": - files = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + files = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -149,6 +140,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (file == null) + throw new ArgumentNullException(nameof(file), "Property is required for class FileSchemaTestClass."); + + if (files == null) + throw new ArgumentNullException(nameof(files), "Property is required for class FileSchemaTestClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new FileSchemaTestClass(file, files); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs index 2de7d254da5..77935ec9156 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs @@ -35,17 +35,8 @@ namespace Org.OpenAPITools.Model /// /// bar (default to "bar") [JsonConstructor] - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for Foo and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class Foo."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Foo(bar); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 31e72dfb686..75c745b984d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public FooGetDefaultResponse(Foo stringProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (stringProperty == null) - throw new ArgumentNullException("stringProperty is a required property for FooGetDefaultResponse and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - StringProperty = stringProperty; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "string": - stringProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + stringProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (stringProperty == null) + throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FooGetDefaultResponse."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new FooGetDefaultResponse(stringProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs index 81c3bb07625..591888d3b5d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs @@ -48,64 +48,12 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// stringProperty + /// unsignedInteger + /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, Guid uuid) + public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (integer == null) - throw new ArgumentNullException("integer is a required property for FormatTest and cannot be null."); - - if (int32 == null) - throw new ArgumentNullException("int32 is a required property for FormatTest and cannot be null."); - - if (int64 == null) - throw new ArgumentNullException("int64 is a required property for FormatTest and cannot be null."); - - if (number == null) - throw new ArgumentNullException("number is a required property for FormatTest and cannot be null."); - - if (floatProperty == null) - throw new ArgumentNullException("floatProperty is a required property for FormatTest and cannot be null."); - - if (doubleProperty == null) - throw new ArgumentNullException("doubleProperty is a required property for FormatTest and cannot be null."); - - if (decimalProperty == null) - throw new ArgumentNullException("decimalProperty is a required property for FormatTest and cannot be null."); - - if (stringProperty == null) - throw new ArgumentNullException("stringProperty is a required property for FormatTest and cannot be null."); - - if (byteProperty == null) - throw new ArgumentNullException("byteProperty is a required property for FormatTest and cannot be null."); - - if (binary == null) - throw new ArgumentNullException("binary is a required property for FormatTest and cannot be null."); - - if (date == null) - throw new ArgumentNullException("date is a required property for FormatTest and cannot be null."); - - if (dateTime == null) - throw new ArgumentNullException("dateTime is a required property for FormatTest and cannot be null."); - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for FormatTest and cannot be null."); - - if (password == null) - throw new ArgumentNullException("password is a required property for FormatTest and cannot be null."); - - if (patternWithDigits == null) - throw new ArgumentNullException("patternWithDigits is a required property for FormatTest and cannot be null."); - - if (patternWithDigitsAndDelimiter == null) - throw new ArgumentNullException("patternWithDigitsAndDelimiter is a required property for FormatTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Binary = binary; ByteProperty = byteProperty; Date = date; @@ -121,6 +69,8 @@ namespace Org.OpenAPITools.Model PatternWithDigits = patternWithDigits; PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; StringProperty = stringProperty; + UnsignedInteger = unsignedInteger; + UnsignedLong = unsignedLong; Uuid = uuid; } @@ -139,12 +89,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [JsonPropertyName("date")] public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [JsonPropertyName("dateTime")] public DateTime DateTime { get; set; } @@ -216,9 +168,22 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string StringProperty { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [JsonPropertyName("unsigned_integer")] + public uint UnsignedInteger { get; set; } + + /// + /// Gets or Sets UnsignedLong + /// + [JsonPropertyName("unsigned_long")] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [JsonPropertyName("uuid")] public Guid Uuid { get; set; } @@ -251,17 +216,20 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" StringProperty: ").Append(StringProperty).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // DoubleProperty (double) maximum if (this.DoubleProperty > (double)123.4) @@ -336,26 +304,38 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); } // StringProperty (string) pattern - Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexStringProperty.Match(this.StringProperty).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + yield break; } } @@ -368,7 +348,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize Date /// - public static string DateFormat { get; set; } = "yyyy-MM-dd"; + public static string DateFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// The format to use to serialize DateTime @@ -407,6 +387,8 @@ namespace Org.OpenAPITools.Model string patternWithDigits = default; string patternWithDigitsAndDelimiter = default; string stringProperty = default; + uint unsignedInteger = default; + ulong unsignedLong = default; Guid uuid = default; while (utf8JsonReader.Read()) @@ -425,37 +407,48 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "binary": - binary = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + binary = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "byte": - byteProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + byteProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "date": - date = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + date = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "dateTime": - dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "decimal": - decimalProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + decimalProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "double": - doubleProperty = utf8JsonReader.GetDouble(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + doubleProperty = utf8JsonReader.GetDouble(); break; case "float": - floatProperty = (float)utf8JsonReader.GetDouble(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + floatProperty = (float)utf8JsonReader.GetDouble(); break; case "int32": - int32 = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32 = utf8JsonReader.GetInt32(); break; case "int64": - int64 = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64 = utf8JsonReader.GetInt64(); break; case "integer": - integer = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integer = utf8JsonReader.GetInt32(); break; case "number": - number = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + number = utf8JsonReader.GetDecimal(); break; case "password": password = utf8JsonReader.GetString(); @@ -469,8 +462,17 @@ namespace Org.OpenAPITools.Model case "string": stringProperty = utf8JsonReader.GetString(); break; + case "unsigned_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedInteger = utf8JsonReader.GetUInt32(); + break; + case "unsigned_long": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedLong = utf8JsonReader.GetUInt64(); + break; case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; default: break; @@ -478,7 +480,67 @@ namespace Org.OpenAPITools.Model } } - return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, uuid); +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (integer == null) + throw new ArgumentNullException(nameof(integer), "Property is required for class FormatTest."); + + if (int32 == null) + throw new ArgumentNullException(nameof(int32), "Property is required for class FormatTest."); + + if (unsignedInteger == null) + throw new ArgumentNullException(nameof(unsignedInteger), "Property is required for class FormatTest."); + + if (int64 == null) + throw new ArgumentNullException(nameof(int64), "Property is required for class FormatTest."); + + if (unsignedLong == null) + throw new ArgumentNullException(nameof(unsignedLong), "Property is required for class FormatTest."); + + if (number == null) + throw new ArgumentNullException(nameof(number), "Property is required for class FormatTest."); + + if (floatProperty == null) + throw new ArgumentNullException(nameof(floatProperty), "Property is required for class FormatTest."); + + if (doubleProperty == null) + throw new ArgumentNullException(nameof(doubleProperty), "Property is required for class FormatTest."); + + if (decimalProperty == null) + throw new ArgumentNullException(nameof(decimalProperty), "Property is required for class FormatTest."); + + if (stringProperty == null) + throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FormatTest."); + + if (byteProperty == null) + throw new ArgumentNullException(nameof(byteProperty), "Property is required for class FormatTest."); + + if (binary == null) + throw new ArgumentNullException(nameof(binary), "Property is required for class FormatTest."); + + if (date == null) + throw new ArgumentNullException(nameof(date), "Property is required for class FormatTest."); + + if (dateTime == null) + throw new ArgumentNullException(nameof(dateTime), "Property is required for class FormatTest."); + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class FormatTest."); + + if (password == null) + throw new ArgumentNullException(nameof(password), "Property is required for class FormatTest."); + + if (patternWithDigits == null) + throw new ArgumentNullException(nameof(patternWithDigits), "Property is required for class FormatTest."); + + if (patternWithDigitsAndDelimiter == null) + throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is required for class FormatTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid); } /// @@ -510,6 +572,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits); writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter); writer.WriteString("string", formatTest.StringProperty); + writer.WriteNumber("unsigned_integer", formatTest.UnsignedInteger); + writer.WriteNumber("unsigned_long", formatTest.UnsignedLong); writer.WriteString("uuid", formatTest.Uuid); writer.WriteEndObject(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs index ca28985fddc..83d7de4996d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs @@ -38,15 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Apple? apple, string color) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException(nameof(Color)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Apple = apple; Color = color; } @@ -59,15 +50,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Banana banana, string color) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException(nameof(Color)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Banana = banana; Color = color; } @@ -100,12 +82,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -165,6 +148,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (appleDeserialized) return new Fruit(apple, color); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs index 7d78927ea48..548f7216c26 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs @@ -71,12 +71,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs index 1d92a6e1d55..d93e9095ca4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs @@ -39,15 +39,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public GmFruit(Apple? apple, Banana banana, string color) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException("color is a required property for GmFruit and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Apple = Apple; Banana = Banana; Color = color; @@ -81,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -146,6 +138,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class GmFruit."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new GmFruit(apple, banana, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index efb0be266ac..6a6d2c5a391 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public GrandparentAnimal(string petType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (petType == null) - throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - PetType = petType; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -143,6 +135,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (petType == null) + throw new ArgumentNullException(nameof(petType), "Property is required for class GrandparentAnimal."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new GrandparentAnimal(petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 684dde7563b..3bc1499a353 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] internal HasOnlyReadOnly(string bar, string foo) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for HasOnlyReadOnly and cannot be null."); - - if (foo == null) - throw new ArgumentNullException("foo is a required property for HasOnlyReadOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; Foo = foo; } @@ -123,12 +111,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -186,6 +175,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class HasOnlyReadOnly."); + + if (foo == null) + throw new ArgumentNullException(nameof(foo), "Property is required for class HasOnlyReadOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new HasOnlyReadOnly(bar, foo); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 2d2b6314b50..1dd69331d4b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -65,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3692266e079..e7419bb25ae 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -63,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs index d87c1371cd8..7257bb6701c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public List(string _123list) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (_123list == null) - throw new ArgumentNullException("_123list is a required property for List and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - _123List = _123list; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (_123list == null) + throw new ArgumentNullException(nameof(_123list), "Property is required for class List."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new List(_123list); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..3b3aa42307c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,173 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + public partial class LiteralStringClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username") + /// unescapedLiteralString (default to "C:\Users\username") + [JsonConstructor] + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + EscapedLiteralString = escapedLiteralString; + UnescapedLiteralString = unescapedLiteralString; + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [JsonPropertyName("escapedLiteralString")] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [JsonPropertyName("unescapedLiteralString")] + public string UnescapedLiteralString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type LiteralStringClass + /// + public class LiteralStringClassJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override LiteralStringClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string escapedLiteralString = default; + string unescapedLiteralString = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "escapedLiteralString": + escapedLiteralString = utf8JsonReader.GetString(); + break; + case "unescapedLiteralString": + unescapedLiteralString = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (escapedLiteralString == null) + throw new ArgumentNullException(nameof(escapedLiteralString), "Property is required for class LiteralStringClass."); + + if (unescapedLiteralString == null) + throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is required for class LiteralStringClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WriteString("escapedLiteralString", literalStringClass.EscapedLiteralString); + writer.WriteString("unescapedLiteralString", literalStringClass.UnescapedLiteralString); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs index a82b0031660..c2f3de4b89d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs @@ -93,12 +93,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs index c2e43608be8..efe466ed493 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs @@ -40,24 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public MapTest(Dictionary directMap, Dictionary indirectMap, Dictionary> mapMapOfString, Dictionary mapOfEnumString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mapMapOfString == null) - throw new ArgumentNullException("mapMapOfString is a required property for MapTest and cannot be null."); - - if (mapOfEnumString == null) - throw new ArgumentNullException("mapOfEnumString is a required property for MapTest and cannot be null."); - - if (directMap == null) - throw new ArgumentNullException("directMap is a required property for MapTest and cannot be null."); - - if (indirectMap == null) - throw new ArgumentNullException("indirectMap is a required property for MapTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DirectMap = directMap; IndirectMap = indirectMap; MapMapOfString = mapMapOfString; @@ -160,12 +142,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -214,16 +197,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "direct_map": - directMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + directMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "indirect_map": - indirectMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + indirectMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_map_of_string": - mapMapOfString = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapMapOfString = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_of_enum_string": - mapOfEnumString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfEnumString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -231,6 +218,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mapMapOfString == null) + throw new ArgumentNullException(nameof(mapMapOfString), "Property is required for class MapTest."); + + if (mapOfEnumString == null) + throw new ArgumentNullException(nameof(mapOfEnumString), "Property is required for class MapTest."); + + if (directMap == null) + throw new ArgumentNullException(nameof(directMap), "Property is required for class MapTest."); + + if (indirectMap == null) + throw new ArgumentNullException(nameof(indirectMap), "Property is required for class MapTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 2b338b9ac91..743d37e3fc1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -40,24 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid, Guid uuidWithPattern) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (uuidWithPattern == null) - throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (dateTime == null) - throw new ArgumentNullException("dateTime is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (map == null) - throw new ArgumentNullException("map is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DateTime = dateTime; Map = map; Uuid = uuid; @@ -110,15 +92,16 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); @@ -176,16 +159,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "dateTime": - dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map": - map = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + map = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; case "uuid_with_pattern": - uuidWithPattern = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuidWithPattern = utf8JsonReader.GetGuid(); break; default: break; @@ -193,6 +180,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (uuidWithPattern == null) + throw new ArgumentNullException(nameof(uuidWithPattern), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (dateTime == null) + throw new ArgumentNullException(nameof(dateTime), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (map == null) + throw new ArgumentNullException(nameof(map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs index 99b8a6384a6..4ad661c7f9c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Model200Response(string classProperty, int name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for Model200Response and cannot be null."); - - if (classProperty == null) - throw new ArgumentNullException("classProperty is a required property for Model200Response and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassProperty = classProperty; Name = name; } @@ -86,12 +74,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -141,7 +130,8 @@ namespace Org.OpenAPITools.Model classProperty = utf8JsonReader.GetString(); break; case "name": - name = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + name = utf8JsonReader.GetInt32(); break; default: break; @@ -149,6 +139,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Model200Response."); + + if (classProperty == null) + throw new ArgumentNullException(nameof(classProperty), "Property is required for class Model200Response."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Model200Response(classProperty, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs index 1096022a282..4825671d0d7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ModelClient(string clientProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (clientProperty == null) - throw new ArgumentNullException("clientProperty is a required property for ModelClient and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - _ClientProperty = clientProperty; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (clientProperty == null) + throw new ArgumentNullException(nameof(clientProperty), "Property is required for class ModelClient."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ModelClient(clientProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs index 131673578ad..180373aa04e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs @@ -40,24 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Name(int nameProperty, string property, int snakeCase, int _123number) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (nameProperty == null) - throw new ArgumentNullException("nameProperty is a required property for Name and cannot be null."); - - if (snakeCase == null) - throw new ArgumentNullException("snakeCase is a required property for Name and cannot be null."); - - if (property == null) - throw new ArgumentNullException("property is a required property for Name and cannot be null."); - - if (_123number == null) - throw new ArgumentNullException("_123number is a required property for Name and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - NameProperty = nameProperty; Property = property; SnakeCase = snakeCase; @@ -147,12 +129,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -201,16 +184,19 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "name": - nameProperty = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nameProperty = utf8JsonReader.GetInt32(); break; case "property": property = utf8JsonReader.GetString(); break; case "snake_case": - snakeCase = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + snakeCase = utf8JsonReader.GetInt32(); break; case "123Number": - _123number = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + _123number = utf8JsonReader.GetInt32(); break; default: break; @@ -218,6 +204,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (nameProperty == null) + throw new ArgumentNullException(nameof(nameProperty), "Property is required for class Name."); + + if (snakeCase == null) + throw new ArgumentNullException(nameof(snakeCase), "Property is required for class Name."); + + if (property == null) + throw new ArgumentNullException(nameof(property), "Property is required for class Name."); + + if (_123number == null) + throw new ArgumentNullException(nameof(_123number), "Property is required for class Name."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Name(nameProperty, property, snakeCase, _123number); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs index 90755599f3a..27dce406fad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs @@ -48,18 +48,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public NullableClass(List arrayItemsNullable, Dictionary objectItemsNullable, List? arrayAndItemsNullableProp = default, List? arrayNullableProp = default, bool? booleanProp = default, DateTime? dateProp = default, DateTime? datetimeProp = default, int? integerProp = default, decimal? numberProp = default, Dictionary? objectAndItemsNullableProp = default, Dictionary? objectNullableProp = default, string? stringProp = default) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayItemsNullable == null) - throw new ArgumentNullException("arrayItemsNullable is a required property for NullableClass and cannot be null."); - - if (objectItemsNullable == null) - throw new ArgumentNullException("objectItemsNullable is a required property for NullableClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayItemsNullable = arrayItemsNullable; ObjectItemsNullable = objectItemsNullable; ArrayAndItemsNullableProp = arrayAndItemsNullableProp; @@ -170,12 +158,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -189,7 +178,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize DateProp /// - public static string DatePropFormat { get; set; } = "yyyy-MM-dd"; + public static string DatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// The format to use to serialize DatetimeProp @@ -242,25 +231,32 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_items_nullable": - arrayItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "object_items_nullable": - objectItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_and_items_nullable_prop": - arrayAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_nullable_prop": - arrayNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "boolean_prop": - booleanProp = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + booleanProp = utf8JsonReader.GetBoolean(); break; case "date_prop": - dateProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "datetime_prop": - datetimeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + datetimeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "integer_prop": if (utf8JsonReader.TokenType != JsonTokenType.Null) @@ -271,10 +267,12 @@ namespace Org.OpenAPITools.Model numberProp = utf8JsonReader.GetInt32(); break; case "object_and_items_nullable_prop": - objectAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "object_nullable_prop": - objectNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "string_prop": stringProp = utf8JsonReader.GetString(); @@ -285,6 +283,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayItemsNullable == null) + throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is required for class NullableClass."); + + if (objectItemsNullable == null) + throw new ArgumentNullException(nameof(objectItemsNullable), "Property is required for class NullableClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new NullableClass(arrayItemsNullable, objectItemsNullable, arrayAndItemsNullableProp, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectNullableProp, stringProp); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableGuidClass.cs index ec245d25b3c..2947e0d39af 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -43,6 +43,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [JsonPropertyName("uuid")] public Guid? Uuid { get; set; } @@ -65,12 +66,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -116,7 +118,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; default: break; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs index 0612b3b159c..d573815d25a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs @@ -78,12 +78,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs index a3367a63838..25488750734 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public NumberOnly(decimal justNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (justNumber == null) - throw new ArgumentNullException("justNumber is a required property for NumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - JustNumber = justNumber; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "JustNumber": - justNumber = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + justNumber = utf8JsonReader.GetDecimal(); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (justNumber == null) + throw new ArgumentNullException(nameof(justNumber), "Property is required for class NumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new NumberOnly(justNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 04be00dfbd7..65d03480f73 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -40,24 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ObjectWithDeprecatedFields(List bars, DeprecatedObject deprecatedRef, decimal id, string uuid) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (id == null) - throw new ArgumentNullException("id is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (deprecatedRef == null) - throw new ArgumentNullException("deprecatedRef is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (bars == null) - throw new ArgumentNullException("bars is a required property for ObjectWithDeprecatedFields and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bars = bars; DeprecatedRef = deprecatedRef; Id = id; @@ -113,12 +95,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -167,13 +150,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "bars": - bars = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + bars = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "deprecatedRef": - deprecatedRef = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deprecatedRef = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "id": - id = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetDecimal(); break; case "uuid": uuid = utf8JsonReader.GetString(); @@ -184,6 +170,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class ObjectWithDeprecatedFields."); + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class ObjectWithDeprecatedFields."); + + if (deprecatedRef == null) + throw new ArgumentNullException(nameof(deprecatedRef), "Property is required for class ObjectWithDeprecatedFields."); + + if (bars == null) + throw new ArgumentNullException(nameof(bars), "Property is required for class ObjectWithDeprecatedFields."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ObjectWithDeprecatedFields(bars, deprecatedRef, id, uuid); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs index a6661816f69..06f3c4f14e8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs @@ -42,30 +42,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Order(long id, long petId, int quantity, DateTime shipDate, StatusEnum status, bool complete = false) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Order and cannot be null."); - - if (petId == null) - throw new ArgumentNullException("petId is a required property for Order and cannot be null."); - - if (quantity == null) - throw new ArgumentNullException("quantity is a required property for Order and cannot be null."); - - if (shipDate == null) - throw new ArgumentNullException("shipDate is a required property for Order and cannot be null."); - - if (status == null) - throw new ArgumentNullException("status is a required property for Order and cannot be null."); - - if (complete == null) - throw new ArgumentNullException("complete is a required property for Order and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; PetId = petId; Quantity = quantity; @@ -164,6 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [JsonPropertyName("shipDate")] public DateTime ShipDate { get; set; } @@ -197,12 +174,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -258,23 +236,28 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "petId": - petId = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + petId = utf8JsonReader.GetInt64(); break; case "quantity": - quantity = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + quantity = utf8JsonReader.GetInt32(); break; case "shipDate": - shipDate = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shipDate = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "status": string statusRawValue = utf8JsonReader.GetString(); status = Order.StatusEnumFromString(statusRawValue); break; case "complete": - complete = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + complete = utf8JsonReader.GetBoolean(); break; default: break; @@ -282,6 +265,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Order."); + + if (petId == null) + throw new ArgumentNullException(nameof(petId), "Property is required for class Order."); + + if (quantity == null) + throw new ArgumentNullException(nameof(quantity), "Property is required for class Order."); + + if (shipDate == null) + throw new ArgumentNullException(nameof(shipDate), "Property is required for class Order."); + + if (status == null) + throw new ArgumentNullException(nameof(status), "Property is required for class Order."); + + if (complete == null) + throw new ArgumentNullException(nameof(complete), "Property is required for class Order."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Order(id, petId, quantity, shipDate, status, complete); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs index 41d50368e58..1356ba2a303 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -39,21 +39,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public OuterComposite(bool myBoolean, decimal myNumber, string myString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (myNumber == null) - throw new ArgumentNullException("myNumber is a required property for OuterComposite and cannot be null."); - - if (myString == null) - throw new ArgumentNullException("myString is a required property for OuterComposite and cannot be null."); - - if (myBoolean == null) - throw new ArgumentNullException("myBoolean is a required property for OuterComposite and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - MyBoolean = myBoolean; MyNumber = myNumber; MyString = myString; @@ -98,12 +83,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -151,10 +137,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "my_boolean": - myBoolean = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myBoolean = utf8JsonReader.GetBoolean(); break; case "my_number": - myNumber = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myNumber = utf8JsonReader.GetDecimal(); break; case "my_string": myString = utf8JsonReader.GetString(); @@ -165,6 +153,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (myNumber == null) + throw new ArgumentNullException(nameof(myNumber), "Property is required for class OuterComposite."); + + if (myString == null) + throw new ArgumentNullException(nameof(myString), "Property is required for class OuterComposite."); + + if (myBoolean == null) + throw new ArgumentNullException(nameof(myBoolean), "Property is required for class OuterComposite."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new OuterComposite(myBoolean, myNumber, myString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs index 1710cb27b0d..feb6a20fea8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs @@ -42,30 +42,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Pet(Category category, long id, string name, List photoUrls, StatusEnum status, List tags) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Pet and cannot be null."); - - if (category == null) - throw new ArgumentNullException("category is a required property for Pet and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Pet and cannot be null."); - - if (photoUrls == null) - throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null."); - - if (tags == null) - throw new ArgumentNullException("tags is a required property for Pet and cannot be null."); - - if (status == null) - throw new ArgumentNullException("status is a required property for Pet and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Category = category; Id = id; Name = name; @@ -158,6 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [JsonPropertyName("name")] public string Name { get; set; } @@ -197,12 +174,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -253,23 +231,27 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "category": - category = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + category = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); break; case "photoUrls": - photoUrls = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + photoUrls = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "status": string statusRawValue = utf8JsonReader.GetString(); status = Pet.StatusEnumFromString(statusRawValue); break; case "tags": - tags = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + tags = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -277,6 +259,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Pet."); + + if (category == null) + throw new ArgumentNullException(nameof(category), "Property is required for class Pet."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Pet."); + + if (photoUrls == null) + throw new ArgumentNullException(nameof(photoUrls), "Property is required for class Pet."); + + if (tags == null) + throw new ArgumentNullException(nameof(tags), "Property is required for class Pet."); + + if (status == null) + throw new ArgumentNullException(nameof(status), "Property is required for class Pet."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Pet(category, id, name, photoUrls, status, tags); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs index e04bd5f5ea8..611277e0082 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs @@ -78,12 +78,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index d317218e963..c501445a45f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -108,12 +108,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs index c07d22c60c2..f2889fe5c63 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -78,12 +78,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 592975da6f4..0b4a9afa6aa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public QuadrilateralInterface(string quadrilateralType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - QuadrilateralType = quadrilateralType; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class QuadrilateralInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new QuadrilateralInterface(quadrilateralType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 915715c96e4..cfe9707d7d4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ReadOnlyFirst(string bar, string baz) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for ReadOnlyFirst and cannot be null."); - - if (baz == null) - throw new ArgumentNullException("baz is a required property for ReadOnlyFirst and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; Baz = baz; } @@ -122,12 +110,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -185,6 +174,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class ReadOnlyFirst."); + + if (baz == null) + throw new ArgumentNullException(nameof(baz), "Property is required for class ReadOnlyFirst."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ReadOnlyFirst(bar, baz); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs index e9160910e9e..8e5ee672542 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Return(int returnProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (returnProperty == null) - throw new ArgumentNullException("returnProperty is a required property for Return and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ReturnProperty = returnProperty; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "return": - returnProperty = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + returnProperty = utf8JsonReader.GetInt32(); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (returnProperty == null) + throw new ArgumentNullException(nameof(returnProperty), "Property is required for class Return."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Return(returnProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index d8c8a860262..1263e739c65 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -70,12 +70,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs index ef640d6ecdd..4ed8771c21c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs @@ -38,15 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Shape(Triangle triangle, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Triangle = triangle; QuadrilateralType = quadrilateralType; } @@ -59,15 +50,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Shape(Quadrilateral quadrilateral, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Quadrilateral = quadrilateral; QuadrilateralType = quadrilateralType; } @@ -107,12 +89,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -182,6 +165,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class Shape."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (triangleDeserialized) return new Shape(triangle, quadrilateralType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs index f40a7dc078f..5c67fb1aaa0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeInterface(string shapeType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ShapeType = shapeType; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (shapeType == null) + throw new ArgumentNullException(nameof(shapeType), "Property is required for class ShapeInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ShapeInterface(shapeType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs index 5db8f307642..659af58ce0d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -38,15 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeOrNull(Triangle triangle, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Triangle = triangle; QuadrilateralType = quadrilateralType; } @@ -59,15 +50,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeOrNull(Quadrilateral quadrilateral, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Quadrilateral = quadrilateral; QuadrilateralType = quadrilateralType; } @@ -107,12 +89,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -182,6 +165,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class ShapeOrNull."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (triangleDeserialized) return new ShapeOrNull(triangle, quadrilateralType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 1f3b67d63b5..4f9a98be8f7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -70,12 +70,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs index b47b7e5f2c2..58d3e9d0c5a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public SpecialModelName(string specialModelNameProperty, long specialPropertyName) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (specialPropertyName == null) - throw new ArgumentNullException("specialPropertyName is a required property for SpecialModelName and cannot be null."); - - if (specialModelNameProperty == null) - throw new ArgumentNullException("specialModelNameProperty is a required property for SpecialModelName and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - SpecialModelNameProperty = specialModelNameProperty; SpecialPropertyName = specialPropertyName; } @@ -86,12 +74,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -141,7 +130,8 @@ namespace Org.OpenAPITools.Model specialModelNameProperty = utf8JsonReader.GetString(); break; case "$special[property.name]": - specialPropertyName = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + specialPropertyName = utf8JsonReader.GetInt64(); break; default: break; @@ -149,6 +139,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (specialPropertyName == null) + throw new ArgumentNullException(nameof(specialPropertyName), "Property is required for class SpecialModelName."); + + if (specialModelNameProperty == null) + throw new ArgumentNullException(nameof(specialModelNameProperty), "Property is required for class SpecialModelName."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new SpecialModelName(specialModelNameProperty, specialPropertyName); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs index 88c2b135e05..68dc9a5166a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Tag(long id, string name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Tag and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Tag and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; Name = name; } @@ -86,12 +74,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -138,7 +127,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); @@ -149,6 +139,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Tag."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Tag."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Tag(id, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..9c25311fbf9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,156 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + public partial class TestCollectionEndingWithWordList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value + [JsonConstructor] + public TestCollectionEndingWithWordList(string value) + { + Value = value; + } + + /// + /// Gets or Sets Value + /// + [JsonPropertyName("value")] + public string Value { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type TestCollectionEndingWithWordList + /// + public class TestCollectionEndingWithWordListJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordList Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string value = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "value": + value = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (value == null) + throw new ArgumentNullException(nameof(value), "Property is required for class TestCollectionEndingWithWordList."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new TestCollectionEndingWithWordList(value); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WriteString("value", testCollectionEndingWithWordList.Value); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..0c05bd9df70 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,158 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + public partial class TestCollectionEndingWithWordListObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList + [JsonConstructor] + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList) + { + TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [JsonPropertyName("TestCollectionEndingWithWordList")] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type TestCollectionEndingWithWordListObject + /// + public class TestCollectionEndingWithWordListObjectJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordListObject Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + List testCollectionEndingWithWordList = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "TestCollectionEndingWithWordList": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + testCollectionEndingWithWordList = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (testCollectionEndingWithWordList == null) + throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WritePropertyName("TestCollectionEndingWithWordList"); + JsonSerializer.Serialize(writer, testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList, jsonSerializerOptions); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs index 0500dfb8bd1..d500aa8ed2d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs @@ -39,18 +39,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(EquilateralTriangle equilateralTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EquilateralTriangle = equilateralTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -65,18 +53,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(IsoscelesTriangle isoscelesTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - IsoscelesTriangle = isoscelesTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -91,18 +67,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(ScaleneTriangle scaleneTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ScaleneTriangle = scaleneTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -155,12 +119,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -237,6 +202,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (shapeType == null) + throw new ArgumentNullException(nameof(shapeType), "Property is required for class Triangle."); + + if (triangleType == null) + throw new ArgumentNullException(nameof(triangleType), "Property is required for class Triangle."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (equilateralTriangleDeserialized) return new Triangle(equilateralTriangle, shapeType, triangleType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs index b4c68790e2d..e5005d3c845 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public TriangleInterface(string triangleType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleType == null) - throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - TriangleType = triangleType; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (triangleType == null) + throw new ArgumentNullException(nameof(triangleType), "Property is required for class TriangleInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new TriangleInterface(triangleType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs index fcbca57865a..e784cf602ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs @@ -48,39 +48,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public User(string email, string firstName, long id, string lastName, Object objectWithNoDeclaredProps, string password, string phone, int userStatus, string username, Object? anyTypeProp = default, Object? anyTypePropNullable = default, Object? objectWithNoDeclaredPropsNullable = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for User and cannot be null."); - - if (username == null) - throw new ArgumentNullException("username is a required property for User and cannot be null."); - - if (firstName == null) - throw new ArgumentNullException("firstName is a required property for User and cannot be null."); - - if (lastName == null) - throw new ArgumentNullException("lastName is a required property for User and cannot be null."); - - if (email == null) - throw new ArgumentNullException("email is a required property for User and cannot be null."); - - if (password == null) - throw new ArgumentNullException("password is a required property for User and cannot be null."); - - if (phone == null) - throw new ArgumentNullException("phone is a required property for User and cannot be null."); - - if (userStatus == null) - throw new ArgumentNullException("userStatus is a required property for User and cannot be null."); - - if (objectWithNoDeclaredProps == null) - throw new ArgumentNullException("objectWithNoDeclaredProps is a required property for User and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Email = email; FirstName = firstName; Id = id; @@ -202,12 +169,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -270,13 +238,15 @@ namespace Org.OpenAPITools.Model firstName = utf8JsonReader.GetString(); break; case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "lastName": lastName = utf8JsonReader.GetString(); break; case "objectWithNoDeclaredProps": - objectWithNoDeclaredProps = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredProps = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "password": password = utf8JsonReader.GetString(); @@ -285,19 +255,23 @@ namespace Org.OpenAPITools.Model phone = utf8JsonReader.GetString(); break; case "userStatus": - userStatus = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + userStatus = utf8JsonReader.GetInt32(); break; case "username": username = utf8JsonReader.GetString(); break; case "anyTypeProp": - anyTypeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "anyTypePropNullable": - anyTypePropNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypePropNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "objectWithNoDeclaredPropsNullable": - objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -305,6 +279,39 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class User."); + + if (username == null) + throw new ArgumentNullException(nameof(username), "Property is required for class User."); + + if (firstName == null) + throw new ArgumentNullException(nameof(firstName), "Property is required for class User."); + + if (lastName == null) + throw new ArgumentNullException(nameof(lastName), "Property is required for class User."); + + if (email == null) + throw new ArgumentNullException(nameof(email), "Property is required for class User."); + + if (password == null) + throw new ArgumentNullException(nameof(password), "Property is required for class User."); + + if (phone == null) + throw new ArgumentNullException(nameof(phone), "Property is required for class User."); + + if (userStatus == null) + throw new ArgumentNullException(nameof(userStatus), "Property is required for class User."); + + if (objectWithNoDeclaredProps == null) + throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is required for class User."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new User(email, firstName, id, lastName, objectWithNoDeclaredProps, password, phone, userStatus, username, anyTypeProp, anyTypePropNullable, objectWithNoDeclaredPropsNullable); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs index 3744d329ad8..26063e06a11 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs @@ -39,21 +39,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Whale(string className, bool hasBaleen, bool hasTeeth) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (hasBaleen == null) - throw new ArgumentNullException("hasBaleen is a required property for Whale and cannot be null."); - - if (hasTeeth == null) - throw new ArgumentNullException("hasTeeth is a required property for Whale and cannot be null."); - - if (className == null) - throw new ArgumentNullException("className is a required property for Whale and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; HasBaleen = hasBaleen; HasTeeth = hasTeeth; @@ -98,12 +83,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -154,10 +140,12 @@ namespace Org.OpenAPITools.Model className = utf8JsonReader.GetString(); break; case "hasBaleen": - hasBaleen = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasBaleen = utf8JsonReader.GetBoolean(); break; case "hasTeeth": - hasTeeth = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasTeeth = utf8JsonReader.GetBoolean(); break; default: break; @@ -165,6 +153,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (hasBaleen == null) + throw new ArgumentNullException(nameof(hasBaleen), "Property is required for class Whale."); + + if (hasTeeth == null) + throw new ArgumentNullException(nameof(hasTeeth), "Property is required for class Whale."); + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Whale."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Whale(className, hasBaleen, hasTeeth); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs index 7693d9c9094..08e85d8ed9a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs @@ -38,18 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Zebra(string className, TypeEnum type) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (type == null) - throw new ArgumentNullException("type is a required property for Zebra and cannot be null."); - - if (className == null) - throw new ArgumentNullException("className is a required property for Zebra and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; Type = type; } @@ -148,12 +136,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -212,6 +201,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (type == null) + throw new ArgumentNullException(nameof(type), "Property is required for class Zebra."); + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Zebra."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Zebra(className, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES index ff892217def..35efa408b97 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/apis/AnotherFakeApi.md docs/apis/DefaultApi.md @@ -53,6 +54,7 @@ docs/models/HasOnlyReadOnly.md docs/models/HealthCheckResult.md docs/models/IsoscelesTriangle.md docs/models/List.md +docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -85,6 +87,8 @@ docs/models/ShapeOrNull.md docs/models/SimpleQuadrilateral.md docs/models/SpecialModelName.md docs/models/Tag.md +docs/models/TestCollectionEndingWithWordList.md +docs/models/TestCollectionEndingWithWordListObject.md docs/models/Triangle.md docs/models/TriangleInterface.md docs/models/User.md @@ -170,6 +174,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -202,6 +207,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md index 82d8c6cb2c7..fe3740c7b6e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md index 4e34a6d18b3..b176ed40f3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/FormatTest.md @@ -19,6 +19,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **StringProperty** | **string** | | [optional] +**UnsignedInteger** | **uint** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [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/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/LiteralStringClass.md new file mode 100644 index 00000000000..78202190965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..5c5eb22d9a8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..cfa933cc576 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs index d79076dcd63..bfdfc0d172a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -60,5 +60,25 @@ namespace Org.OpenAPITools.Test.Api var response = await _instance.FooGetAsync(); Assert.IsType(response); } + + /// + /// Test GetCountry + /// + [Fact (Skip = "not implemented")] + public async Task GetCountryAsyncTest() + { + string country = default; + await _instance.GetCountryAsync(country); + } + + /// + /// Test Hello + /// + [Fact (Skip = "not implemented")] + public async Task HelloAsyncTest() + { + var response = await _instance.HelloAsync(); + Assert.IsType>(response); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs index 174a7e333af..94e3f6fe7fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs index c7479a3c343..03049757efe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs index 95bd1593503..92c9b0708a9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs index 8c38ac47af7..c4b0b209a91 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs index a2a9a2d49de..9b85782ecd4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs index 0610780d65d..d52d7930bb2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs index e0bd59e7732..6e10936831f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs index 8f046a0bf6b..14b87779757 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs index 53b2fe30fdb..82b117e28c2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs index df87ba3aaaa..d0dea235061 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs index 6f31ba2029b..f86e93c73ca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs index 6cb6c62ffd0..57083de2697 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs index 9798a17577b..62e066a4fc3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs index b84c7c85a7d..b2dffa3c803 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs index 3498bb0c152..a59e2faf42d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatTests.cs index 402a476d079..506c917ef4d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs index 822f8241fa0..d4f8fa6bdb1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs index d4de4c47417..d43ae8711b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs index f1b0aa1005c..4deace3c3a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs index 2e6c120d8fa..ba942072dd7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs index 3f2f96e73a1..93bb0120f1d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs index 087d38674bb..f089b42b81d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs index f98989439ed..5825715de0c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs index 85ecbfdda55..607a7db80ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs index 1e86d761507..0b64ef242be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogTests.cs index ef2eabfca31..164893d05a6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs index c38867cb5ae..81cb6fa4013 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs index ee3d000f32f..f7da9372776 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs index e2fc2d02282..8b152665a90 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs index 60e3aca92bd..8cff9853a04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs index 9ab78a59779..ccf950daf3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs index 9836a779bf0..ac711bc52d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileTests.cs index 4f0e7079bc8..6ddf36e3b3f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs index b7313941a69..3a34eb830b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooTests.cs index c0bdf85f9b0..583fec1a869 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index d3a978bdc4c..cee4ce9c80f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; @@ -176,6 +175,22 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'StringProperty' } /// + /// Test the property 'UnsignedInteger' + /// + [Fact] + public void UnsignedIntegerTest() + { + // TODO unit test for the property 'UnsignedInteger' + } + /// + /// Test the property 'UnsignedLong' + /// + [Fact] + public void UnsignedLongTest() + { + // TODO unit test for the property 'UnsignedLong' + } + /// /// Test the property 'Uuid' /// [Fact] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs index 3ef884e59c6..27433724a6a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs index 9ab6b7f2781..ca0d7778511 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs index 036c5641cf4..ae3fb07857b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs index 182cf7350b7..eee8d61e4fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs index d9a07efcf9a..b5cac232be4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs index d29edf5dd10..9a618a94825 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs index 2fed6f0b4cc..60103ce0814 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ListTests.cs index 398a4644921..859c553af6d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ListTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..7e31808e097 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs index 0889d80a708..f036aec8e7d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs index 0dc95aa6b23..975acebd3bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs index d94f882e0a2..fd9d3deca41 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; @@ -79,6 +78,14 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'Uuid' } + /// + /// Test the property 'UuidWithPattern' + /// + [Fact] + public void UuidWithPatternTest() + { + // TODO unit test for the property 'UuidWithPattern' + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs index 31f2a754314..09a24ecc6a8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs index 40b3700ce95..973df04edba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NameTests.cs index 523b3e050aa..c2024c83ac2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NameTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs index adf7c14f131..5fab915d647 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs index ed52163e5c2..5f208e16e82 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs index 734d03e5e7a..3476391608d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs index 5db923c1d3f..be8649eda4e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs index 9e9b651f818..2b962665b0c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs index 10682e72f21..7c83fb4ca0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs index 8c176d9f94c..173aa6b07c0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs index 9f6d8b52b6c..1aeee70f3d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs index e51365edb27..1fa418e64f9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs index 36e6a060f97..3225b846de0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs index b38c693d1a1..5474da73214 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs index 34cae43eac1..0d8b6863baf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PetTests.cs index 66cfbf7bdb5..4899ef39cf9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PetTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PigTests.cs index 0e85eabf160..95949c3b099 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs index 98aad34f4b4..cd8ea904c9f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs index 42243bd29c0..c846d9c5661 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs index e15b2c5c749..26c0dcaf06a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs index 7e99972f26e..8ced65980fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs index 9969564490d..919961faa02 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs index cad95d2963c..da3ee273f06 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs index 3129f3775c8..49ae5aa0208 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs index a33da20eda6..4791f74d1a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs index b2d995af504..2772e17b595 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs index 0221971c076..d6736b399b6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs index 1a5bb10af80..0efee731657 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TagTests.cs index 92a5f823659..d9390261061 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TagTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..6204d80fb4f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..4068363f13b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs index 924d6b42d7f..ad87002d06e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs index 9701da6a541..8942407fa8e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/UserTests.cs index a464c80c84c..6f96a87cdf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/UserTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs index 91a7b21f213..c1403b7f0e7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs index 08b1c6056c9..b567a8ab958 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 4611b7d5ecf..8dbd86415f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index a46d61ee554..f8d4878704f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -136,12 +136,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -153,17 +153,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -189,9 +189,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCall123TestSpecialTags(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterCall123TestSpecialTags(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -216,70 +216,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnCall123TestSpecialTags(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; - request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Patch; + httpRequestMessageLocalVar.Method = HttpMethod.Patch; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/another-fake/dummy", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/another-fake/dummy", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCall123TestSpecialTags(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCall123TestSpecialTags(apiResponseLocalVar, modelClient); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCall123TestSpecialTags(e, "/another-fake/dummy", uriBuilder.Path, modelClient); + OnErrorCall123TestSpecialTags(e, "/another-fake/dummy", uriBuilderLocalVar.Path, modelClient); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs index 23848d2c610..df868bb4bab 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -72,6 +72,28 @@ namespace Org.OpenAPITools.IApi /// Cancellation Token to cancel the request. /// Task of ApiResponse<object> Task GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Guid>>> + Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Guid>> + Task> HelloAsync(System.Threading.CancellationToken? cancellationToken = null); } } @@ -157,12 +179,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -173,17 +195,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -199,8 +221,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterFooGet(ApiResponse apiResponse) + /// + protected virtual void AfterFooGet(ApiResponse apiResponseLocalVar) { } @@ -223,57 +245,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnFooGet(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/foo"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/foo"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/foo", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/foo", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFooGet(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFooGet(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFooGet(e, "/foo", uriBuilder.Path); + OnErrorFooGet(e, "/foo", uriBuilderLocalVar.Path); throw; } } @@ -287,12 +309,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -304,17 +326,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -340,9 +362,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetCountry(ApiResponse apiResponse, string country) + protected virtual void AfterGetCountry(ApiResponse apiResponseLocalVar, string country) { } @@ -367,67 +389,176 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { country = OnGetCountry(country); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/country"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/country"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); + formParameterLocalVars.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/country", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/country", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetCountry(apiResponse, country); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetCountry(apiResponseLocalVar, country); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetCountry(e, "/country", uriBuilder.Path, country); + OnErrorGetCountry(e, "/country", uriBuilderLocalVar.Path, country); + throw; + } + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> HelloAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> apiResponseLocalVar = await HelloWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (apiResponseLocalVar.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); + + return apiResponseLocalVar.Content; + } + + /// + /// Validates the request parameters + /// + /// + protected virtual void OnHello() + { + return; + } + + /// + /// Processes the server response + /// + /// + protected virtual void AfterHello(ApiResponse> apiResponseLocalVar) + { + } + + /// + /// Processes the server response + /// + /// + /// + /// + protected virtual void OnErrorHello(Exception exception, string pathFormat, string path) + { + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + OnHello(); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/hello"; + + + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/hello", uriBuilderLocalVar.Path)); + + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); + + if (apiResponseLocalVar.IsSuccessStatusCode) + { + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterHello(apiResponseLocalVar); + } + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorHello(e, "/hello", uriBuilderLocalVar.Path); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs index 5edf723c365..0b0a79ddb6b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -531,12 +531,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -547,17 +547,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -573,8 +573,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterFakeHealthGet(ApiResponse apiResponse) + /// + protected virtual void AfterFakeHealthGet(ApiResponse apiResponseLocalVar) { } @@ -597,57 +597,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnFakeHealthGet(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/health", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/health", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeHealthGet(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeHealthGet(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeHealthGet(e, "/fake/health", uriBuilder.Path); + OnErrorFakeHealthGet(e, "/fake/health", uriBuilderLocalVar.Path); throw; } } @@ -661,14 +661,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -684,9 +684,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterBooleanSerialize(ApiResponse apiResponse, bool? body) + protected virtual void AfterFakeOuterBooleanSerialize(ApiResponse apiResponseLocalVar, bool? body) { } @@ -711,70 +711,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { body = OnFakeOuterBooleanSerialize(body); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/boolean", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/boolean", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterBooleanSerialize(apiResponse, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterBooleanSerialize(apiResponseLocalVar, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterBooleanSerialize(e, "/fake/outer/boolean", uriBuilder.Path, body); + OnErrorFakeOuterBooleanSerialize(e, "/fake/outer/boolean", uriBuilderLocalVar.Path, body); throw; } } @@ -788,12 +788,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterCompositeSerializeAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -805,17 +805,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterCompositeSerializeOrDefaultAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -832,9 +832,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterCompositeSerialize(ApiResponse apiResponse, OuterComposite outerComposite) + protected virtual void AfterFakeOuterCompositeSerialize(ApiResponse apiResponseLocalVar, OuterComposite outerComposite) { } @@ -859,70 +859,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { outerComposite = OnFakeOuterCompositeSerialize(outerComposite); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; - request.Content = (outerComposite as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(outerComposite, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (outerComposite as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(outerComposite, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/composite", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/composite", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterCompositeSerialize(apiResponse, outerComposite); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterCompositeSerialize(apiResponseLocalVar, outerComposite); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterCompositeSerialize(e, "/fake/outer/composite", uriBuilder.Path, outerComposite); + OnErrorFakeOuterCompositeSerialize(e, "/fake/outer/composite", uriBuilderLocalVar.Path, outerComposite); throw; } } @@ -936,14 +936,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -959,9 +959,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterNumberSerialize(ApiResponse apiResponse, decimal? body) + protected virtual void AfterFakeOuterNumberSerialize(ApiResponse apiResponseLocalVar, decimal? body) { } @@ -986,70 +986,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { body = OnFakeOuterNumberSerialize(body); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/number", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/number", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterNumberSerialize(apiResponse, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterNumberSerialize(apiResponseLocalVar, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterNumberSerialize(e, "/fake/outer/number", uriBuilder.Path, body); + OnErrorFakeOuterNumberSerialize(e, "/fake/outer/number", uriBuilderLocalVar.Path, body); throw; } } @@ -1064,14 +1064,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1097,10 +1097,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, Guid requiredStringUuid, string body) + protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponseLocalVar, Guid requiredStringUuid, string body) { } @@ -1127,78 +1127,78 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body); - requiredStringUuid = validatedParameters.Item1; - body = validatedParameters.Item2; + var validatedParameterLocalVars = OnFakeOuterStringSerialize(requiredStringUuid, body); + requiredStringUuid = validatedParameterLocalVars.Item1; + body = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString()); + parseQueryStringLocalVar["required_string_uuid"] = requiredStringUuid.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/string", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/string", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterStringSerialize(apiResponseLocalVar, requiredStringUuid, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body); + OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilderLocalVar.Path, requiredStringUuid, body); throw; } } @@ -1211,12 +1211,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse> apiResponseLocalVar = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1227,17 +1227,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task> GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = null; + ApiResponse> apiResponseLocalVar = null; try { - result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1253,8 +1253,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterGetArrayOfEnums(ApiResponse> apiResponse) + /// + protected virtual void AfterGetArrayOfEnums(ApiResponse> apiResponseLocalVar) { } @@ -1277,57 +1277,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnGetArrayOfEnums(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/array-of-enums", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/array-of-enums", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetArrayOfEnums(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetArrayOfEnums(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetArrayOfEnums(e, "/fake/array-of-enums", uriBuilder.Path); + OnErrorGetArrayOfEnums(e, "/fake/array-of-enums", uriBuilderLocalVar.Path); throw; } } @@ -1341,12 +1341,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1358,17 +1358,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1394,9 +1394,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestBodyWithFileSchema(ApiResponse apiResponse, FileSchemaTestClass fileSchemaTestClass) + protected virtual void AfterTestBodyWithFileSchema(ApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass) { } @@ -1421,61 +1421,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { fileSchemaTestClass = OnTestBodyWithFileSchema(fileSchemaTestClass); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; - request.Content = (fileSchemaTestClass as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (fileSchemaTestClass as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-file-schema", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/body-with-file-schema", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestBodyWithFileSchema(apiResponse, fileSchemaTestClass); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestBodyWithFileSchema(apiResponseLocalVar, fileSchemaTestClass); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestBodyWithFileSchema(e, "/fake/body-with-file-schema", uriBuilder.Path, fileSchemaTestClass); + OnErrorTestBodyWithFileSchema(e, "/fake/body-with-file-schema", uriBuilderLocalVar.Path, fileSchemaTestClass); throw; } } @@ -1490,12 +1490,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1508,17 +1508,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1548,10 +1548,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterTestBodyWithQueryParams(ApiResponse apiResponse, User user, string query) + protected virtual void AfterTestBodyWithQueryParams(ApiResponse apiResponseLocalVar, User user, string query) { } @@ -1578,69 +1578,69 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestBodyWithQueryParamsWithHttpInfoAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestBodyWithQueryParams(user, query); - user = validatedParameters.Item1; - query = validatedParameters.Item2; + var validatedParameterLocalVars = OnTestBodyWithQueryParams(user, query); + user = validatedParameterLocalVars.Item1; + query = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["query"] = Uri.EscapeDataString(query.ToString()); + parseQueryStringLocalVar["query"] = query.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-query-params", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/body-with-query-params", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestBodyWithQueryParams(apiResponse, user, query); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestBodyWithQueryParams(apiResponseLocalVar, user, query); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestBodyWithQueryParams(e, "/fake/body-with-query-params", uriBuilder.Path, user, query); + OnErrorTestBodyWithQueryParams(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, user, query); throw; } } @@ -1654,12 +1654,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1671,17 +1671,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1707,9 +1707,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestClientModel(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterTestClientModel(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -1734,70 +1734,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnTestClientModel(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Patch; + httpRequestMessageLocalVar.Method = HttpMethod.Patch; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestClientModel(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestClientModel(apiResponseLocalVar, modelClient); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestClientModel(e, "/fake", uriBuilder.Path, modelClient); + OnErrorTestClientModel(e, "/fake", uriBuilderLocalVar.Path, modelClient); throw; } } @@ -1824,12 +1824,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEndpointParametersAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string _string = null, string password = null, string callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1854,17 +1854,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEndpointParametersOrDefaultAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string _string = null, string password = null, string callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1912,7 +1912,7 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// @@ -1927,7 +1927,7 @@ namespace Org.OpenAPITools.Api /// /// /// - protected virtual void AfterTestEndpointParameters(ApiResponse apiResponse, byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date, System.IO.Stream binary, float? _float, int? integer, int? int32, long? int64, string _string, string password, string callback, DateTime? dateTime) + protected virtual void AfterTestEndpointParameters(ApiResponse apiResponseLocalVar, byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date, System.IO.Stream binary, float? _float, int? integer, int? int32, long? int64, string _string, string password, string callback, DateTime? dateTime) { } @@ -1978,134 +1978,134 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestEndpointParametersWithHttpInfoAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string _string = null, string password = null, string callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestEndpointParameters(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); - _byte = validatedParameters.Item1; - number = validatedParameters.Item2; - _double = validatedParameters.Item3; - patternWithoutDelimiter = validatedParameters.Item4; - date = validatedParameters.Item5; - binary = validatedParameters.Item6; - _float = validatedParameters.Item7; - integer = validatedParameters.Item8; - int32 = validatedParameters.Item9; - int64 = validatedParameters.Item10; - _string = validatedParameters.Item11; - password = validatedParameters.Item12; - callback = validatedParameters.Item13; - dateTime = validatedParameters.Item14; + var validatedParameterLocalVars = OnTestEndpointParameters(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + _byte = validatedParameterLocalVars.Item1; + number = validatedParameterLocalVars.Item2; + _double = validatedParameterLocalVars.Item3; + patternWithoutDelimiter = validatedParameterLocalVars.Item4; + date = validatedParameterLocalVars.Item5; + binary = validatedParameterLocalVars.Item6; + _float = validatedParameterLocalVars.Item7; + integer = validatedParameterLocalVars.Item8; + int32 = validatedParameterLocalVars.Item9; + int64 = validatedParameterLocalVars.Item10; + _string = validatedParameterLocalVars.Item11; + password = validatedParameterLocalVars.Item12; + callback = validatedParameterLocalVars.Item13; + dateTime = validatedParameterLocalVars.Item14; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); + formParameterLocalVars.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); - formParams.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + formParameterLocalVars.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); - formParams.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); + formParameterLocalVars.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); - formParams.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + formParameterLocalVars.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); if (date != null) - formParams.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); + formParameterLocalVars.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); if (binary != null) - multipartContent.Add(new StreamContent(binary)); + multipartContentLocalVar.Add(new StreamContent(binary)); if (_float != null) - formParams.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); + formParameterLocalVars.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); if (integer != null) - formParams.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); + formParameterLocalVars.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); if (int32 != null) - formParams.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); + formParameterLocalVars.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); if (int64 != null) - formParams.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); + formParameterLocalVars.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); if (_string != null) - formParams.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); + formParameterLocalVars.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); if (password != null) - formParams.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); + formParameterLocalVars.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); if (callback != null) - formParams.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); + formParameterLocalVars.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); if (dateTime != null) - formParams.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); + formParameterLocalVars.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + BasicToken basicTokenLocalVar = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(basicToken); + tokenBaseLocalVars.Add(basicTokenLocalVar); - basicToken.UseInHeader(request, ""); + basicTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestEndpointParameters(apiResponse, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestEndpointParameters(apiResponseLocalVar, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestEndpointParameters(e, "/fake", uriBuilder.Path, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + OnErrorTestEndpointParameters(e, "/fake", uriBuilderLocalVar.Path, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); throw; } } @@ -2126,12 +2126,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEnumParametersAsync(List enumHeaderStringArray = null, List enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List enumFormStringArray = null, string enumHeaderString = null, string enumQueryString = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2150,17 +2150,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEnumParametersOrDefaultAsync(List enumHeaderStringArray = null, List enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List enumFormStringArray = null, string enumHeaderString = null, string enumQueryString = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2184,7 +2184,7 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// @@ -2193,7 +2193,7 @@ namespace Org.OpenAPITools.Api /// /// /// - protected virtual void AfterTestEnumParameters(ApiResponse apiResponse, List enumHeaderStringArray, List enumQueryStringArray, double? enumQueryDouble, int? enumQueryInteger, List enumFormStringArray, string enumHeaderString, string enumQueryString, string enumFormString) + protected virtual void AfterTestEnumParameters(ApiResponse apiResponseLocalVar, List enumHeaderStringArray, List enumQueryStringArray, double? enumQueryDouble, int? enumQueryInteger, List enumFormStringArray, string enumHeaderString, string enumQueryString, string enumFormString) { } @@ -2232,98 +2232,98 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestEnumParametersWithHttpInfoAsync(List enumHeaderStringArray = null, List enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List enumFormStringArray = null, string enumHeaderString = null, string enumQueryString = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); - enumHeaderStringArray = validatedParameters.Item1; - enumQueryStringArray = validatedParameters.Item2; - enumQueryDouble = validatedParameters.Item3; - enumQueryInteger = validatedParameters.Item4; - enumFormStringArray = validatedParameters.Item5; - enumHeaderString = validatedParameters.Item6; - enumQueryString = validatedParameters.Item7; - enumFormString = validatedParameters.Item8; + var validatedParameterLocalVars = OnTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + enumHeaderStringArray = validatedParameterLocalVars.Item1; + enumQueryStringArray = validatedParameterLocalVars.Item2; + enumQueryDouble = validatedParameterLocalVars.Item3; + enumQueryInteger = validatedParameterLocalVars.Item4; + enumFormStringArray = validatedParameterLocalVars.Item5; + enumHeaderString = validatedParameterLocalVars.Item6; + enumQueryString = validatedParameterLocalVars.Item7; + enumFormString = validatedParameterLocalVars.Item8; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray != null) - parseQueryString["enum_query_string_array"] = Uri.EscapeDataString(enumQueryStringArray.ToString()); + parseQueryStringLocalVar["enum_query_string_array"] = enumQueryStringArray.ToString(); if (enumQueryDouble != null) - parseQueryString["enum_query_double"] = Uri.EscapeDataString(enumQueryDouble.ToString()); + parseQueryStringLocalVar["enum_query_double"] = enumQueryDouble.ToString(); if (enumQueryInteger != null) - parseQueryString["enum_query_integer"] = Uri.EscapeDataString(enumQueryInteger.ToString()); + parseQueryStringLocalVar["enum_query_integer"] = enumQueryInteger.ToString(); if (enumQueryString != null) - parseQueryString["enum_query_string"] = Uri.EscapeDataString(enumQueryString.ToString()); + parseQueryStringLocalVar["enum_query_string"] = enumQueryString.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); if (enumHeaderStringArray != null) - request.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); + httpRequestMessageLocalVar.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); if (enumHeaderString != null) - request.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); + httpRequestMessageLocalVar.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (enumFormStringArray != null) - formParams.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (enumFormStringArray != null) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); if (enumFormString != null) - formParams.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); + formParameterLocalVars.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestEnumParameters(apiResponse, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestEnumParameters(apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestEnumParameters(e, "/fake", uriBuilder.Path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + OnErrorTestEnumParameters(e, "/fake", uriBuilderLocalVar.Path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); throw; } } @@ -2342,12 +2342,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2364,17 +2364,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2411,14 +2411,14 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// /// /// /// - protected virtual void AfterTestGroupParameters(ApiResponse apiResponse, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup, int? stringGroup, long? int64Group) + protected virtual void AfterTestGroupParameters(ApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup, int? stringGroup, long? int64Group) { } @@ -2453,83 +2453,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestGroupParametersWithHttpInfoAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); - requiredBooleanGroup = validatedParameters.Item1; - requiredStringGroup = validatedParameters.Item2; - requiredInt64Group = validatedParameters.Item3; - booleanGroup = validatedParameters.Item4; - stringGroup = validatedParameters.Item5; - int64Group = validatedParameters.Item6; + var validatedParameterLocalVars = OnTestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + requiredBooleanGroup = validatedParameterLocalVars.Item1; + requiredStringGroup = validatedParameterLocalVars.Item2; + requiredInt64Group = validatedParameterLocalVars.Item3; + booleanGroup = validatedParameterLocalVars.Item4; + stringGroup = validatedParameterLocalVars.Item5; + int64Group = validatedParameterLocalVars.Item6; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["required_string_group"] = Uri.EscapeDataString(requiredStringGroup.ToString()); - parseQueryString["required_int64_group"] = Uri.EscapeDataString(requiredInt64Group.ToString()); + parseQueryStringLocalVar["required_string_group"] = requiredStringGroup.ToString(); + parseQueryStringLocalVar["required_int64_group"] = requiredInt64Group.ToString(); if (stringGroup != null) - parseQueryString["string_group"] = Uri.EscapeDataString(stringGroup.ToString()); + parseQueryStringLocalVar["string_group"] = stringGroup.ToString(); if (int64Group != null) - parseQueryString["int64_group"] = Uri.EscapeDataString(int64Group.ToString()); + parseQueryStringLocalVar["int64_group"] = int64Group.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + httpRequestMessageLocalVar.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); if (booleanGroup != null) - request.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); + httpRequestMessageLocalVar.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + BearerToken bearerTokenLocalVar = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(bearerToken); + tokenBaseLocalVars.Add(bearerTokenLocalVar); - bearerToken.UseInHeader(request, ""); + bearerTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - request.Method = HttpMethod.Delete; + httpRequestMessageLocalVar.Method = HttpMethod.Delete; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestGroupParameters(apiResponse, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestGroupParameters(apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestGroupParameters(e, "/fake", uriBuilder.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + OnErrorTestGroupParameters(e, "/fake", uriBuilderLocalVar.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); throw; } } @@ -2543,12 +2543,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2560,17 +2560,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2596,9 +2596,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestInlineAdditionalProperties(ApiResponse apiResponse, Dictionary requestBody) + protected virtual void AfterTestInlineAdditionalProperties(ApiResponse apiResponseLocalVar, Dictionary requestBody) { } @@ -2623,61 +2623,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { requestBody = OnTestInlineAdditionalProperties(requestBody); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; - request.Content = (requestBody as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/inline-additionalProperties", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestInlineAdditionalProperties(apiResponse, requestBody); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestInlineAdditionalProperties(apiResponseLocalVar, requestBody); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestInlineAdditionalProperties(e, "/fake/inline-additionalProperties", uriBuilder.Path, requestBody); + OnErrorTestInlineAdditionalProperties(e, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path, requestBody); throw; } } @@ -2692,12 +2692,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2710,17 +2710,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2750,10 +2750,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterTestJsonFormData(ApiResponse apiResponse, string param, string param2) + protected virtual void AfterTestJsonFormData(ApiResponse apiResponseLocalVar, string param, string param2) { } @@ -2780,73 +2780,73 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestJsonFormData(param, param2); - param = validatedParameters.Item1; - param2 = validatedParameters.Item2; + var validatedParameterLocalVars = OnTestJsonFormData(param, param2); + param = validatedParameterLocalVars.Item1; + param2 = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + formParameterLocalVars.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); - formParams.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + formParameterLocalVars.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/jsonFormData", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/jsonFormData", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestJsonFormData(apiResponse, param, param2); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestJsonFormData(apiResponseLocalVar, param, param2); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestJsonFormData(e, "/fake/jsonFormData", uriBuilder.Path, param, param2); + OnErrorTestJsonFormData(e, "/fake/jsonFormData", uriBuilderLocalVar.Path, param, param2); throw; } } @@ -2864,12 +2864,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2885,17 +2885,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2937,13 +2937,13 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// /// /// - protected virtual void AfterTestQueryParameterCollectionFormat(ApiResponse apiResponse, List pipe, List ioutil, List http, List url, List context) + protected virtual void AfterTestQueryParameterCollectionFormat(ApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context) { } @@ -2976,63 +2976,63 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - pipe = validatedParameters.Item1; - ioutil = validatedParameters.Item2; - http = validatedParameters.Item3; - url = validatedParameters.Item4; - context = validatedParameters.Item5; + var validatedParameterLocalVars = OnTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + pipe = validatedParameterLocalVars.Item1; + ioutil = validatedParameterLocalVars.Item2; + http = validatedParameterLocalVars.Item3; + url = validatedParameterLocalVars.Item4; + context = validatedParameterLocalVars.Item5; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["pipe"] = Uri.EscapeDataString(pipe.ToString()); - parseQueryString["ioutil"] = Uri.EscapeDataString(ioutil.ToString()); - parseQueryString["http"] = Uri.EscapeDataString(http.ToString()); - parseQueryString["url"] = Uri.EscapeDataString(url.ToString()); - parseQueryString["context"] = Uri.EscapeDataString(context.ToString()); + parseQueryStringLocalVar["pipe"] = pipe.ToString(); + parseQueryStringLocalVar["ioutil"] = ioutil.ToString(); + parseQueryStringLocalVar["http"] = http.ToString(); + parseQueryStringLocalVar["url"] = url.ToString(); + parseQueryStringLocalVar["context"] = context.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/test-query-parameters", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/test-query-parameters", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestQueryParameterCollectionFormat(apiResponse, pipe, ioutil, http, url, context); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestQueryParameterCollectionFormat(apiResponseLocalVar, pipe, ioutil, http, url, context); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestQueryParameterCollectionFormat(e, "/fake/test-query-parameters", uriBuilder.Path, pipe, ioutil, http, url, context); + OnErrorTestQueryParameterCollectionFormat(e, "/fake/test-query-parameters", uriBuilderLocalVar.Path, pipe, ioutil, http, url, context); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 2c2533fc2f5..43cdf5a7831 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -136,12 +136,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -153,17 +153,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -189,9 +189,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestClassname(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterTestClassname(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -216,83 +216,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnTestClassname(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInQuery(request, uriBuilder, parseQueryString, "api_key_query"); + apiKeyTokenLocalVar.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query"); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Patch; + httpRequestMessageLocalVar.Method = HttpMethod.Patch; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake_classname_test", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake_classname_test", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestClassname(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestClassname(apiResponseLocalVar, modelClient); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestClassname(e, "/fake_classname_test", uriBuilder.Path, modelClient); + OnErrorTestClassname(e, "/fake_classname_test", uriBuilderLocalVar.Path, modelClient); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs index 75a4ad92111..135a8eee75b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs @@ -342,12 +342,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -359,17 +359,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -395,9 +395,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterAddPet(ApiResponse apiResponse, Pet pet) + protected virtual void AfterAddPet(ApiResponse apiResponseLocalVar, Pet pet) { } @@ -422,84 +422,84 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { pet = OnAddPet(pet); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - var url = request.RequestUri = new Uri("http://petstore.swagger.io/v2"); - uriBuilder.Host = url.Authority; - uriBuilder.Scheme = url.Scheme; - uriBuilder.Path = url.AbsolutePath; + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; - request.Content = (pet as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); string[] contentTypes = new string[] { "application/json", "application/xml" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterAddPet(apiResponse, pet); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterAddPet(apiResponseLocalVar, pet); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorAddPet(e, "/pet", uriBuilder.Path, pet); + OnErrorAddPet(e, "/pet", uriBuilderLocalVar.Path, pet); throw; } } @@ -514,12 +514,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeletePetAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -532,17 +532,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeletePetOrDefaultAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -569,10 +569,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterDeletePet(ApiResponse apiResponse, long petId, string apiKey) + protected virtual void AfterDeletePet(ApiResponse apiResponseLocalVar, long petId, string apiKey) { } @@ -599,64 +599,64 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeletePetWithHttpInfoAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnDeletePet(petId, apiKey); - petId = validatedParameters.Item1; - apiKey = validatedParameters.Item2; + var validatedParameterLocalVars = OnDeletePet(petId, apiKey); + petId = validatedParameterLocalVars.Item1; + apiKey = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); if (apiKey != null) - request.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); if (apiKey != null) + httpRequestMessageLocalVar.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - request.Method = HttpMethod.Delete; + httpRequestMessageLocalVar.Method = HttpMethod.Delete; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeletePet(apiResponse, petId, apiKey); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeletePet(apiResponseLocalVar, petId, apiKey); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeletePet(e, "/pet/{petId}", uriBuilder.Path, petId, apiKey); + OnErrorDeletePet(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, apiKey); throw; } } @@ -670,12 +670,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + ApiResponse> apiResponseLocalVar = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -687,17 +687,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = null; + ApiResponse> apiResponseLocalVar = null; try { - result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -723,9 +723,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFindPetsByStatus(ApiResponse> apiResponse, List status) + protected virtual void AfterFindPetsByStatus(ApiResponse> apiResponseLocalVar, List status) { } @@ -750,86 +750,86 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { status = OnFindPetsByStatus(status); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["status"] = Uri.EscapeDataString(status.ToString()); + parseQueryStringLocalVar["status"] = status.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByStatus", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/findByStatus", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterFindPetsByStatus(apiResponse, status); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFindPetsByStatus(apiResponseLocalVar, status); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFindPetsByStatus(e, "/pet/findByStatus", uriBuilder.Path, status); + OnErrorFindPetsByStatus(e, "/pet/findByStatus", uriBuilderLocalVar.Path, status); throw; } } @@ -843,12 +843,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + ApiResponse> apiResponseLocalVar = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -860,17 +860,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = null; + ApiResponse> apiResponseLocalVar = null; try { - result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -896,9 +896,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFindPetsByTags(ApiResponse> apiResponse, List tags) + protected virtual void AfterFindPetsByTags(ApiResponse> apiResponseLocalVar, List tags) { } @@ -923,86 +923,86 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { tags = OnFindPetsByTags(tags); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["tags"] = Uri.EscapeDataString(tags.ToString()); + parseQueryStringLocalVar["tags"] = tags.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByTags", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/findByTags", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterFindPetsByTags(apiResponse, tags); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFindPetsByTags(apiResponseLocalVar, tags); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFindPetsByTags(e, "/pet/findByTags", uriBuilder.Path, tags); + OnErrorFindPetsByTags(e, "/pet/findByTags", uriBuilderLocalVar.Path, tags); throw; } } @@ -1016,12 +1016,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1033,17 +1033,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1069,9 +1069,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetPetById(ApiResponse apiResponse, long petId) + protected virtual void AfterGetPetById(ApiResponse apiResponseLocalVar, long petId) { } @@ -1096,67 +1096,67 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { petId = OnGetPetById(petId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); List tokens = new List(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInHeader(request, "api_key"); + apiKeyTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "api_key"); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetPetById(apiResponse, petId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetPetById(apiResponseLocalVar, petId); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetPetById(e, "/pet/{petId}", uriBuilder.Path, petId); + OnErrorGetPetById(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId); throw; } } @@ -1170,12 +1170,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1187,17 +1187,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1223,9 +1223,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterUpdatePet(ApiResponse apiResponse, Pet pet) + protected virtual void AfterUpdatePet(ApiResponse apiResponseLocalVar, Pet pet) { } @@ -1250,84 +1250,84 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { pet = OnUpdatePet(pet); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - var url = request.RequestUri = new Uri("http://petstore.swagger.io/v2"); - uriBuilder.Host = url.Authority; - uriBuilder.Scheme = url.Scheme; - uriBuilder.Path = url.AbsolutePath; + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; - request.Content = (pet as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); string[] contentTypes = new string[] { "application/json", "application/xml" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdatePet(apiResponse, pet); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdatePet(apiResponseLocalVar, pet); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdatePet(e, "/pet", uriBuilder.Path, pet); + OnErrorUpdatePet(e, "/pet", uriBuilderLocalVar.Path, pet); throw; } } @@ -1343,12 +1343,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetWithFormAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1362,17 +1362,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetWithFormOrDefaultAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1400,11 +1400,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUpdatePetWithForm(ApiResponse apiResponse, long petId, string name, string status) + protected virtual void AfterUpdatePetWithForm(ApiResponse apiResponseLocalVar, long petId, string name, string status) { } @@ -1433,83 +1433,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUpdatePetWithForm(petId, name, status); - petId = validatedParameters.Item1; - name = validatedParameters.Item2; - status = validatedParameters.Item3; + var validatedParameterLocalVars = OnUpdatePetWithForm(petId, name, status); + petId = validatedParameterLocalVars.Item1; + name = validatedParameterLocalVars.Item2; + status = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (name != null) - formParams.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (name != null) + formParameterLocalVars.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); if (status != null) - formParams.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); + formParameterLocalVars.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdatePetWithForm(apiResponse, petId, name, status); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdatePetWithForm(apiResponseLocalVar, petId, name, status); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdatePetWithForm(e, "/pet/{petId}", uriBuilder.Path, petId, name, status); + OnErrorUpdatePetWithForm(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, name, status); throw; } } @@ -1525,12 +1525,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileAsync(long petId, System.IO.Stream file = null, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1544,17 +1544,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileOrDefaultAsync(long petId, System.IO.Stream file = null, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1582,11 +1582,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUploadFile(ApiResponse apiResponse, long petId, System.IO.Stream file, string additionalMetadata) + protected virtual void AfterUploadFile(ApiResponse apiResponseLocalVar, long petId, System.IO.Stream file, string additionalMetadata) { } @@ -1615,92 +1615,92 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UploadFileWithHttpInfoAsync(long petId, System.IO.Stream file = null, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUploadFile(petId, file, additionalMetadata); - petId = validatedParameters.Item1; - file = validatedParameters.Item2; - additionalMetadata = validatedParameters.Item3; + var validatedParameterLocalVars = OnUploadFile(petId, file, additionalMetadata); + petId = validatedParameterLocalVars.Item1; + file = validatedParameterLocalVars.Item2; + additionalMetadata = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (file != null) - multipartContent.Add(new StreamContent(file)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (file != null) + multipartContentLocalVar.Add(new StreamContent(file)); if (additionalMetadata != null) - formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "multipart/form-data" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}/uploadImage", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUploadFile(apiResponse, petId, file, additionalMetadata); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUploadFile(apiResponseLocalVar, petId, file, additionalMetadata); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUploadFile(e, "/pet/{petId}/uploadImage", uriBuilder.Path, petId, file, additionalMetadata); + OnErrorUploadFile(e, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path, petId, file, additionalMetadata); throw; } } @@ -1716,12 +1716,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1735,17 +1735,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1776,11 +1776,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUploadFileWithRequiredFile(ApiResponse apiResponse, System.IO.Stream requiredFile, long petId, string additionalMetadata) + protected virtual void AfterUploadFileWithRequiredFile(ApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, string additionalMetadata) { } @@ -1809,92 +1809,92 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UploadFileWithRequiredFileWithHttpInfoAsync(System.IO.Stream requiredFile, long petId, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); - requiredFile = validatedParameters.Item1; - petId = validatedParameters.Item2; - additionalMetadata = validatedParameters.Item3; + var validatedParameterLocalVars = OnUploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); + requiredFile = validatedParameterLocalVars.Item1; + petId = validatedParameterLocalVars.Item2; + additionalMetadata = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); multipartContent.Add(new StreamContent(requiredFile)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); multipartContentLocalVar.Add(new StreamContent(requiredFile)); if (additionalMetadata != null) - formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "multipart/form-data" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUploadFileWithRequiredFile(apiResponse, requiredFile, petId, additionalMetadata); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUploadFileWithRequiredFile(apiResponseLocalVar, requiredFile, petId, additionalMetadata); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUploadFileWithRequiredFile(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilder.Path, requiredFile, petId, additionalMetadata); + OnErrorUploadFileWithRequiredFile(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path, requiredFile, petId, additionalMetadata); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/StoreApi.cs index 19d7f7632d1..e143a8d54f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/StoreApi.cs @@ -206,12 +206,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -223,17 +223,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -259,9 +259,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterDeleteOrder(ApiResponse apiResponse, string orderId) + protected virtual void AfterDeleteOrder(ApiResponse apiResponseLocalVar, string orderId) { } @@ -286,48 +286,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { orderId = OnDeleteOrder(orderId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = HttpMethod.Delete; + httpRequestMessageLocalVar.Method = HttpMethod.Delete; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order/{order_id}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeleteOrder(apiResponse, orderId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeleteOrder(apiResponseLocalVar, orderId); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeleteOrder(e, "/store/order/{order_id}", uriBuilder.Path, orderId); + OnErrorDeleteOrder(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); throw; } } @@ -340,14 +340,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse> apiResponseLocalVar = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -362,8 +362,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterGetInventory(ApiResponse> apiResponse) + /// + protected virtual void AfterGetInventory(ApiResponse> apiResponseLocalVar) { } @@ -386,66 +386,66 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnGetInventory(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; - List tokens = new List(); + List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInHeader(request, "api_key"); + apiKeyTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "api_key"); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/inventory", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/inventory", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetInventory(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetInventory(apiResponseLocalVar); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetInventory(e, "/store/inventory", uriBuilder.Path); + OnErrorGetInventory(e, "/store/inventory", uriBuilderLocalVar.Path); throw; } } @@ -459,12 +459,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -476,17 +476,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -512,9 +512,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetOrderById(ApiResponse apiResponse, long orderId) + protected virtual void AfterGetOrderById(ApiResponse apiResponseLocalVar, long orderId) { } @@ -539,58 +539,58 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { orderId = OnGetOrderById(orderId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order/{order_id}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetOrderById(apiResponse, orderId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetOrderById(apiResponseLocalVar, orderId); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetOrderById(e, "/store/order/{order_id}", uriBuilder.Path, orderId); + OnErrorGetOrderById(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); throw; } } @@ -604,12 +604,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -621,17 +621,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -657,9 +657,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterPlaceOrder(ApiResponse apiResponse, Order order) + protected virtual void AfterPlaceOrder(ApiResponse apiResponseLocalVar, Order order) { } @@ -684,71 +684,71 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { order = OnPlaceOrder(order); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order"; - request.Content = (order as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (order as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterPlaceOrder(apiResponse, order); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterPlaceOrder(apiResponseLocalVar, order); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorPlaceOrder(e, "/store/order", uriBuilder.Path, order); + OnErrorPlaceOrder(e, "/store/order", uriBuilderLocalVar.Path, order); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs index 53c8bc1bac6..c74d6b58d33 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs @@ -306,12 +306,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -323,17 +323,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -359,9 +359,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUser(ApiResponse apiResponse, User user) + protected virtual void AfterCreateUser(ApiResponse apiResponseLocalVar, User user) { } @@ -386,61 +386,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUser(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUser(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUser(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUser(e, "/user", uriBuilder.Path, user); + OnErrorCreateUser(e, "/user", uriBuilderLocalVar.Path, user); throw; } } @@ -454,12 +454,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -471,17 +471,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -507,9 +507,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUsersWithArrayInput(ApiResponse apiResponse, List user) + protected virtual void AfterCreateUsersWithArrayInput(ApiResponse apiResponseLocalVar, List user) { } @@ -534,61 +534,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUsersWithArrayInput(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithArray", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/createWithArray", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUsersWithArrayInput(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUsersWithArrayInput(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUsersWithArrayInput(e, "/user/createWithArray", uriBuilder.Path, user); + OnErrorCreateUsersWithArrayInput(e, "/user/createWithArray", uriBuilderLocalVar.Path, user); throw; } } @@ -602,12 +602,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -619,17 +619,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -655,9 +655,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUsersWithListInput(ApiResponse apiResponse, List user) + protected virtual void AfterCreateUsersWithListInput(ApiResponse apiResponseLocalVar, List user) { } @@ -682,61 +682,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUsersWithListInput(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Post; + httpRequestMessageLocalVar.Method = HttpMethod.Post; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithList", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/createWithList", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUsersWithListInput(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUsersWithListInput(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUsersWithListInput(e, "/user/createWithList", uriBuilder.Path, user); + OnErrorCreateUsersWithListInput(e, "/user/createWithList", uriBuilderLocalVar.Path, user); throw; } } @@ -750,12 +750,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -767,17 +767,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -803,9 +803,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterDeleteUser(ApiResponse apiResponse, string username) + protected virtual void AfterDeleteUser(ApiResponse apiResponseLocalVar, string username) { } @@ -830,48 +830,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { username = OnDeleteUser(username); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = HttpMethod.Delete; + httpRequestMessageLocalVar.Method = HttpMethod.Delete; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeleteUser(apiResponse, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeleteUser(apiResponseLocalVar, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeleteUser(e, "/user/{username}", uriBuilder.Path, username); + OnErrorDeleteUser(e, "/user/{username}", uriBuilderLocalVar.Path, username); throw; } } @@ -885,12 +885,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -902,17 +902,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -938,9 +938,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetUserByName(ApiResponse apiResponse, string username) + protected virtual void AfterGetUserByName(ApiResponse apiResponseLocalVar, string username) { } @@ -965,58 +965,58 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { username = OnGetUserByName(username); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetUserByName(apiResponse, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetUserByName(apiResponseLocalVar, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetUserByName(e, "/user/{username}", uriBuilder.Path, username); + OnErrorGetUserByName(e, "/user/{username}", uriBuilderLocalVar.Path, username); throw; } } @@ -1031,14 +1031,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1067,10 +1067,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterLoginUser(ApiResponse apiResponse, string username, string password) + protected virtual void AfterLoginUser(ApiResponse apiResponseLocalVar, string username, string password) { } @@ -1097,67 +1097,67 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnLoginUser(username, password); - username = validatedParameters.Item1; - password = validatedParameters.Item2; + var validatedParameterLocalVars = OnLoginUser(username, password); + username = validatedParameterLocalVars.Item1; + password = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/login"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["username"] = Uri.EscapeDataString(username.ToString()); - parseQueryString["password"] = Uri.EscapeDataString(password.ToString()); + parseQueryStringLocalVar["username"] = username.ToString(); + parseQueryStringLocalVar["password"] = password.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/login", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/login", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterLoginUser(apiResponse, username, password); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterLoginUser(apiResponseLocalVar, username, password); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorLoginUser(e, "/user/login", uriBuilder.Path, username, password); + OnErrorLoginUser(e, "/user/login", uriBuilderLocalVar.Path, username, password); throw; } } @@ -1170,12 +1170,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1186,17 +1186,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1212,8 +1212,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterLogoutUser(ApiResponse apiResponse) + /// + protected virtual void AfterLogoutUser(ApiResponse apiResponseLocalVar) { } @@ -1236,48 +1236,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnLogoutUser(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/logout", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/logout", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterLogoutUser(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterLogoutUser(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorLogoutUser(e, "/user/logout", uriBuilder.Path); + OnErrorLogoutUser(e, "/user/logout", uriBuilderLocalVar.Path); throw; } } @@ -1292,12 +1292,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1310,17 +1310,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1350,10 +1350,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterUpdateUser(ApiResponse apiResponse, User user, string username) + protected virtual void AfterUpdateUser(ApiResponse apiResponseLocalVar, User user, string username) { } @@ -1380,63 +1380,63 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdateUserWithHttpInfoAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUpdateUser(user, username); - user = validatedParameters.Item1; - username = validatedParameters.Item2; + var validatedParameterLocalVars = OnUpdateUser(user, username); + user = validatedParameterLocalVars.Item1; + username = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = HttpMethod.Put; + httpRequestMessageLocalVar.Method = HttpMethod.Put; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdateUser(apiResponse, user, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdateUser(apiResponseLocalVar, user, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdateUser(e, "/user/{username}", uriBuilder.Path, user, username); + OnErrorUpdateUser(e, "/user/{username}", uriBuilderLocalVar.Path, user, username); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ClientUtils.cs index 2d16402e3ec..dfba54b0e22 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,10 +10,13 @@ using System; using System.IO; using System.Linq; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -95,7 +98,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -122,9 +125,50 @@ namespace Org.OpenAPITools.Client // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + if (obj is ChildCatAllOf.PetTypeEnum childCatAllOfPetTypeEnum) + return ChildCatAllOf.PetTypeEnumToJsonValue(childCatAllOfPetTypeEnum); + if (obj is EnumArrays.ArrayEnumEnum enumArraysArrayEnumEnum) + return EnumArrays.ArrayEnumEnumToJsonValue(enumArraysArrayEnumEnum); + if (obj is EnumArrays.JustSymbolEnum enumArraysJustSymbolEnum) + return EnumArrays.JustSymbolEnumToJsonValue(enumArraysJustSymbolEnum); + if (obj is EnumClass enumClass) + return EnumClassConverter.ToJsonValue(enumClass); + if (obj is EnumTest.EnumIntegerEnum enumTestEnumIntegerEnum) + return EnumTest.EnumIntegerEnumToJsonValue(enumTestEnumIntegerEnum).ToString(); + if (obj is EnumTest.EnumIntegerOnlyEnum enumTestEnumIntegerOnlyEnum) + return EnumTest.EnumIntegerOnlyEnumToJsonValue(enumTestEnumIntegerOnlyEnum).ToString(); + if (obj is EnumTest.EnumNumberEnum enumTestEnumNumberEnum) + return EnumTest.EnumNumberEnumToJsonValue(enumTestEnumNumberEnum).ToString(); + if (obj is EnumTest.EnumStringEnum enumTestEnumStringEnum) + return EnumTest.EnumStringEnumToJsonValue(enumTestEnumStringEnum); + if (obj is EnumTest.EnumStringRequiredEnum enumTestEnumStringRequiredEnum) + return EnumTest.EnumStringRequiredEnumToJsonValue(enumTestEnumStringRequiredEnum); + if (obj is MapTest.InnerEnum mapTestInnerEnum) + return MapTest.InnerEnumToJsonValue(mapTestInnerEnum); + if (obj is Order.StatusEnum orderStatusEnum) + return Order.StatusEnumToJsonValue(orderStatusEnum); + if (obj is OuterEnum outerEnum) + return OuterEnumConverter.ToJsonValue(outerEnum); + if (obj is OuterEnumDefaultValue outerEnumDefaultValue) + return OuterEnumDefaultValueConverter.ToJsonValue(outerEnumDefaultValue); + if (obj is OuterEnumInteger outerEnumInteger) + return OuterEnumIntegerConverter.ToJsonValue(outerEnumInteger).ToString(); + if (obj is OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) + return OuterEnumIntegerDefaultValueConverter.ToJsonValue(outerEnumIntegerDefaultValue).ToString(); + if (obj is Pet.StatusEnum petStatusEnum) + return Pet.StatusEnumToJsonValue(petStatusEnum); + if (obj is Zebra.TypeEnum zebraTypeEnum) + return Zebra.TypeEnumToJsonValue(zebraTypeEnum); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs index 6222464831d..e8291cb2e1e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -71,6 +71,6 @@ namespace Org.OpenAPITools.Client /// /// public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs index 4e53bbe9557..e26c40071cd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Client if (dateTimeValue == null) writer.WriteNullValue(); else - writer.WriteStringValue(dateTimeValue.Value.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs index ad15d6f98cb..e5399ebe850 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -90,6 +90,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new HealthCheckResultJsonConverter()); _jsonOptions.Converters.Add(new IsoscelesTriangleJsonConverter()); _jsonOptions.Converters.Add(new ListJsonConverter()); + _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); @@ -126,6 +127,8 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new SimpleQuadrilateralJsonConverter()); _jsonOptions.Converters.Add(new SpecialModelNameJsonConverter()); _jsonOptions.Converters.Add(new TagJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); _jsonOptions.Converters.Add(new TriangleJsonConverter()); _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); _jsonOptions.Converters.Add(new UserJsonConverter()); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Activity.cs index e58d07d5482..33362f78e17 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Activity.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Activity(Dictionary> activityOutputs) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (activityOutputs == null) - throw new ArgumentNullException("activityOutputs is a required property for Activity and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ActivityOutputs = activityOutputs; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "activity_outputs": - activityOutputs = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + activityOutputs = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (activityOutputs == null) + throw new ArgumentNullException(nameof(activityOutputs), "Property is required for class Activity."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Activity(activityOutputs); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 6de49983524..345e7af1c8b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ActivityOutputElementRepresentation(string prop1, Object prop2) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (prop1 == null) - throw new ArgumentNullException("prop1 is a required property for ActivityOutputElementRepresentation and cannot be null."); - - if (prop2 == null) - throw new ArgumentNullException("prop2 is a required property for ActivityOutputElementRepresentation and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Prop1 = prop1; Prop2 = prop2; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -139,7 +128,8 @@ namespace Org.OpenAPITools.Model prop1 = utf8JsonReader.GetString(); break; case "prop2": - prop2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + prop2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (prop1 == null) + throw new ArgumentNullException(nameof(prop1), "Property is required for class ActivityOutputElementRepresentation."); + + if (prop2 == null) + throw new ArgumentNullException(nameof(prop2), "Property is required for class ActivityOutputElementRepresentation."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ActivityOutputElementRepresentation(prop1, prop2); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 23560a4f3d6..81aa51108de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -42,33 +42,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public AdditionalPropertiesClass(Object emptyMap, Dictionary> mapOfMapProperty, Dictionary mapProperty, Object mapWithUndeclaredPropertiesAnytype1, Object mapWithUndeclaredPropertiesAnytype2, Dictionary mapWithUndeclaredPropertiesAnytype3, Dictionary mapWithUndeclaredPropertiesString, Object anytype1 = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mapProperty == null) - throw new ArgumentNullException("mapProperty is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapOfMapProperty == null) - throw new ArgumentNullException("mapOfMapProperty is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype1 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype1 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype2 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype2 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype3 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype3 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (emptyMap == null) - throw new ArgumentNullException("emptyMap is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesString == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesString is a required property for AdditionalPropertiesClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EmptyMap = emptyMap; MapOfMapProperty = mapOfMapProperty; MapProperty = mapProperty; @@ -154,12 +127,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -212,28 +186,36 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "empty_map": - emptyMap = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + emptyMap = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_of_map_property": - mapOfMapProperty = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfMapProperty = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_property": - mapProperty = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapProperty = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_1": - mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_2": - mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_3": - mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_string": - mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "anytype_1": - anytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -241,6 +223,33 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mapProperty == null) + throw new ArgumentNullException(nameof(mapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (mapOfMapProperty == null) + throw new ArgumentNullException(nameof(mapOfMapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype1 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype1), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype2 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype2), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype3 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype3), "Property is required for class AdditionalPropertiesClass."); + + if (emptyMap == null) + throw new ArgumentNullException(nameof(emptyMap), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesString == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new AdditionalPropertiesClass(emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString, anytype1); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs index a8e6d39ce5f..679cec79c20 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs @@ -34,20 +34,8 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - public Animal(string className, string color = "red") + public Animal(string className, string color = @"red") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for Animal and cannot be null."); - - if (color == null) - throw new ArgumentNullException("color is a required property for Animal and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; Color = color; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -157,6 +146,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Animal."); + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class Animal."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Animal(className, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs index 94585e0fdc6..7343f916f89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -37,21 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ApiResponse(int code, string message, string type) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (code == null) - throw new ArgumentNullException("code is a required property for ApiResponse and cannot be null."); - - if (type == null) - throw new ArgumentNullException("type is a required property for ApiResponse and cannot be null."); - - if (message == null) - throw new ArgumentNullException("message is a required property for ApiResponse and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Code = code; Message = message; Type = type; @@ -96,12 +81,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -149,7 +135,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "code": - code = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + code = utf8JsonReader.GetInt32(); break; case "message": message = utf8JsonReader.GetString(); @@ -163,6 +150,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (code == null) + throw new ArgumentNullException(nameof(code), "Property is required for class ApiResponse."); + + if (type == null) + throw new ArgumentNullException(nameof(type), "Property is required for class ApiResponse."); + + if (message == null) + throw new ArgumentNullException(nameof(message), "Property is required for class ApiResponse."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ApiResponse(code, message, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs index a792416f2ae..f480b93afa0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Apple(string cultivar, string origin) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (cultivar == null) - throw new ArgumentNullException("cultivar is a required property for Apple and cannot be null."); - - if (origin == null) - throw new ArgumentNullException("origin is a required property for Apple and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Cultivar = cultivar; Origin = origin; } @@ -84,22 +72,23 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); @@ -161,6 +150,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (cultivar == null) + throw new ArgumentNullException(nameof(cultivar), "Property is required for class Apple."); + + if (origin == null) + throw new ArgumentNullException(nameof(origin), "Property is required for class Apple."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Apple(cultivar, origin); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs index 4ba2c5c5373..c66103ef9a3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public AppleReq(string cultivar, bool mealy) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (cultivar == null) - throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null."); - - if (mealy == null) - throw new ArgumentNullException("mealy is a required property for AppleReq and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Cultivar = cultivar; Mealy = mealy; } @@ -77,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -132,7 +121,8 @@ namespace Org.OpenAPITools.Model cultivar = utf8JsonReader.GetString(); break; case "mealy": - mealy = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mealy = utf8JsonReader.GetBoolean(); break; default: break; @@ -140,6 +130,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (cultivar == null) + throw new ArgumentNullException(nameof(cultivar), "Property is required for class AppleReq."); + + if (mealy == null) + throw new ArgumentNullException(nameof(mealy), "Property is required for class AppleReq."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new AppleReq(cultivar, mealy); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 1ed9c093bcd..e5b37af5db4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayArrayNumber == null) - throw new ArgumentNullException("arrayArrayNumber is a required property for ArrayOfArrayOfNumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayArrayNumber = arrayArrayNumber; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "ArrayArrayNumber": - arrayArrayNumber = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayNumber = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayArrayNumber == null) + throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 3ebd18816b2..d108d6b142b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayOfNumberOnly(List arrayNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayNumber == null) - throw new ArgumentNullException("arrayNumber is a required property for ArrayOfNumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayNumber = arrayNumber; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "ArrayNumber": - arrayNumber = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNumber = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayNumber == null) + throw new ArgumentNullException(nameof(arrayNumber), "Property is required for class ArrayOfNumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayOfNumberOnly(arrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs index d555055c30e..1d211adb467 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -37,21 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayTest(List> arrayArrayOfInteger, List> arrayArrayOfModel, List arrayOfString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayOfString == null) - throw new ArgumentNullException("arrayOfString is a required property for ArrayTest and cannot be null."); - - if (arrayArrayOfInteger == null) - throw new ArgumentNullException("arrayArrayOfInteger is a required property for ArrayTest and cannot be null."); - - if (arrayArrayOfModel == null) - throw new ArgumentNullException("arrayArrayOfModel is a required property for ArrayTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayArrayOfInteger = arrayArrayOfInteger; ArrayArrayOfModel = arrayArrayOfModel; ArrayOfString = arrayOfString; @@ -96,12 +81,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -149,13 +135,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_array_of_integer": - arrayArrayOfInteger = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfInteger = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_array_of_model": - arrayArrayOfModel = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfModel = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_of_string": - arrayOfString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayOfString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -163,6 +152,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayOfString == null) + throw new ArgumentNullException(nameof(arrayOfString), "Property is required for class ArrayTest."); + + if (arrayArrayOfInteger == null) + throw new ArgumentNullException(nameof(arrayArrayOfInteger), "Property is required for class ArrayTest."); + + if (arrayArrayOfModel == null) + throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is required for class ArrayTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs index 1bd23879706..cf67cd3dfdb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Banana(decimal lengthCm) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (lengthCm == null) - throw new ArgumentNullException("lengthCm is a required property for Banana and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - LengthCm = lengthCm; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "lengthCm": - lengthCm = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = utf8JsonReader.GetDecimal(); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (lengthCm == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is required for class Banana."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Banana(lengthCm); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs index b185004e078..f49b6502d8a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public BananaReq(decimal lengthCm, bool sweet) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (lengthCm == null) - throw new ArgumentNullException("lengthCm is a required property for BananaReq and cannot be null."); - - if (sweet == null) - throw new ArgumentNullException("sweet is a required property for BananaReq and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - LengthCm = lengthCm; Sweet = sweet; } @@ -77,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -129,10 +118,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "lengthCm": - lengthCm = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = utf8JsonReader.GetDecimal(); break; case "sweet": - sweet = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sweet = utf8JsonReader.GetBoolean(); break; default: break; @@ -140,6 +131,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (lengthCm == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is required for class BananaReq."); + + if (sweet == null) + throw new ArgumentNullException(nameof(sweet), "Property is required for class BananaReq."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new BananaReq(lengthCm, sweet); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs index f74cda1d968..9370e427dca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public BasquePig(string className) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for BasquePig and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class BasquePig."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new BasquePig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs index 89cb785431b..9727c077679 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -40,30 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Capitalization(string aTTNAME, string capitalCamel, string capitalSnake, string sCAETHFlowPoints, string smallCamel, string smallSnake) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (smallCamel == null) - throw new ArgumentNullException("smallCamel is a required property for Capitalization and cannot be null."); - - if (capitalCamel == null) - throw new ArgumentNullException("capitalCamel is a required property for Capitalization and cannot be null."); - - if (smallSnake == null) - throw new ArgumentNullException("smallSnake is a required property for Capitalization and cannot be null."); - - if (capitalSnake == null) - throw new ArgumentNullException("capitalSnake is a required property for Capitalization and cannot be null."); - - if (sCAETHFlowPoints == null) - throw new ArgumentNullException("sCAETHFlowPoints is a required property for Capitalization and cannot be null."); - - if (aTTNAME == null) - throw new ArgumentNullException("aTTNAME is a required property for Capitalization and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ATT_NAME = aTTNAME; CapitalCamel = capitalCamel; CapitalSnake = capitalSnake; @@ -133,12 +109,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -212,6 +189,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (smallCamel == null) + throw new ArgumentNullException(nameof(smallCamel), "Property is required for class Capitalization."); + + if (capitalCamel == null) + throw new ArgumentNullException(nameof(capitalCamel), "Property is required for class Capitalization."); + + if (smallSnake == null) + throw new ArgumentNullException(nameof(smallSnake), "Property is required for class Capitalization."); + + if (capitalSnake == null) + throw new ArgumentNullException(nameof(capitalSnake), "Property is required for class Capitalization."); + + if (sCAETHFlowPoints == null) + throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is required for class Capitalization."); + + if (aTTNAME == null) + throw new ArgumentNullException(nameof(aTTNAME), "Property is required for class Capitalization."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs index 012918369b3..63a7cbf5597 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Cat.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - internal Cat(Dictionary dictionary, CatAllOf catAllOf, string className, string color = "red") : base(className, color) + internal Cat(Dictionary dictionary, CatAllOf catAllOf, string className, string color = @"red") : base(className, color) { Dictionary = dictionary; CatAllOf = catAllOf; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs index 83d03521f6f..ae49286460d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public CatAllOf(bool declawed) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (declawed == null) - throw new ArgumentNullException("declawed is a required property for CatAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Declawed = declawed; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "declawed": - declawed = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + declawed = utf8JsonReader.GetBoolean(); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (declawed == null) + throw new ArgumentNullException(nameof(declawed), "Property is required for class CatAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new CatAllOf(declawed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs index d165237197e..b3500dbfa01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs @@ -34,20 +34,8 @@ namespace Org.OpenAPITools.Model /// id /// name (default to "default-name") [JsonConstructor] - public Category(long id, string name = "default-name") + public Category(long id, string name = @"default-name") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Category and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Category and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; Name = name; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -136,7 +125,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Category."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Category."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Category(id, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a56a226acfa..2bd9eecb33e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ChildCatAllOf(string name, PetTypeEnum petType = PetTypeEnum.ChildCat) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for ChildCatAllOf and cannot be null."); - - if (petType == null) - throw new ArgumentNullException("petType is a required property for ChildCatAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Name = name; PetType = petType; } @@ -123,12 +111,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -187,6 +176,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class ChildCatAllOf."); + + if (petType == null) + throw new ArgumentNullException(nameof(petType), "Property is required for class ChildCatAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ChildCatAllOf(name, petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs index 932a529ec61..4944bb2e113 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ClassModel(string classProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (classProperty == null) - throw new ArgumentNullException("classProperty is a required property for ClassModel and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassProperty = classProperty; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (classProperty == null) + throw new ArgumentNullException(nameof(classProperty), "Property is required for class ClassModel."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ClassModel(classProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 00b7b9977e8..7b28f72a4b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -68,12 +68,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs index 4dad6503d21..eee848c075c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DanishPig(string className) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for DanishPig and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class DanishPig."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DanishPig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs index eaf1ee5431b..262c168d6a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -35,21 +35,13 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DateOnlyClass(DateTime dateOnlyProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (dateOnlyProperty == null) - throw new ArgumentNullException("dateOnlyProperty is a required property for DateOnlyClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DateOnlyProperty = dateOnlyProperty; } /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [JsonPropertyName("dateOnlyProperty")] public DateTime DateOnlyProperty { get; set; } @@ -72,12 +64,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -91,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize DateOnlyProperty /// - public static string DateOnlyPropertyFormat { get; set; } = "yyyy-MM-dd"; + public static string DateOnlyPropertyFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// A Json reader. @@ -128,7 +121,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "dateOnlyProperty": - dateOnlyProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOnlyProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -136,6 +130,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (dateOnlyProperty == null) + throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is required for class DateOnlyClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DateOnlyClass(dateOnlyProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 908406d3bf6..e9015dfa6b5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DeprecatedObject(string name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for DeprecatedObject and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Name = name; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class DeprecatedObject."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DeprecatedObject(name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs index 094c1d2fc79..6bb6413c6d9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Dog.cs @@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - internal Dog(DogAllOf dogAllOf, string className, string color = "red") : base(className, color) + internal Dog(DogAllOf dogAllOf, string className, string color = @"red") : base(className, color) { DogAllOf = dogAllOf; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs index 171b69d1e1c..c1339c65b5e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DogAllOf(string breed) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (breed == null) - throw new ArgumentNullException("breed is a required property for DogAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Breed = breed; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (breed == null) + throw new ArgumentNullException(nameof(breed), "Property is required for class DogAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DogAllOf(breed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs index 819790eab36..d0ef8cb3bb4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -38,21 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Drawing(Shape mainShape, ShapeOrNull shapeOrNull, List shapes, NullableShape nullableShape = default) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mainShape == null) - throw new ArgumentNullException("mainShape is a required property for Drawing and cannot be null."); - - if (shapeOrNull == null) - throw new ArgumentNullException("shapeOrNull is a required property for Drawing and cannot be null."); - - if (shapes == null) - throw new ArgumentNullException("shapes is a required property for Drawing and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - MainShape = mainShape; ShapeOrNull = shapeOrNull; Shapes = shapes; @@ -99,12 +84,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -153,16 +139,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "mainShape": - mainShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mainShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "shapeOrNull": - shapeOrNull = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapeOrNull = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "shapes": - shapes = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapes = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "nullableShape": - nullableShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nullableShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -170,6 +160,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mainShape == null) + throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing."); + + if (shapeOrNull == null) + throw new ArgumentNullException(nameof(shapeOrNull), "Property is required for class Drawing."); + + if (shapes == null) + throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Drawing(mainShape, shapeOrNull, shapes, nullableShape); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs index 41c69ce3b0e..5d43a6e312a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public EnumArrays(List arrayEnum, JustSymbolEnum justSymbol) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (justSymbol == null) - throw new ArgumentNullException("justSymbol is a required property for EnumArrays and cannot be null."); - - if (arrayEnum == null) - throw new ArgumentNullException("arrayEnum is a required property for EnumArrays and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayEnum = arrayEnum; JustSymbol = justSymbol; } @@ -144,7 +132,7 @@ namespace Org.OpenAPITools.Model public static string JustSymbolEnumToJsonValue(JustSymbolEnum value) { if (value == JustSymbolEnum.GreaterThanOrEqualTo) - return ">="; + return ">="; if (value == JustSymbolEnum.Dollar) return "$"; @@ -184,12 +172,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -236,7 +225,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_enum": - arrayEnum = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayEnum = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); @@ -248,6 +238,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (justSymbol == null) + throw new ArgumentNullException(nameof(justSymbol), "Property is required for class EnumArrays."); + + if (arrayEnum == null) + throw new ArgumentNullException(nameof(arrayEnum), "Property is required for class EnumArrays."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new EnumArrays(arrayEnum, justSymbol); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs index 67fdded75f6..3904f1f39b6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -43,36 +43,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public EnumTest(EnumIntegerEnum enumInteger, EnumIntegerOnlyEnum enumIntegerOnly, EnumNumberEnum enumNumber, EnumStringEnum enumString, EnumStringRequiredEnum enumStringRequired, OuterEnumDefaultValue outerEnumDefaultValue, OuterEnumInteger outerEnumInteger, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue, OuterEnum? outerEnum = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (enumString == null) - throw new ArgumentNullException("enumString is a required property for EnumTest and cannot be null."); - - if (enumStringRequired == null) - throw new ArgumentNullException("enumStringRequired is a required property for EnumTest and cannot be null."); - - if (enumInteger == null) - throw new ArgumentNullException("enumInteger is a required property for EnumTest and cannot be null."); - - if (enumIntegerOnly == null) - throw new ArgumentNullException("enumIntegerOnly is a required property for EnumTest and cannot be null."); - - if (enumNumber == null) - throw new ArgumentNullException("enumNumber is a required property for EnumTest and cannot be null."); - - if (outerEnumInteger == null) - throw new ArgumentNullException("outerEnumInteger is a required property for EnumTest and cannot be null."); - - if (outerEnumDefaultValue == null) - throw new ArgumentNullException("outerEnumDefaultValue is a required property for EnumTest and cannot be null."); - - if (outerEnumIntegerDefaultValue == null) - throw new ArgumentNullException("outerEnumIntegerDefaultValue is a required property for EnumTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EnumInteger = enumInteger; EnumIntegerOnly = enumIntegerOnly; EnumNumber = enumNumber; @@ -425,12 +395,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -484,13 +455,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "enum_integer": - enumInteger = (EnumTest.EnumIntegerEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumInteger = (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32(); break; case "enum_integer_only": - enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32(); break; case "enum_number": - enumNumber = (EnumTest.EnumNumberEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumNumber = (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32(); break; case "enum_string": string enumStringRawValue = utf8JsonReader.GetString(); @@ -522,6 +496,36 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (enumString == null) + throw new ArgumentNullException(nameof(enumString), "Property is required for class EnumTest."); + + if (enumStringRequired == null) + throw new ArgumentNullException(nameof(enumStringRequired), "Property is required for class EnumTest."); + + if (enumInteger == null) + throw new ArgumentNullException(nameof(enumInteger), "Property is required for class EnumTest."); + + if (enumIntegerOnly == null) + throw new ArgumentNullException(nameof(enumIntegerOnly), "Property is required for class EnumTest."); + + if (enumNumber == null) + throw new ArgumentNullException(nameof(enumNumber), "Property is required for class EnumTest."); + + if (outerEnumInteger == null) + throw new ArgumentNullException(nameof(outerEnumInteger), "Property is required for class EnumTest."); + + if (outerEnumDefaultValue == null) + throw new ArgumentNullException(nameof(outerEnumDefaultValue), "Property is required for class EnumTest."); + + if (outerEnumIntegerDefaultValue == null) + throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is required for class EnumTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new EnumTest(enumInteger, enumIntegerOnly, enumNumber, enumString, enumStringRequired, outerEnumDefaultValue, outerEnumInteger, outerEnumIntegerDefaultValue, outerEnum); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index f9ccd27de59..ffcc56e02ac 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -68,12 +68,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs index 7997aa35771..6590517a86d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public File(string sourceURI) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (sourceURI == null) - throw new ArgumentNullException("sourceURI is a required property for File and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - SourceURI = sourceURI; } @@ -73,12 +64,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -132,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (sourceURI == null) + throw new ArgumentNullException(nameof(sourceURI), "Property is required for class File."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new File(sourceURI); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 900d8f285f2..30f69094f53 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public FileSchemaTestClass(File file, List files) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (file == null) - throw new ArgumentNullException("file is a required property for FileSchemaTestClass and cannot be null."); - - if (files == null) - throw new ArgumentNullException("files is a required property for FileSchemaTestClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - File = file; Files = files; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -136,10 +125,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "file": - file = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + file = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "files": - files = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + files = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -147,6 +138,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (file == null) + throw new ArgumentNullException(nameof(file), "Property is required for class FileSchemaTestClass."); + + if (files == null) + throw new ArgumentNullException(nameof(files), "Property is required for class FileSchemaTestClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new FileSchemaTestClass(file, files); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs index f6efe68bce5..f1340fbe613 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs @@ -33,17 +33,8 @@ namespace Org.OpenAPITools.Model /// /// bar (default to "bar") [JsonConstructor] - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for Foo and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class Foo."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Foo(bar); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index f2b8c70df21..c1e336dbb78 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public FooGetDefaultResponse(Foo stringProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (stringProperty == null) - throw new ArgumentNullException("stringProperty is a required property for FooGetDefaultResponse and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - StringProperty = stringProperty; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "string": - stringProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + stringProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (stringProperty == null) + throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FooGetDefaultResponse."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new FooGetDefaultResponse(stringProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs index 795e741d1a1..9c63adbde8e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -46,64 +46,12 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// stringProperty + /// unsignedInteger + /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, Guid uuid) + public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (integer == null) - throw new ArgumentNullException("integer is a required property for FormatTest and cannot be null."); - - if (int32 == null) - throw new ArgumentNullException("int32 is a required property for FormatTest and cannot be null."); - - if (int64 == null) - throw new ArgumentNullException("int64 is a required property for FormatTest and cannot be null."); - - if (number == null) - throw new ArgumentNullException("number is a required property for FormatTest and cannot be null."); - - if (floatProperty == null) - throw new ArgumentNullException("floatProperty is a required property for FormatTest and cannot be null."); - - if (doubleProperty == null) - throw new ArgumentNullException("doubleProperty is a required property for FormatTest and cannot be null."); - - if (decimalProperty == null) - throw new ArgumentNullException("decimalProperty is a required property for FormatTest and cannot be null."); - - if (stringProperty == null) - throw new ArgumentNullException("stringProperty is a required property for FormatTest and cannot be null."); - - if (byteProperty == null) - throw new ArgumentNullException("byteProperty is a required property for FormatTest and cannot be null."); - - if (binary == null) - throw new ArgumentNullException("binary is a required property for FormatTest and cannot be null."); - - if (date == null) - throw new ArgumentNullException("date is a required property for FormatTest and cannot be null."); - - if (dateTime == null) - throw new ArgumentNullException("dateTime is a required property for FormatTest and cannot be null."); - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for FormatTest and cannot be null."); - - if (password == null) - throw new ArgumentNullException("password is a required property for FormatTest and cannot be null."); - - if (patternWithDigits == null) - throw new ArgumentNullException("patternWithDigits is a required property for FormatTest and cannot be null."); - - if (patternWithDigitsAndDelimiter == null) - throw new ArgumentNullException("patternWithDigitsAndDelimiter is a required property for FormatTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Binary = binary; ByteProperty = byteProperty; Date = date; @@ -119,6 +67,8 @@ namespace Org.OpenAPITools.Model PatternWithDigits = patternWithDigits; PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; StringProperty = stringProperty; + UnsignedInteger = unsignedInteger; + UnsignedLong = unsignedLong; Uuid = uuid; } @@ -137,12 +87,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [JsonPropertyName("date")] public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [JsonPropertyName("dateTime")] public DateTime DateTime { get; set; } @@ -214,9 +166,22 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string StringProperty { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [JsonPropertyName("unsigned_integer")] + public uint UnsignedInteger { get; set; } + + /// + /// Gets or Sets UnsignedLong + /// + [JsonPropertyName("unsigned_long")] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [JsonPropertyName("uuid")] public Guid Uuid { get; set; } @@ -249,17 +214,20 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" StringProperty: ").Append(StringProperty).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // DoubleProperty (double) maximum if (this.DoubleProperty > (double)123.4) @@ -334,26 +302,38 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); } // StringProperty (string) pattern - Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexStringProperty.Match(this.StringProperty).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + yield break; } } @@ -366,7 +346,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize Date /// - public static string DateFormat { get; set; } = "yyyy-MM-dd"; + public static string DateFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// The format to use to serialize DateTime @@ -405,6 +385,8 @@ namespace Org.OpenAPITools.Model string patternWithDigits = default; string patternWithDigitsAndDelimiter = default; string stringProperty = default; + uint unsignedInteger = default; + ulong unsignedLong = default; Guid uuid = default; while (utf8JsonReader.Read()) @@ -423,37 +405,48 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "binary": - binary = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + binary = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "byte": - byteProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + byteProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "date": - date = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + date = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "dateTime": - dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "decimal": - decimalProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + decimalProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "double": - doubleProperty = utf8JsonReader.GetDouble(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + doubleProperty = utf8JsonReader.GetDouble(); break; case "float": - floatProperty = (float)utf8JsonReader.GetDouble(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + floatProperty = (float)utf8JsonReader.GetDouble(); break; case "int32": - int32 = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32 = utf8JsonReader.GetInt32(); break; case "int64": - int64 = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64 = utf8JsonReader.GetInt64(); break; case "integer": - integer = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integer = utf8JsonReader.GetInt32(); break; case "number": - number = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + number = utf8JsonReader.GetDecimal(); break; case "password": password = utf8JsonReader.GetString(); @@ -467,8 +460,17 @@ namespace Org.OpenAPITools.Model case "string": stringProperty = utf8JsonReader.GetString(); break; + case "unsigned_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedInteger = utf8JsonReader.GetUInt32(); + break; + case "unsigned_long": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedLong = utf8JsonReader.GetUInt64(); + break; case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; default: break; @@ -476,7 +478,67 @@ namespace Org.OpenAPITools.Model } } - return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, uuid); +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (integer == null) + throw new ArgumentNullException(nameof(integer), "Property is required for class FormatTest."); + + if (int32 == null) + throw new ArgumentNullException(nameof(int32), "Property is required for class FormatTest."); + + if (unsignedInteger == null) + throw new ArgumentNullException(nameof(unsignedInteger), "Property is required for class FormatTest."); + + if (int64 == null) + throw new ArgumentNullException(nameof(int64), "Property is required for class FormatTest."); + + if (unsignedLong == null) + throw new ArgumentNullException(nameof(unsignedLong), "Property is required for class FormatTest."); + + if (number == null) + throw new ArgumentNullException(nameof(number), "Property is required for class FormatTest."); + + if (floatProperty == null) + throw new ArgumentNullException(nameof(floatProperty), "Property is required for class FormatTest."); + + if (doubleProperty == null) + throw new ArgumentNullException(nameof(doubleProperty), "Property is required for class FormatTest."); + + if (decimalProperty == null) + throw new ArgumentNullException(nameof(decimalProperty), "Property is required for class FormatTest."); + + if (stringProperty == null) + throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FormatTest."); + + if (byteProperty == null) + throw new ArgumentNullException(nameof(byteProperty), "Property is required for class FormatTest."); + + if (binary == null) + throw new ArgumentNullException(nameof(binary), "Property is required for class FormatTest."); + + if (date == null) + throw new ArgumentNullException(nameof(date), "Property is required for class FormatTest."); + + if (dateTime == null) + throw new ArgumentNullException(nameof(dateTime), "Property is required for class FormatTest."); + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class FormatTest."); + + if (password == null) + throw new ArgumentNullException(nameof(password), "Property is required for class FormatTest."); + + if (patternWithDigits == null) + throw new ArgumentNullException(nameof(patternWithDigits), "Property is required for class FormatTest."); + + if (patternWithDigitsAndDelimiter == null) + throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is required for class FormatTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid); } /// @@ -508,6 +570,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits); writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter); writer.WriteString("string", formatTest.StringProperty); + writer.WriteNumber("unsigned_integer", formatTest.UnsignedInteger); + writer.WriteNumber("unsigned_long", formatTest.UnsignedLong); writer.WriteString("uuid", formatTest.Uuid); writer.WriteEndObject(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs index 6d793581a27..1897c29368b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs @@ -36,15 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Apple apple, string color) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException(nameof(Color)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Apple = apple; Color = color; } @@ -57,15 +48,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Banana banana, string color) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException(nameof(Color)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Banana = banana; Color = color; } @@ -98,12 +80,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -163,6 +146,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (appleDeserialized) return new Fruit(apple, color); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs index e3c2dde4faa..1f3cebfc712 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs @@ -69,12 +69,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs index d1630926033..e8a5ee705d9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public GmFruit(Apple apple, Banana banana, string color) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException("color is a required property for GmFruit and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Apple = Apple; Banana = Banana; Color = color; @@ -79,12 +70,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -144,6 +136,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class GmFruit."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new GmFruit(apple, banana, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index d0ebffcd70c..5eb944b1344 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public GrandparentAnimal(string petType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (petType == null) - throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - PetType = petType; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -141,6 +133,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (petType == null) + throw new ArgumentNullException(nameof(petType), "Property is required for class GrandparentAnimal."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new GrandparentAnimal(petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index ba5b4e850a0..783d3552c2b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] internal HasOnlyReadOnly(string bar, string foo) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for HasOnlyReadOnly and cannot be null."); - - if (foo == null) - throw new ArgumentNullException("foo is a required property for HasOnlyReadOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; Foo = foo; } @@ -121,12 +109,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -184,6 +173,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class HasOnlyReadOnly."); + + if (foo == null) + throw new ArgumentNullException(nameof(foo), "Property is required for class HasOnlyReadOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new HasOnlyReadOnly(bar, foo); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 6db340e73bb..d7f78eef1f4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -63,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 119216e42a3..2c987e36594 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -61,12 +61,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs index 0c52844f3df..4553f4f3a29 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public List(string _123list) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (_123list == null) - throw new ArgumentNullException("_123list is a required property for List and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - _123List = _123list; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (_123list == null) + throw new ArgumentNullException(nameof(_123list), "Property is required for class List."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new List(_123list); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..28084cc3a8b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,171 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + public partial class LiteralStringClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username") + /// unescapedLiteralString (default to "C:\Users\username") + [JsonConstructor] + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + EscapedLiteralString = escapedLiteralString; + UnescapedLiteralString = unescapedLiteralString; + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [JsonPropertyName("escapedLiteralString")] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [JsonPropertyName("unescapedLiteralString")] + public string UnescapedLiteralString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type LiteralStringClass + /// + public class LiteralStringClassJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override LiteralStringClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string escapedLiteralString = default; + string unescapedLiteralString = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "escapedLiteralString": + escapedLiteralString = utf8JsonReader.GetString(); + break; + case "unescapedLiteralString": + unescapedLiteralString = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (escapedLiteralString == null) + throw new ArgumentNullException(nameof(escapedLiteralString), "Property is required for class LiteralStringClass."); + + if (unescapedLiteralString == null) + throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is required for class LiteralStringClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WriteString("escapedLiteralString", literalStringClass.EscapedLiteralString); + writer.WriteString("unescapedLiteralString", literalStringClass.UnescapedLiteralString); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs index 0751201e466..6a39a41063a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs @@ -91,12 +91,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs index 7e701c9b9a3..57630f7d8ed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -38,24 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public MapTest(Dictionary directMap, Dictionary indirectMap, Dictionary> mapMapOfString, Dictionary mapOfEnumString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mapMapOfString == null) - throw new ArgumentNullException("mapMapOfString is a required property for MapTest and cannot be null."); - - if (mapOfEnumString == null) - throw new ArgumentNullException("mapOfEnumString is a required property for MapTest and cannot be null."); - - if (directMap == null) - throw new ArgumentNullException("directMap is a required property for MapTest and cannot be null."); - - if (indirectMap == null) - throw new ArgumentNullException("indirectMap is a required property for MapTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DirectMap = directMap; IndirectMap = indirectMap; MapMapOfString = mapMapOfString; @@ -158,12 +140,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -212,16 +195,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "direct_map": - directMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + directMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "indirect_map": - indirectMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + indirectMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_map_of_string": - mapMapOfString = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapMapOfString = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_of_enum_string": - mapOfEnumString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfEnumString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -229,6 +216,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mapMapOfString == null) + throw new ArgumentNullException(nameof(mapMapOfString), "Property is required for class MapTest."); + + if (mapOfEnumString == null) + throw new ArgumentNullException(nameof(mapOfEnumString), "Property is required for class MapTest."); + + if (directMap == null) + throw new ArgumentNullException(nameof(directMap), "Property is required for class MapTest."); + + if (indirectMap == null) + throw new ArgumentNullException(nameof(indirectMap), "Property is required for class MapTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 30821d80580..a4b87545f05 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -38,24 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid, Guid uuidWithPattern) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (uuidWithPattern == null) - throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (dateTime == null) - throw new ArgumentNullException("dateTime is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (map == null) - throw new ArgumentNullException("map is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DateTime = dateTime; Map = map; Uuid = uuid; @@ -108,15 +90,16 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); @@ -174,16 +157,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "dateTime": - dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map": - map = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + map = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; case "uuid_with_pattern": - uuidWithPattern = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuidWithPattern = utf8JsonReader.GetGuid(); break; default: break; @@ -191,6 +178,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (uuidWithPattern == null) + throw new ArgumentNullException(nameof(uuidWithPattern), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (dateTime == null) + throw new ArgumentNullException(nameof(dateTime), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (map == null) + throw new ArgumentNullException(nameof(map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs index 1ea81633836..25b0862bbc0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Model200Response(string classProperty, int name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for Model200Response and cannot be null."); - - if (classProperty == null) - throw new ArgumentNullException("classProperty is a required property for Model200Response and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassProperty = classProperty; Name = name; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -139,7 +128,8 @@ namespace Org.OpenAPITools.Model classProperty = utf8JsonReader.GetString(); break; case "name": - name = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + name = utf8JsonReader.GetInt32(); break; default: break; @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Model200Response."); + + if (classProperty == null) + throw new ArgumentNullException(nameof(classProperty), "Property is required for class Model200Response."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Model200Response(classProperty, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs index ba8b6196a1a..f3ffbd3a822 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ModelClient(string clientProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (clientProperty == null) - throw new ArgumentNullException("clientProperty is a required property for ModelClient and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - _ClientProperty = clientProperty; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (clientProperty == null) + throw new ArgumentNullException(nameof(clientProperty), "Property is required for class ModelClient."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ModelClient(clientProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs index 93864f5241c..9ead9323c34 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs @@ -38,24 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Name(int nameProperty, string property, int snakeCase, int _123number) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (nameProperty == null) - throw new ArgumentNullException("nameProperty is a required property for Name and cannot be null."); - - if (snakeCase == null) - throw new ArgumentNullException("snakeCase is a required property for Name and cannot be null."); - - if (property == null) - throw new ArgumentNullException("property is a required property for Name and cannot be null."); - - if (_123number == null) - throw new ArgumentNullException("_123number is a required property for Name and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - NameProperty = nameProperty; Property = property; SnakeCase = snakeCase; @@ -145,12 +127,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -199,16 +182,19 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "name": - nameProperty = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nameProperty = utf8JsonReader.GetInt32(); break; case "property": property = utf8JsonReader.GetString(); break; case "snake_case": - snakeCase = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + snakeCase = utf8JsonReader.GetInt32(); break; case "123Number": - _123number = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + _123number = utf8JsonReader.GetInt32(); break; default: break; @@ -216,6 +202,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (nameProperty == null) + throw new ArgumentNullException(nameof(nameProperty), "Property is required for class Name."); + + if (snakeCase == null) + throw new ArgumentNullException(nameof(snakeCase), "Property is required for class Name."); + + if (property == null) + throw new ArgumentNullException(nameof(property), "Property is required for class Name."); + + if (_123number == null) + throw new ArgumentNullException(nameof(_123number), "Property is required for class Name."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Name(nameProperty, property, snakeCase, _123number); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs index fe0f847dc9d..34aeea6c10a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -46,18 +46,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public NullableClass(List arrayItemsNullable, Dictionary objectItemsNullable, List arrayAndItemsNullableProp = default, List arrayNullableProp = default, bool? booleanProp = default, DateTime? dateProp = default, DateTime? datetimeProp = default, int? integerProp = default, decimal? numberProp = default, Dictionary objectAndItemsNullableProp = default, Dictionary objectNullableProp = default, string stringProp = default) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayItemsNullable == null) - throw new ArgumentNullException("arrayItemsNullable is a required property for NullableClass and cannot be null."); - - if (objectItemsNullable == null) - throw new ArgumentNullException("objectItemsNullable is a required property for NullableClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayItemsNullable = arrayItemsNullable; ObjectItemsNullable = objectItemsNullable; ArrayAndItemsNullableProp = arrayAndItemsNullableProp; @@ -168,12 +156,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -187,7 +176,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize DateProp /// - public static string DatePropFormat { get; set; } = "yyyy-MM-dd"; + public static string DatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// The format to use to serialize DatetimeProp @@ -240,25 +229,32 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_items_nullable": - arrayItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "object_items_nullable": - objectItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_and_items_nullable_prop": - arrayAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_nullable_prop": - arrayNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "boolean_prop": - booleanProp = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + booleanProp = utf8JsonReader.GetBoolean(); break; case "date_prop": - dateProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "datetime_prop": - datetimeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + datetimeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "integer_prop": if (utf8JsonReader.TokenType != JsonTokenType.Null) @@ -269,10 +265,12 @@ namespace Org.OpenAPITools.Model numberProp = utf8JsonReader.GetInt32(); break; case "object_and_items_nullable_prop": - objectAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "object_nullable_prop": - objectNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "string_prop": stringProp = utf8JsonReader.GetString(); @@ -283,6 +281,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayItemsNullable == null) + throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is required for class NullableClass."); + + if (objectItemsNullable == null) + throw new ArgumentNullException(nameof(objectItemsNullable), "Property is required for class NullableClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new NullableClass(arrayItemsNullable, objectItemsNullable, arrayAndItemsNullableProp, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectNullableProp, stringProp); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 233e907c97e..494beaa0c0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [JsonPropertyName("uuid")] public Guid? Uuid { get; set; } @@ -63,12 +64,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -114,7 +116,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; default: break; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs index c07b44d5ebc..86c3ef2b52f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs @@ -76,12 +76,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs index 91a11d39e08..9a61acfc177 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public NumberOnly(decimal justNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (justNumber == null) - throw new ArgumentNullException("justNumber is a required property for NumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - JustNumber = justNumber; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "JustNumber": - justNumber = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + justNumber = utf8JsonReader.GetDecimal(); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (justNumber == null) + throw new ArgumentNullException(nameof(justNumber), "Property is required for class NumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new NumberOnly(justNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index ac3f6e116b3..c72cefc32ea 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -38,24 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ObjectWithDeprecatedFields(List bars, DeprecatedObject deprecatedRef, decimal id, string uuid) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (id == null) - throw new ArgumentNullException("id is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (deprecatedRef == null) - throw new ArgumentNullException("deprecatedRef is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (bars == null) - throw new ArgumentNullException("bars is a required property for ObjectWithDeprecatedFields and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bars = bars; DeprecatedRef = deprecatedRef; Id = id; @@ -111,12 +93,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -165,13 +148,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "bars": - bars = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + bars = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "deprecatedRef": - deprecatedRef = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deprecatedRef = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "id": - id = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetDecimal(); break; case "uuid": uuid = utf8JsonReader.GetString(); @@ -182,6 +168,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class ObjectWithDeprecatedFields."); + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class ObjectWithDeprecatedFields."); + + if (deprecatedRef == null) + throw new ArgumentNullException(nameof(deprecatedRef), "Property is required for class ObjectWithDeprecatedFields."); + + if (bars == null) + throw new ArgumentNullException(nameof(bars), "Property is required for class ObjectWithDeprecatedFields."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ObjectWithDeprecatedFields(bars, deprecatedRef, id, uuid); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs index 00738d9c335..8ebcf3cd50a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs @@ -40,30 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Order(long id, long petId, int quantity, DateTime shipDate, StatusEnum status, bool complete = false) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Order and cannot be null."); - - if (petId == null) - throw new ArgumentNullException("petId is a required property for Order and cannot be null."); - - if (quantity == null) - throw new ArgumentNullException("quantity is a required property for Order and cannot be null."); - - if (shipDate == null) - throw new ArgumentNullException("shipDate is a required property for Order and cannot be null."); - - if (status == null) - throw new ArgumentNullException("status is a required property for Order and cannot be null."); - - if (complete == null) - throw new ArgumentNullException("complete is a required property for Order and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; PetId = petId; Quantity = quantity; @@ -162,6 +138,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [JsonPropertyName("shipDate")] public DateTime ShipDate { get; set; } @@ -195,12 +172,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -256,23 +234,28 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "petId": - petId = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + petId = utf8JsonReader.GetInt64(); break; case "quantity": - quantity = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + quantity = utf8JsonReader.GetInt32(); break; case "shipDate": - shipDate = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shipDate = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "status": string statusRawValue = utf8JsonReader.GetString(); status = Order.StatusEnumFromString(statusRawValue); break; case "complete": - complete = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + complete = utf8JsonReader.GetBoolean(); break; default: break; @@ -280,6 +263,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Order."); + + if (petId == null) + throw new ArgumentNullException(nameof(petId), "Property is required for class Order."); + + if (quantity == null) + throw new ArgumentNullException(nameof(quantity), "Property is required for class Order."); + + if (shipDate == null) + throw new ArgumentNullException(nameof(shipDate), "Property is required for class Order."); + + if (status == null) + throw new ArgumentNullException(nameof(status), "Property is required for class Order."); + + if (complete == null) + throw new ArgumentNullException(nameof(complete), "Property is required for class Order."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Order(id, petId, quantity, shipDate, status, complete); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs index 0d88d627848..fd2a96d97ec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -37,21 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public OuterComposite(bool myBoolean, decimal myNumber, string myString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (myNumber == null) - throw new ArgumentNullException("myNumber is a required property for OuterComposite and cannot be null."); - - if (myString == null) - throw new ArgumentNullException("myString is a required property for OuterComposite and cannot be null."); - - if (myBoolean == null) - throw new ArgumentNullException("myBoolean is a required property for OuterComposite and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - MyBoolean = myBoolean; MyNumber = myNumber; MyString = myString; @@ -96,12 +81,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -149,10 +135,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "my_boolean": - myBoolean = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myBoolean = utf8JsonReader.GetBoolean(); break; case "my_number": - myNumber = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myNumber = utf8JsonReader.GetDecimal(); break; case "my_string": myString = utf8JsonReader.GetString(); @@ -163,6 +151,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (myNumber == null) + throw new ArgumentNullException(nameof(myNumber), "Property is required for class OuterComposite."); + + if (myString == null) + throw new ArgumentNullException(nameof(myString), "Property is required for class OuterComposite."); + + if (myBoolean == null) + throw new ArgumentNullException(nameof(myBoolean), "Property is required for class OuterComposite."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new OuterComposite(myBoolean, myNumber, myString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs index 9158b93f5f5..fdc59f593c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs @@ -40,30 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Pet(Category category, long id, string name, List photoUrls, StatusEnum status, List tags) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Pet and cannot be null."); - - if (category == null) - throw new ArgumentNullException("category is a required property for Pet and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Pet and cannot be null."); - - if (photoUrls == null) - throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null."); - - if (tags == null) - throw new ArgumentNullException("tags is a required property for Pet and cannot be null."); - - if (status == null) - throw new ArgumentNullException("status is a required property for Pet and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Category = category; Id = id; Name = name; @@ -156,6 +132,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [JsonPropertyName("name")] public string Name { get; set; } @@ -195,12 +172,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -251,23 +229,27 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "category": - category = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + category = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); break; case "photoUrls": - photoUrls = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + photoUrls = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "status": string statusRawValue = utf8JsonReader.GetString(); status = Pet.StatusEnumFromString(statusRawValue); break; case "tags": - tags = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + tags = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -275,6 +257,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Pet."); + + if (category == null) + throw new ArgumentNullException(nameof(category), "Property is required for class Pet."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Pet."); + + if (photoUrls == null) + throw new ArgumentNullException(nameof(photoUrls), "Property is required for class Pet."); + + if (tags == null) + throw new ArgumentNullException(nameof(tags), "Property is required for class Pet."); + + if (status == null) + throw new ArgumentNullException(nameof(status), "Property is required for class Pet."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Pet(category, id, name, photoUrls, status, tags); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs index 358f8cdbe31..85ab6251f50 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs @@ -76,12 +76,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 9cb8277290b..3c4e3ea5639 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -106,12 +106,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs index 34f1549087f..c2d44ceb5b1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -76,12 +76,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 73b448ebfaf..12f1df4e2fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public QuadrilateralInterface(string quadrilateralType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - QuadrilateralType = quadrilateralType; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class QuadrilateralInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new QuadrilateralInterface(quadrilateralType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index a77197ed839..a627d781b7c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ReadOnlyFirst(string bar, string baz) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for ReadOnlyFirst and cannot be null."); - - if (baz == null) - throw new ArgumentNullException("baz is a required property for ReadOnlyFirst and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; Baz = baz; } @@ -120,12 +108,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -183,6 +172,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class ReadOnlyFirst."); + + if (baz == null) + throw new ArgumentNullException(nameof(baz), "Property is required for class ReadOnlyFirst."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ReadOnlyFirst(bar, baz); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs index 23704ea0a86..1e456507b90 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Return(int returnProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (returnProperty == null) - throw new ArgumentNullException("returnProperty is a required property for Return and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ReturnProperty = returnProperty; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "return": - returnProperty = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + returnProperty = utf8JsonReader.GetInt32(); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (returnProperty == null) + throw new ArgumentNullException(nameof(returnProperty), "Property is required for class Return."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Return(returnProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index ee156811143..0588ff50679 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -68,12 +68,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs index 2e29d505fd7..0fe8f6619dc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs @@ -36,15 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Shape(Triangle triangle, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Triangle = triangle; QuadrilateralType = quadrilateralType; } @@ -57,15 +48,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Shape(Quadrilateral quadrilateral, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Quadrilateral = quadrilateral; QuadrilateralType = quadrilateralType; } @@ -105,12 +87,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -180,6 +163,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class Shape."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (triangleDeserialized) return new Shape(triangle, quadrilateralType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index c47f5d73c9a..c0693b6831f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeInterface(string shapeType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ShapeType = shapeType; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (shapeType == null) + throw new ArgumentNullException(nameof(shapeType), "Property is required for class ShapeInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ShapeInterface(shapeType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs index a7de304d7c0..0eb8b07b368 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -36,15 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeOrNull(Triangle triangle, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Triangle = triangle; QuadrilateralType = quadrilateralType; } @@ -57,15 +48,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeOrNull(Quadrilateral quadrilateral, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Quadrilateral = quadrilateral; QuadrilateralType = quadrilateralType; } @@ -105,12 +87,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -180,6 +163,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class ShapeOrNull."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (triangleDeserialized) return new ShapeOrNull(triangle, quadrilateralType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 219c6c795f7..32ec4152f7f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -68,12 +68,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs index 4af7567d283..d460df8625c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public SpecialModelName(string specialModelNameProperty, long specialPropertyName) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (specialPropertyName == null) - throw new ArgumentNullException("specialPropertyName is a required property for SpecialModelName and cannot be null."); - - if (specialModelNameProperty == null) - throw new ArgumentNullException("specialModelNameProperty is a required property for SpecialModelName and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - SpecialModelNameProperty = specialModelNameProperty; SpecialPropertyName = specialPropertyName; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -139,7 +128,8 @@ namespace Org.OpenAPITools.Model specialModelNameProperty = utf8JsonReader.GetString(); break; case "$special[property.name]": - specialPropertyName = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + specialPropertyName = utf8JsonReader.GetInt64(); break; default: break; @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (specialPropertyName == null) + throw new ArgumentNullException(nameof(specialPropertyName), "Property is required for class SpecialModelName."); + + if (specialModelNameProperty == null) + throw new ArgumentNullException(nameof(specialModelNameProperty), "Property is required for class SpecialModelName."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new SpecialModelName(specialModelNameProperty, specialPropertyName); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs index a2f0590c288..25683998ebb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Tag(long id, string name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Tag and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Tag and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; Name = name; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -136,7 +125,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Tag."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Tag."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Tag(id, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..555b289c82f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,154 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + public partial class TestCollectionEndingWithWordList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value + [JsonConstructor] + public TestCollectionEndingWithWordList(string value) + { + Value = value; + } + + /// + /// Gets or Sets Value + /// + [JsonPropertyName("value")] + public string Value { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type TestCollectionEndingWithWordList + /// + public class TestCollectionEndingWithWordListJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordList Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string value = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "value": + value = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (value == null) + throw new ArgumentNullException(nameof(value), "Property is required for class TestCollectionEndingWithWordList."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new TestCollectionEndingWithWordList(value); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WriteString("value", testCollectionEndingWithWordList.Value); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..0e4dbfd8406 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,156 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + public partial class TestCollectionEndingWithWordListObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList + [JsonConstructor] + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList) + { + TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [JsonPropertyName("TestCollectionEndingWithWordList")] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type TestCollectionEndingWithWordListObject + /// + public class TestCollectionEndingWithWordListObjectJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordListObject Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + List testCollectionEndingWithWordList = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "TestCollectionEndingWithWordList": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + testCollectionEndingWithWordList = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (testCollectionEndingWithWordList == null) + throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WritePropertyName("TestCollectionEndingWithWordList"); + JsonSerializer.Serialize(writer, testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList, jsonSerializerOptions); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs index 81884177e02..46e762901b3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs @@ -37,18 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(EquilateralTriangle equilateralTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EquilateralTriangle = equilateralTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -63,18 +51,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(IsoscelesTriangle isoscelesTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - IsoscelesTriangle = isoscelesTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -89,18 +65,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(ScaleneTriangle scaleneTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ScaleneTriangle = scaleneTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -153,12 +117,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -235,6 +200,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (shapeType == null) + throw new ArgumentNullException(nameof(shapeType), "Property is required for class Triangle."); + + if (triangleType == null) + throw new ArgumentNullException(nameof(triangleType), "Property is required for class Triangle."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (equilateralTriangleDeserialized) return new Triangle(equilateralTriangle, shapeType, triangleType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index ddb4e8de495..2926c5cd546 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public TriangleInterface(string triangleType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleType == null) - throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - TriangleType = triangleType; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (triangleType == null) + throw new ArgumentNullException(nameof(triangleType), "Property is required for class TriangleInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new TriangleInterface(triangleType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs index 875cebefe8b..b78692934cc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs @@ -46,39 +46,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public User(string email, string firstName, long id, string lastName, Object objectWithNoDeclaredProps, string password, string phone, int userStatus, string username, Object anyTypeProp = default, Object anyTypePropNullable = default, Object objectWithNoDeclaredPropsNullable = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for User and cannot be null."); - - if (username == null) - throw new ArgumentNullException("username is a required property for User and cannot be null."); - - if (firstName == null) - throw new ArgumentNullException("firstName is a required property for User and cannot be null."); - - if (lastName == null) - throw new ArgumentNullException("lastName is a required property for User and cannot be null."); - - if (email == null) - throw new ArgumentNullException("email is a required property for User and cannot be null."); - - if (password == null) - throw new ArgumentNullException("password is a required property for User and cannot be null."); - - if (phone == null) - throw new ArgumentNullException("phone is a required property for User and cannot be null."); - - if (userStatus == null) - throw new ArgumentNullException("userStatus is a required property for User and cannot be null."); - - if (objectWithNoDeclaredProps == null) - throw new ArgumentNullException("objectWithNoDeclaredProps is a required property for User and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Email = email; FirstName = firstName; Id = id; @@ -200,12 +167,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -268,13 +236,15 @@ namespace Org.OpenAPITools.Model firstName = utf8JsonReader.GetString(); break; case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "lastName": lastName = utf8JsonReader.GetString(); break; case "objectWithNoDeclaredProps": - objectWithNoDeclaredProps = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredProps = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "password": password = utf8JsonReader.GetString(); @@ -283,19 +253,23 @@ namespace Org.OpenAPITools.Model phone = utf8JsonReader.GetString(); break; case "userStatus": - userStatus = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + userStatus = utf8JsonReader.GetInt32(); break; case "username": username = utf8JsonReader.GetString(); break; case "anyTypeProp": - anyTypeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "anyTypePropNullable": - anyTypePropNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypePropNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "objectWithNoDeclaredPropsNullable": - objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -303,6 +277,39 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class User."); + + if (username == null) + throw new ArgumentNullException(nameof(username), "Property is required for class User."); + + if (firstName == null) + throw new ArgumentNullException(nameof(firstName), "Property is required for class User."); + + if (lastName == null) + throw new ArgumentNullException(nameof(lastName), "Property is required for class User."); + + if (email == null) + throw new ArgumentNullException(nameof(email), "Property is required for class User."); + + if (password == null) + throw new ArgumentNullException(nameof(password), "Property is required for class User."); + + if (phone == null) + throw new ArgumentNullException(nameof(phone), "Property is required for class User."); + + if (userStatus == null) + throw new ArgumentNullException(nameof(userStatus), "Property is required for class User."); + + if (objectWithNoDeclaredProps == null) + throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is required for class User."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new User(email, firstName, id, lastName, objectWithNoDeclaredProps, password, phone, userStatus, username, anyTypeProp, anyTypePropNullable, objectWithNoDeclaredPropsNullable); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs index 0129208c866..0296c2082fc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs @@ -37,21 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Whale(string className, bool hasBaleen, bool hasTeeth) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (hasBaleen == null) - throw new ArgumentNullException("hasBaleen is a required property for Whale and cannot be null."); - - if (hasTeeth == null) - throw new ArgumentNullException("hasTeeth is a required property for Whale and cannot be null."); - - if (className == null) - throw new ArgumentNullException("className is a required property for Whale and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; HasBaleen = hasBaleen; HasTeeth = hasTeeth; @@ -96,12 +81,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -152,10 +138,12 @@ namespace Org.OpenAPITools.Model className = utf8JsonReader.GetString(); break; case "hasBaleen": - hasBaleen = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasBaleen = utf8JsonReader.GetBoolean(); break; case "hasTeeth": - hasTeeth = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasTeeth = utf8JsonReader.GetBoolean(); break; default: break; @@ -163,6 +151,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (hasBaleen == null) + throw new ArgumentNullException(nameof(hasBaleen), "Property is required for class Whale."); + + if (hasTeeth == null) + throw new ArgumentNullException(nameof(hasTeeth), "Property is required for class Whale."); + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Whale."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Whale(className, hasBaleen, hasTeeth); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs index 3df8c300ab6..40970ba5b0b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Zebra(string className, TypeEnum type) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (type == null) - throw new ArgumentNullException("type is a required property for Zebra and cannot be null."); - - if (className == null) - throw new ArgumentNullException("className is a required property for Zebra and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; Type = type; } @@ -146,12 +134,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -210,6 +199,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (type == null) + throw new ArgumentNullException(nameof(type), "Property is required for class Zebra."); + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Zebra."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Zebra(className, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/.openapi-generator/FILES index f71328b618e..16f489ff88b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/apis/DefaultApi.md docs/models/Adult.md diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/api/openapi.yaml new file mode 100644 index 00000000000..9c001848c5e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/api/openapi.yaml @@ -0,0 +1,77 @@ +openapi: 3.0.1 +info: + license: + name: MIT + title: Example + version: 1.0.0 +servers: +- url: http://api.example.xyz/v1 +paths: + /person/display/{personId}: + get: + operationId: list + parameters: + - description: The id of the person to retrieve + explode: false + in: path + name: personId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Person' + description: OK +components: + schemas: + Person: + discriminator: + mapping: + a: '#/components/schemas/Adult' + c: Child + propertyName: $_type + example: + lastName: lastName + firstName: firstName + $_type: $_type + properties: + $_type: + type: string + lastName: + type: string + firstName: + type: string + type: object + Adult: + allOf: + - $ref: '#/components/schemas/Person' + - $ref: '#/components/schemas/Adult_allOf' + description: A representation of an adult + Child: + allOf: + - $ref: '#/components/schemas/Child_allOf' + - $ref: '#/components/schemas/Person' + description: A representation of a child + properties: + boosterSeat: + type: boolean + Adult_allOf: + properties: + children: + items: + $ref: '#/components/schemas/Child' + type: array + type: object + example: null + Child_allOf: + properties: + age: + format: int32 + type: integer + type: object + example: null + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/AdultAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/AdultAllOfTests.cs index d534024a85d..79cac16d985 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/AdultAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/AdultAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs index 026277c98bb..aa1b838ba24 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/AdultTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/ChildAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/ChildAllOfTests.cs index 54deefe8954..60403279a85 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/ChildAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/ChildAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs index cb536202248..cb9a378dbe2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/ChildTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs index cd3e2caf429..3cc4b096518 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Model/PersonTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 96b9fd0c60e..c3b726795f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Api/DefaultApi.cs index 1849b534544..5b196642d31 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -114,12 +114,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task ListAsync(string personId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await ListWithHttpInfoAsync(personId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await ListWithHttpInfoAsync(personId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -131,17 +131,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task ListOrDefaultAsync(string personId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await ListWithHttpInfoAsync(personId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await ListWithHttpInfoAsync(personId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -167,9 +167,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterList(ApiResponse apiResponse, string personId) + protected virtual void AfterList(ApiResponse apiResponseLocalVar, string personId) { } @@ -194,57 +194,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> ListWithHttpInfoAsync(string personId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { personId = OnList(personId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/person/display/{personId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/person/display/{personId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpersonId%7D", Uri.EscapeDataString(personId.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpersonId%7D", Uri.EscapeDataString(personId.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/person/display/{personId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/person/display/{personId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterList(apiResponse, personId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterList(apiResponseLocalVar, personId); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorList(e, "/person/display/{personId}", uriBuilder.Path, personId); + OnErrorList(e, "/person/display/{personId}", uriBuilderLocalVar.Path, personId); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/ClientUtils.cs index b8b2d106962..5ca0572afc1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -12,10 +12,13 @@ using System; using System.IO; using System.Linq; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -97,7 +100,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -124,9 +127,16 @@ namespace Org.OpenAPITools.Client // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs index 0083ee7169a..245aaa03ef2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -71,6 +71,6 @@ namespace Org.OpenAPITools.Client /// /// public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs index 95546974e1e..8f3c26a5869 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Client if (dateTimeValue == null) writer.WriteNullValue(); else - writer.WriteStringValue(dateTimeValue.Value.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/AdultAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/AdultAllOf.cs index 6e21ecc55f6..be4aa03e933 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/AdultAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/AdultAllOf.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public AdultAllOf(List children) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (children == null) - throw new ArgumentNullException("children is a required property for AdultAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Children = children; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "children": - children = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + children = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (children == null) + throw new ArgumentNullException(nameof(children), "Property is required for class AdultAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new AdultAllOf(children); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Child.cs index 639726c2156..f49a9fb004a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Child.cs @@ -41,15 +41,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Child(ChildAllOf childAllOf, bool boosterSeat, string firstName, string lastName, string type) : base(firstName, lastName, type) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (boosterSeat == null) - throw new ArgumentNullException("boosterSeat is a required property for Child and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ChildAllOf = childAllOf; BoosterSeat = boosterSeat; } @@ -126,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "boosterSeat": - boosterSeat = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + boosterSeat = utf8JsonReader.GetBoolean(); break; case "firstName": firstName = utf8JsonReader.GetString(); @@ -143,6 +135,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (boosterSeat == null) + throw new ArgumentNullException(nameof(boosterSeat), "Property is required for class Child."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Child(childAllOf, boosterSeat, firstName, lastName, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/ChildAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/ChildAllOf.cs index 3ad283bd7cb..6d4c1550e1c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/ChildAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/ChildAllOf.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ChildAllOf(int age) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (age == null) - throw new ArgumentNullException("age is a required property for ChildAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Age = age; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "age": - age = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + age = utf8JsonReader.GetInt32(); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (age == null) + throw new ArgumentNullException(nameof(age), "Property is required for class ChildAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ChildAllOf(age); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Person.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Person.cs index f525ba4905b..671722a5fc3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Person.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Person.cs @@ -39,21 +39,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Person(string firstName, string lastName, string type) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (type == null) - throw new ArgumentNullException("type is a required property for Person and cannot be null."); - - if (lastName == null) - throw new ArgumentNullException("lastName is a required property for Person and cannot be null."); - - if (firstName == null) - throw new ArgumentNullException("firstName is a required property for Person and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - FirstName = firstName; LastName = lastName; Type = type; @@ -98,12 +83,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -175,6 +161,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (type == null) + throw new ArgumentNullException(nameof(type), "Property is required for class Person."); + + if (lastName == null) + throw new ArgumentNullException(nameof(lastName), "Property is required for class Person."); + + if (firstName == null) + throw new ArgumentNullException(nameof(firstName), "Property is required for class Person."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Person(firstName, lastName, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/.openapi-generator/FILES index af3bdedb0b6..a71e463b072 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/apis/DefaultApi.md docs/models/Apple.md diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/api/openapi.yaml new file mode 100644 index 00000000000..25b9adb5f50 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/api/openapi.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +servers: +- url: / +paths: + /: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/fruit' + description: desc +components: + schemas: + fruit: + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + example: + color: color + properties: + color: + type: string + title: fruit + type: object + apple: + properties: + kind: + type: string + title: apple + type: object + banana: + properties: + count: + type: number + title: banana + type: object + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs index 82bd275c090..e0064920ad5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs index db7177c2d9e..6c54c0fb07e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs index 11402c0eb59..db7695996e7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 96b9fd0c60e..c3b726795f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Api/DefaultApi.cs index e3422a961a7..c48099bdb54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -110,12 +110,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task RootGetAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await RootGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await RootGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -126,17 +126,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task RootGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await RootGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await RootGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -152,8 +152,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterRootGet(ApiResponse apiResponse) + /// + protected virtual void AfterRootGet(ApiResponse apiResponseLocalVar) { } @@ -176,57 +176,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> RootGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnRootGet(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterRootGet(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterRootGet(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorRootGet(e, "/", uriBuilder.Path); + OnErrorRootGet(e, "/", uriBuilderLocalVar.Path); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/ClientUtils.cs index f8e5e299afa..f751f61c759 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -12,10 +12,13 @@ using System; using System.IO; using System.Linq; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -97,7 +100,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -124,9 +127,16 @@ namespace Org.OpenAPITools.Client // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs index ba2d0c137ba..c53e443828d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -71,6 +71,6 @@ namespace Org.OpenAPITools.Client /// /// public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs index 1bc64cb2496..fd867d948f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Client if (dateTimeValue == null) writer.WriteNullValue(); else - writer.WriteStringValue(dateTimeValue.Value.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Apple.cs index 61139920357..15df56a84c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Apple.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Apple(string kind) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (kind == null) - throw new ArgumentNullException("kind is a required property for Apple and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Kind = kind; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (kind == null) + throw new ArgumentNullException(nameof(kind), "Property is required for class Apple."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Apple(kind); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Banana.cs index 0d62b6d948a..350ba8a2d0d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Banana(decimal count) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (count == null) - throw new ArgumentNullException("count is a required property for Banana and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Count = count; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "count": - count = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + count = utf8JsonReader.GetDecimal(); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (count == null) + throw new ArgumentNullException(nameof(count), "Property is required for class Banana."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Banana(count); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Fruit.cs index 89bff040eaf..358fa203856 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -39,15 +39,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Apple apple, Banana banana, string color) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException("color is a required property for Fruit and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Apple = Apple; Banana = Banana; Color = color; @@ -88,12 +79,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -153,6 +145,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Fruit(apple, banana, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/.openapi-generator/FILES index af3bdedb0b6..a71e463b072 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/apis/DefaultApi.md docs/models/Apple.md diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/api/openapi.yaml new file mode 100644 index 00000000000..06fd58be740 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/api/openapi.yaml @@ -0,0 +1,41 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +servers: +- url: / +paths: + /: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/fruit' + description: desc +components: + schemas: + fruit: + example: + color: color + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + title: fruit + apple: + properties: + kind: + type: string + title: apple + type: object + banana: + properties: + count: + type: number + title: banana + type: object + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs index 82bd275c090..e0064920ad5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs index db7177c2d9e..6c54c0fb07e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs index 11402c0eb59..db7695996e7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 96b9fd0c60e..c3b726795f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Api/DefaultApi.cs index e3422a961a7..c48099bdb54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -110,12 +110,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task RootGetAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await RootGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await RootGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -126,17 +126,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task RootGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse? result = null; + ApiResponse? apiResponseLocalVar = null; try { - result = await RootGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await RootGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -152,8 +152,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterRootGet(ApiResponse apiResponse) + /// + protected virtual void AfterRootGet(ApiResponse apiResponseLocalVar) { } @@ -176,57 +176,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> RootGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnRootGet(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress!.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string? accept = ClientUtils.SelectHeaderAccept(accepts); + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = HttpMethod.Get; + httpRequestMessageLocalVar.Method = HttpMethod.Get; - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterRootGet(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterRootGet(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorRootGet(e, "/", uriBuilder.Path); + OnErrorRootGet(e, "/", uriBuilderLocalVar.Path); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/ClientUtils.cs index f8e5e299afa..f751f61c759 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -12,10 +12,13 @@ using System; using System.IO; using System.Linq; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -97,7 +100,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -124,9 +127,16 @@ namespace Org.OpenAPITools.Client // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs index ba2d0c137ba..c53e443828d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -71,6 +71,6 @@ namespace Org.OpenAPITools.Client /// /// public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs index 1bc64cb2496..fd867d948f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Client if (dateTimeValue == null) writer.WriteNullValue(); else - writer.WriteStringValue(dateTimeValue.Value.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Apple.cs index 61139920357..15df56a84c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Apple.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Apple(string kind) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (kind == null) - throw new ArgumentNullException("kind is a required property for Apple and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Kind = kind; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -133,6 +125,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (kind == null) + throw new ArgumentNullException(nameof(kind), "Property is required for class Apple."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Apple(kind); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Banana.cs index 0d62b6d948a..350ba8a2d0d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Banana(decimal count) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (count == null) - throw new ArgumentNullException("count is a required property for Banana and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Count = count; } @@ -74,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -125,7 +117,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "count": - count = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + count = utf8JsonReader.GetDecimal(); break; default: break; @@ -133,6 +126,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (count == null) + throw new ArgumentNullException(nameof(count), "Property is required for class Banana."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Banana(count); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Fruit.cs index 3b1813b31e1..d5d8417d370 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -38,15 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Apple apple, string color) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException(nameof(Color)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Apple = apple; Color = color; } @@ -59,15 +50,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Banana banana, string color) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException(nameof(Color)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Banana = banana; Color = color; } @@ -107,12 +89,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -172,6 +155,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (appleDeserialized) return new Fruit(apple, color); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES index ff892217def..35efa408b97 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/apis/AnotherFakeApi.md docs/apis/DefaultApi.md @@ -53,6 +54,7 @@ docs/models/HasOnlyReadOnly.md docs/models/HealthCheckResult.md docs/models/IsoscelesTriangle.md docs/models/List.md +docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -85,6 +87,8 @@ docs/models/ShapeOrNull.md docs/models/SimpleQuadrilateral.md docs/models/SpecialModelName.md docs/models/Tag.md +docs/models/TestCollectionEndingWithWordList.md +docs/models/TestCollectionEndingWithWordListObject.md docs/models/Triangle.md docs/models/TriangleInterface.md docs/models/User.md @@ -170,6 +174,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -202,6 +207,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md index 82d8c6cb2c7..fe3740c7b6e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md index 4e34a6d18b3..b176ed40f3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/FormatTest.md @@ -19,6 +19,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **StringProperty** | **string** | | [optional] +**UnsignedInteger** | **uint** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [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/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/LiteralStringClass.md new file mode 100644 index 00000000000..78202190965 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..5c5eb22d9a8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..cfa933cc576 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs index d79076dcd63..bfdfc0d172a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -60,5 +60,25 @@ namespace Org.OpenAPITools.Test.Api var response = await _instance.FooGetAsync(); Assert.IsType(response); } + + /// + /// Test GetCountry + /// + [Fact (Skip = "not implemented")] + public async Task GetCountryAsyncTest() + { + string country = default; + await _instance.GetCountryAsync(country); + } + + /// + /// Test Hello + /// + [Fact (Skip = "not implemented")] + public async Task HelloAsyncTest() + { + var response = await _instance.HelloAsync(); + Assert.IsType>(response); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs index 174a7e333af..94e3f6fe7fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs index c7479a3c343..03049757efe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs index 95bd1593503..92c9b0708a9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs index 8c38ac47af7..c4b0b209a91 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs index a2a9a2d49de..9b85782ecd4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs index 0610780d65d..d52d7930bb2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs index e0bd59e7732..6e10936831f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs index 8f046a0bf6b..14b87779757 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs index 53b2fe30fdb..82b117e28c2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs index df87ba3aaaa..d0dea235061 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs index 6f31ba2029b..f86e93c73ca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs index 6cb6c62ffd0..57083de2697 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs index 9798a17577b..62e066a4fc3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs index b84c7c85a7d..b2dffa3c803 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs index 3498bb0c152..a59e2faf42d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatTests.cs index 402a476d079..506c917ef4d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs index 822f8241fa0..d4f8fa6bdb1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs index d4de4c47417..d43ae8711b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs index f1b0aa1005c..4deace3c3a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs index 2e6c120d8fa..ba942072dd7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs index 3f2f96e73a1..93bb0120f1d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs index 087d38674bb..f089b42b81d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs index f98989439ed..5825715de0c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs index 85ecbfdda55..607a7db80ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs index 1e86d761507..0b64ef242be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogTests.cs index ef2eabfca31..164893d05a6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs index c38867cb5ae..81cb6fa4013 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs index ee3d000f32f..f7da9372776 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs index e2fc2d02282..8b152665a90 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs index 60e3aca92bd..8cff9853a04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs index 9ab78a59779..ccf950daf3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs index 9836a779bf0..ac711bc52d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileTests.cs index 4f0e7079bc8..6ddf36e3b3f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs index b7313941a69..3a34eb830b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooTests.cs index c0bdf85f9b0..583fec1a869 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index d3a978bdc4c..cee4ce9c80f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; @@ -176,6 +175,22 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'StringProperty' } /// + /// Test the property 'UnsignedInteger' + /// + [Fact] + public void UnsignedIntegerTest() + { + // TODO unit test for the property 'UnsignedInteger' + } + /// + /// Test the property 'UnsignedLong' + /// + [Fact] + public void UnsignedLongTest() + { + // TODO unit test for the property 'UnsignedLong' + } + /// /// Test the property 'Uuid' /// [Fact] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs index 3ef884e59c6..27433724a6a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs index 9ab6b7f2781..ca0d7778511 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs index 036c5641cf4..ae3fb07857b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs index 182cf7350b7..eee8d61e4fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs index d9a07efcf9a..b5cac232be4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs index d29edf5dd10..9a618a94825 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs index 2fed6f0b4cc..60103ce0814 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ListTests.cs index 398a4644921..859c553af6d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ListTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..7e31808e097 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs index 0889d80a708..f036aec8e7d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs index 0dc95aa6b23..975acebd3bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs index d94f882e0a2..fd9d3deca41 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; @@ -79,6 +78,14 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'Uuid' } + /// + /// Test the property 'UuidWithPattern' + /// + [Fact] + public void UuidWithPatternTest() + { + // TODO unit test for the property 'UuidWithPattern' + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs index 31f2a754314..09a24ecc6a8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs index 40b3700ce95..973df04edba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NameTests.cs index 523b3e050aa..c2024c83ac2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NameTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs index adf7c14f131..5fab915d647 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs index ed52163e5c2..5f208e16e82 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs index 734d03e5e7a..3476391608d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs index 5db923c1d3f..be8649eda4e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs index 9e9b651f818..2b962665b0c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs index 10682e72f21..7c83fb4ca0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs index 8c176d9f94c..173aa6b07c0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs index 9f6d8b52b6c..1aeee70f3d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs index e51365edb27..1fa418e64f9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs index 36e6a060f97..3225b846de0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs index b38c693d1a1..5474da73214 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs index 34cae43eac1..0d8b6863baf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PetTests.cs index 66cfbf7bdb5..4899ef39cf9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PetTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PigTests.cs index 0e85eabf160..95949c3b099 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PigTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs index 98aad34f4b4..cd8ea904c9f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs index 42243bd29c0..c846d9c5661 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs index e15b2c5c749..26c0dcaf06a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs index 7e99972f26e..8ced65980fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs index 9969564490d..919961faa02 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs index cad95d2963c..da3ee273f06 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs index 3129f3775c8..49ae5aa0208 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs index a33da20eda6..4791f74d1a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs index b2d995af504..2772e17b595 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs index 0221971c076..d6736b399b6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs index 1a5bb10af80..0efee731657 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TagTests.cs index 92a5f823659..d9390261061 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TagTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..6204d80fb4f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..4068363f13b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs index 924d6b42d7f..ad87002d06e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs index 9701da6a541..8942407fa8e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/UserTests.cs index a464c80c84c..6f96a87cdf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/UserTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs index 91a7b21f213..c1403b7f0e7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs index 08b1c6056c9..b567a8ab958 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -14,7 +14,6 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using Org.OpenAPITools.Api; using Org.OpenAPITools.Model; using Org.OpenAPITools.Client; using System.Reflection; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 06b106b96d3..8baebd4ea54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index add615bbd61..a0bc52dc911 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -136,12 +136,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -153,17 +153,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -189,9 +189,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCall123TestSpecialTags(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterCall123TestSpecialTags(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -216,70 +216,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnCall123TestSpecialTags(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/another-fake/dummy"; - request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("PATCH"); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/another-fake/dummy", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/another-fake/dummy", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCall123TestSpecialTags(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCall123TestSpecialTags(apiResponseLocalVar, modelClient); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCall123TestSpecialTags(e, "/another-fake/dummy", uriBuilder.Path, modelClient); + OnErrorCall123TestSpecialTags(e, "/another-fake/dummy", uriBuilderLocalVar.Path, modelClient); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs index beaaeb8a943..6382b3fb327 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -72,6 +72,28 @@ namespace Org.OpenAPITools.IApi /// Cancellation Token to cancel the request. /// Task of ApiResponse<object> Task GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<Guid>>> + Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<List<Guid>> + Task> HelloAsync(System.Threading.CancellationToken? cancellationToken = null); } } @@ -157,12 +179,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FooGetAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -173,17 +195,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -199,8 +221,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterFooGet(ApiResponse apiResponse) + /// + protected virtual void AfterFooGet(ApiResponse apiResponseLocalVar) { } @@ -223,57 +245,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnFooGet(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/foo"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/foo"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/foo", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/foo", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFooGet(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFooGet(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFooGet(e, "/foo", uriBuilder.Path); + OnErrorFooGet(e, "/foo", uriBuilderLocalVar.Path); throw; } } @@ -287,12 +309,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -304,17 +326,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -340,9 +362,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetCountry(ApiResponse apiResponse, string country) + protected virtual void AfterGetCountry(ApiResponse apiResponseLocalVar, string country) { } @@ -367,67 +389,176 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { country = OnGetCountry(country); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/country"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/country"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); + formParameterLocalVars.Add(new KeyValuePair("country", ClientUtils.ParameterToString(country))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/country", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/country", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetCountry(apiResponse, country); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetCountry(apiResponseLocalVar, country); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetCountry(e, "/country", uriBuilder.Path, country); + OnErrorGetCountry(e, "/country", uriBuilderLocalVar.Path, country); + throw; + } + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> + public async Task> HelloAsync(System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse> apiResponseLocalVar = await HelloWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (apiResponseLocalVar.Content == null) + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); + + return apiResponseLocalVar.Content; + } + + /// + /// Validates the request parameters + /// + /// + protected virtual void OnHello() + { + return; + } + + /// + /// Processes the server response + /// + /// + protected virtual void AfterHello(ApiResponse> apiResponseLocalVar) + { + } + + /// + /// Processes the server response + /// + /// + /// + /// + protected virtual void OnErrorHello(Exception exception, string pathFormat, string path) + { + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + OnHello(); + + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/hello"; + + + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/hello", uriBuilderLocalVar.Path)); + + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); + + if (apiResponseLocalVar.IsSuccessStatusCode) + { + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterHello(apiResponseLocalVar); + } + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorHello(e, "/hello", uriBuilderLocalVar.Path); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs index 3673e78cdb9..4c8be6afd31 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -531,12 +531,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeHealthGetAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -547,17 +547,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeHealthGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeHealthGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -573,8 +573,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterFakeHealthGet(ApiResponse apiResponse) + /// + protected virtual void AfterFakeHealthGet(ApiResponse apiResponseLocalVar) { } @@ -597,57 +597,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnFakeHealthGet(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/health"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/health", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/health", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeHealthGet(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeHealthGet(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeHealthGet(e, "/fake/health", uriBuilder.Path); + OnErrorFakeHealthGet(e, "/fake/health", uriBuilderLocalVar.Path); throw; } } @@ -661,14 +661,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterBooleanSerializeAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -684,9 +684,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterBooleanSerialize(ApiResponse apiResponse, bool? body) + protected virtual void AfterFakeOuterBooleanSerialize(ApiResponse apiResponseLocalVar, bool? body) { } @@ -711,70 +711,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { body = OnFakeOuterBooleanSerialize(body); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/boolean"; - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/boolean", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/boolean", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterBooleanSerialize(apiResponse, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterBooleanSerialize(apiResponseLocalVar, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterBooleanSerialize(e, "/fake/outer/boolean", uriBuilder.Path, body); + OnErrorFakeOuterBooleanSerialize(e, "/fake/outer/boolean", uriBuilderLocalVar.Path, body); throw; } } @@ -788,12 +788,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterCompositeSerializeAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -805,17 +805,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterCompositeSerializeOrDefaultAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -832,9 +832,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterCompositeSerialize(ApiResponse apiResponse, OuterComposite outerComposite) + protected virtual void AfterFakeOuterCompositeSerialize(ApiResponse apiResponseLocalVar, OuterComposite outerComposite) { } @@ -859,70 +859,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite outerComposite = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { outerComposite = OnFakeOuterCompositeSerialize(outerComposite); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/composite"; - request.Content = (outerComposite as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(outerComposite, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (outerComposite as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(outerComposite, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/composite", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/composite", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterCompositeSerialize(apiResponse, outerComposite); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterCompositeSerialize(apiResponseLocalVar, outerComposite); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterCompositeSerialize(e, "/fake/outer/composite", uriBuilder.Path, outerComposite); + OnErrorFakeOuterCompositeSerialize(e, "/fake/outer/composite", uriBuilderLocalVar.Path, outerComposite); throw; } } @@ -936,14 +936,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterNumberSerializeAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -959,9 +959,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFakeOuterNumberSerialize(ApiResponse apiResponse, decimal? body) + protected virtual void AfterFakeOuterNumberSerialize(ApiResponse apiResponseLocalVar, decimal? body) { } @@ -986,70 +986,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { body = OnFakeOuterNumberSerialize(body); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/number"; - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/number", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/number", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterNumberSerialize(apiResponse, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterNumberSerialize(apiResponseLocalVar, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterNumberSerialize(e, "/fake/outer/number", uriBuilder.Path, body); + OnErrorFakeOuterNumberSerialize(e, "/fake/outer/number", uriBuilderLocalVar.Path, body); throw; } } @@ -1064,14 +1064,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1097,10 +1097,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, Guid requiredStringUuid, string body) + protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponseLocalVar, Guid requiredStringUuid, string body) { } @@ -1127,78 +1127,78 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body); - requiredStringUuid = validatedParameters.Item1; - body = validatedParameters.Item2; + var validatedParameterLocalVars = OnFakeOuterStringSerialize(requiredStringUuid, body); + requiredStringUuid = validatedParameterLocalVars.Item1; + body = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString()); + parseQueryStringLocalVar["required_string_uuid"] = requiredStringUuid.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Content = (body as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (body as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "*/*" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/outer/string", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/outer/string", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFakeOuterStringSerialize(apiResponseLocalVar, requiredStringUuid, body); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body); + OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilderLocalVar.Path, requiredStringUuid, body); throw; } } @@ -1211,12 +1211,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse> apiResponseLocalVar = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1227,17 +1227,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task> GetArrayOfEnumsOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = null; + ApiResponse> apiResponseLocalVar = null; try { - result = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetArrayOfEnumsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1253,8 +1253,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterGetArrayOfEnums(ApiResponse> apiResponse) + /// + protected virtual void AfterGetArrayOfEnums(ApiResponse> apiResponseLocalVar) { } @@ -1277,57 +1277,57 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnGetArrayOfEnums(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/array-of-enums"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/array-of-enums", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/array-of-enums", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetArrayOfEnums(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetArrayOfEnums(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetArrayOfEnums(e, "/fake/array-of-enums", uriBuilder.Path); + OnErrorGetArrayOfEnums(e, "/fake/array-of-enums", uriBuilderLocalVar.Path); throw; } } @@ -1341,12 +1341,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1358,17 +1358,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithFileSchemaOrDefaultAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1394,9 +1394,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestBodyWithFileSchema(ApiResponse apiResponse, FileSchemaTestClass fileSchemaTestClass) + protected virtual void AfterTestBodyWithFileSchema(ApiResponse apiResponseLocalVar, FileSchemaTestClass fileSchemaTestClass) { } @@ -1421,61 +1421,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { fileSchemaTestClass = OnTestBodyWithFileSchema(fileSchemaTestClass); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-file-schema"; - request.Content = (fileSchemaTestClass as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (fileSchemaTestClass as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(fileSchemaTestClass, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("PUT"); + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-file-schema", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/body-with-file-schema", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestBodyWithFileSchema(apiResponse, fileSchemaTestClass); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestBodyWithFileSchema(apiResponseLocalVar, fileSchemaTestClass); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestBodyWithFileSchema(e, "/fake/body-with-file-schema", uriBuilder.Path, fileSchemaTestClass); + OnErrorTestBodyWithFileSchema(e, "/fake/body-with-file-schema", uriBuilderLocalVar.Path, fileSchemaTestClass); throw; } } @@ -1490,12 +1490,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1508,17 +1508,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestBodyWithQueryParamsWithHttpInfoAsync(user, query, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1548,10 +1548,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterTestBodyWithQueryParams(ApiResponse apiResponse, User user, string query) + protected virtual void AfterTestBodyWithQueryParams(ApiResponse apiResponseLocalVar, User user, string query) { } @@ -1578,69 +1578,69 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestBodyWithQueryParamsWithHttpInfoAsync(User user, string query, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestBodyWithQueryParams(user, query); - user = validatedParameters.Item1; - query = validatedParameters.Item2; + var validatedParameterLocalVars = OnTestBodyWithQueryParams(user, query); + user = validatedParameterLocalVars.Item1; + query = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/body-with-query-params"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["query"] = Uri.EscapeDataString(query.ToString()); + parseQueryStringLocalVar["query"] = query.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("PUT"); + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/body-with-query-params", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/body-with-query-params", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestBodyWithQueryParams(apiResponse, user, query); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestBodyWithQueryParams(apiResponseLocalVar, user, query); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestBodyWithQueryParams(e, "/fake/body-with-query-params", uriBuilder.Path, user, query); + OnErrorTestBodyWithQueryParams(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, user, query); throw; } } @@ -1654,12 +1654,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1671,17 +1671,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClientModelOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestClientModelWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1707,9 +1707,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestClientModel(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterTestClientModel(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -1734,70 +1734,70 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnTestClientModel(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("PATCH"); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestClientModel(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestClientModel(apiResponseLocalVar, modelClient); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestClientModel(e, "/fake", uriBuilder.Path, modelClient); + OnErrorTestClientModel(e, "/fake", uriBuilderLocalVar.Path, modelClient); throw; } } @@ -1824,12 +1824,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEndpointParametersAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string _string = null, string password = null, string callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1854,17 +1854,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEndpointParametersOrDefaultAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string _string = null, string password = null, string callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestEndpointParametersWithHttpInfoAsync(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1912,7 +1912,7 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// @@ -1927,7 +1927,7 @@ namespace Org.OpenAPITools.Api /// /// /// - protected virtual void AfterTestEndpointParameters(ApiResponse apiResponse, byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date, System.IO.Stream binary, float? _float, int? integer, int? int32, long? int64, string _string, string password, string callback, DateTime? dateTime) + protected virtual void AfterTestEndpointParameters(ApiResponse apiResponseLocalVar, byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date, System.IO.Stream binary, float? _float, int? integer, int? int32, long? int64, string _string, string password, string callback, DateTime? dateTime) { } @@ -1978,134 +1978,134 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestEndpointParametersWithHttpInfoAsync(byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string _string = null, string password = null, string callback = null, DateTime? dateTime = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestEndpointParameters(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); - _byte = validatedParameters.Item1; - number = validatedParameters.Item2; - _double = validatedParameters.Item3; - patternWithoutDelimiter = validatedParameters.Item4; - date = validatedParameters.Item5; - binary = validatedParameters.Item6; - _float = validatedParameters.Item7; - integer = validatedParameters.Item8; - int32 = validatedParameters.Item9; - int64 = validatedParameters.Item10; - _string = validatedParameters.Item11; - password = validatedParameters.Item12; - callback = validatedParameters.Item13; - dateTime = validatedParameters.Item14; + var validatedParameterLocalVars = OnTestEndpointParameters(_byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + _byte = validatedParameterLocalVars.Item1; + number = validatedParameterLocalVars.Item2; + _double = validatedParameterLocalVars.Item3; + patternWithoutDelimiter = validatedParameterLocalVars.Item4; + date = validatedParameterLocalVars.Item5; + binary = validatedParameterLocalVars.Item6; + _float = validatedParameterLocalVars.Item7; + integer = validatedParameterLocalVars.Item8; + int32 = validatedParameterLocalVars.Item9; + int64 = validatedParameterLocalVars.Item10; + _string = validatedParameterLocalVars.Item11; + password = validatedParameterLocalVars.Item12; + callback = validatedParameterLocalVars.Item13; + dateTime = validatedParameterLocalVars.Item14; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); + formParameterLocalVars.Add(new KeyValuePair("byte", ClientUtils.ParameterToString(_byte))); - formParams.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); + formParameterLocalVars.Add(new KeyValuePair("number", ClientUtils.ParameterToString(number))); - formParams.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); + formParameterLocalVars.Add(new KeyValuePair("double", ClientUtils.ParameterToString(_double))); - formParams.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); + formParameterLocalVars.Add(new KeyValuePair("pattern_without_delimiter", ClientUtils.ParameterToString(patternWithoutDelimiter))); if (date != null) - formParams.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); + formParameterLocalVars.Add(new KeyValuePair("date", ClientUtils.ParameterToString(date))); if (binary != null) - multipartContent.Add(new StreamContent(binary)); + multipartContentLocalVar.Add(new StreamContent(binary)); if (_float != null) - formParams.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); + formParameterLocalVars.Add(new KeyValuePair("float", ClientUtils.ParameterToString(_float))); if (integer != null) - formParams.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); + formParameterLocalVars.Add(new KeyValuePair("integer", ClientUtils.ParameterToString(integer))); if (int32 != null) - formParams.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); + formParameterLocalVars.Add(new KeyValuePair("int32", ClientUtils.ParameterToString(int32))); if (int64 != null) - formParams.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); + formParameterLocalVars.Add(new KeyValuePair("int64", ClientUtils.ParameterToString(int64))); if (_string != null) - formParams.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); + formParameterLocalVars.Add(new KeyValuePair("string", ClientUtils.ParameterToString(_string))); if (password != null) - formParams.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); + formParameterLocalVars.Add(new KeyValuePair("password", ClientUtils.ParameterToString(password))); if (callback != null) - formParams.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); + formParameterLocalVars.Add(new KeyValuePair("callback", ClientUtils.ParameterToString(callback))); if (dateTime != null) - formParams.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); + formParameterLocalVars.Add(new KeyValuePair("dateTime", ClientUtils.ParameterToString(dateTime))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + BasicToken basicTokenLocalVar = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(basicToken); + tokenBaseLocalVars.Add(basicTokenLocalVar); - basicToken.UseInHeader(request, ""); + basicTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestEndpointParameters(apiResponse, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestEndpointParameters(apiResponseLocalVar, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestEndpointParameters(e, "/fake", uriBuilder.Path, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); + OnErrorTestEndpointParameters(e, "/fake", uriBuilderLocalVar.Path, _byte, number, _double, patternWithoutDelimiter, date, binary, _float, integer, int32, int64, _string, password, callback, dateTime); throw; } } @@ -2126,12 +2126,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEnumParametersAsync(List enumHeaderStringArray = null, List enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List enumFormStringArray = null, string enumHeaderString = null, string enumQueryString = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2150,17 +2150,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestEnumParametersOrDefaultAsync(List enumHeaderStringArray = null, List enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List enumFormStringArray = null, string enumHeaderString = null, string enumQueryString = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2184,7 +2184,7 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// @@ -2193,7 +2193,7 @@ namespace Org.OpenAPITools.Api /// /// /// - protected virtual void AfterTestEnumParameters(ApiResponse apiResponse, List enumHeaderStringArray, List enumQueryStringArray, double? enumQueryDouble, int? enumQueryInteger, List enumFormStringArray, string enumHeaderString, string enumQueryString, string enumFormString) + protected virtual void AfterTestEnumParameters(ApiResponse apiResponseLocalVar, List enumHeaderStringArray, List enumQueryStringArray, double? enumQueryDouble, int? enumQueryInteger, List enumFormStringArray, string enumHeaderString, string enumQueryString, string enumFormString) { } @@ -2232,98 +2232,98 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestEnumParametersWithHttpInfoAsync(List enumHeaderStringArray = null, List enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List enumFormStringArray = null, string enumHeaderString = null, string enumQueryString = null, string enumFormString = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); - enumHeaderStringArray = validatedParameters.Item1; - enumQueryStringArray = validatedParameters.Item2; - enumQueryDouble = validatedParameters.Item3; - enumQueryInteger = validatedParameters.Item4; - enumFormStringArray = validatedParameters.Item5; - enumHeaderString = validatedParameters.Item6; - enumQueryString = validatedParameters.Item7; - enumFormString = validatedParameters.Item8; + var validatedParameterLocalVars = OnTestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + enumHeaderStringArray = validatedParameterLocalVars.Item1; + enumQueryStringArray = validatedParameterLocalVars.Item2; + enumQueryDouble = validatedParameterLocalVars.Item3; + enumQueryInteger = validatedParameterLocalVars.Item4; + enumFormStringArray = validatedParameterLocalVars.Item5; + enumHeaderString = validatedParameterLocalVars.Item6; + enumQueryString = validatedParameterLocalVars.Item7; + enumFormString = validatedParameterLocalVars.Item8; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray != null) - parseQueryString["enum_query_string_array"] = Uri.EscapeDataString(enumQueryStringArray.ToString()); + parseQueryStringLocalVar["enum_query_string_array"] = enumQueryStringArray.ToString(); if (enumQueryDouble != null) - parseQueryString["enum_query_double"] = Uri.EscapeDataString(enumQueryDouble.ToString()); + parseQueryStringLocalVar["enum_query_double"] = enumQueryDouble.ToString(); if (enumQueryInteger != null) - parseQueryString["enum_query_integer"] = Uri.EscapeDataString(enumQueryInteger.ToString()); + parseQueryStringLocalVar["enum_query_integer"] = enumQueryInteger.ToString(); if (enumQueryString != null) - parseQueryString["enum_query_string"] = Uri.EscapeDataString(enumQueryString.ToString()); + parseQueryStringLocalVar["enum_query_string"] = enumQueryString.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); if (enumHeaderStringArray != null) - request.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); + httpRequestMessageLocalVar.Headers.Add("enum_header_string_array", ClientUtils.ParameterToString(enumHeaderStringArray)); if (enumHeaderString != null) - request.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); + httpRequestMessageLocalVar.Headers.Add("enum_header_string", ClientUtils.ParameterToString(enumHeaderString)); - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (enumFormStringArray != null) - formParams.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (enumFormStringArray != null) + formParameterLocalVars.Add(new KeyValuePair("enum_form_string_array", ClientUtils.ParameterToString(enumFormStringArray))); if (enumFormString != null) - formParams.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); + formParameterLocalVars.Add(new KeyValuePair("enum_form_string", ClientUtils.ParameterToString(enumFormString))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestEnumParameters(apiResponse, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestEnumParameters(apiResponseLocalVar, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestEnumParameters(e, "/fake", uriBuilder.Path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); + OnErrorTestEnumParameters(e, "/fake", uriBuilderLocalVar.Path, enumHeaderStringArray, enumQueryStringArray, enumQueryDouble, enumQueryInteger, enumFormStringArray, enumHeaderString, enumQueryString, enumFormString); throw; } } @@ -2342,12 +2342,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2364,17 +2364,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestGroupParametersWithHttpInfoAsync(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2411,14 +2411,14 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// /// /// /// - protected virtual void AfterTestGroupParameters(ApiResponse apiResponse, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup, int? stringGroup, long? int64Group) + protected virtual void AfterTestGroupParameters(ApiResponse apiResponseLocalVar, bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup, int? stringGroup, long? int64Group) { } @@ -2453,83 +2453,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestGroupParametersWithHttpInfoAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); - requiredBooleanGroup = validatedParameters.Item1; - requiredStringGroup = validatedParameters.Item2; - requiredInt64Group = validatedParameters.Item3; - booleanGroup = validatedParameters.Item4; - stringGroup = validatedParameters.Item5; - int64Group = validatedParameters.Item6; + var validatedParameterLocalVars = OnTestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + requiredBooleanGroup = validatedParameterLocalVars.Item1; + requiredStringGroup = validatedParameterLocalVars.Item2; + requiredInt64Group = validatedParameterLocalVars.Item3; + booleanGroup = validatedParameterLocalVars.Item4; + stringGroup = validatedParameterLocalVars.Item5; + int64Group = validatedParameterLocalVars.Item6; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["required_string_group"] = Uri.EscapeDataString(requiredStringGroup.ToString()); - parseQueryString["required_int64_group"] = Uri.EscapeDataString(requiredInt64Group.ToString()); + parseQueryStringLocalVar["required_string_group"] = requiredStringGroup.ToString(); + parseQueryStringLocalVar["required_int64_group"] = requiredInt64Group.ToString(); if (stringGroup != null) - parseQueryString["string_group"] = Uri.EscapeDataString(stringGroup.ToString()); + parseQueryStringLocalVar["string_group"] = stringGroup.ToString(); if (int64Group != null) - parseQueryString["int64_group"] = Uri.EscapeDataString(int64Group.ToString()); + parseQueryStringLocalVar["int64_group"] = int64Group.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); + httpRequestMessageLocalVar.Headers.Add("required_boolean_group", ClientUtils.ParameterToString(requiredBooleanGroup)); if (booleanGroup != null) - request.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); + httpRequestMessageLocalVar.Headers.Add("boolean_group", ClientUtils.ParameterToString(booleanGroup)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + BearerToken bearerTokenLocalVar = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(bearerToken); + tokenBaseLocalVars.Add(bearerTokenLocalVar); - bearerToken.UseInHeader(request, ""); + bearerTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - request.Method = new HttpMethod("DELETE"); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestGroupParameters(apiResponse, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestGroupParameters(apiResponseLocalVar, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestGroupParameters(e, "/fake", uriBuilder.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); + OnErrorTestGroupParameters(e, "/fake", uriBuilderLocalVar.Path, requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group); throw; } } @@ -2543,12 +2543,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2560,17 +2560,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestInlineAdditionalPropertiesOrDefaultAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2596,9 +2596,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestInlineAdditionalProperties(ApiResponse apiResponse, Dictionary requestBody) + protected virtual void AfterTestInlineAdditionalProperties(ApiResponse apiResponseLocalVar, Dictionary requestBody) { } @@ -2623,61 +2623,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { requestBody = OnTestInlineAdditionalProperties(requestBody); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/inline-additionalProperties"; - request.Content = (requestBody as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (requestBody as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(requestBody, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/inline-additionalProperties", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestInlineAdditionalProperties(apiResponse, requestBody); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestInlineAdditionalProperties(apiResponseLocalVar, requestBody); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestInlineAdditionalProperties(e, "/fake/inline-additionalProperties", uriBuilder.Path, requestBody); + OnErrorTestInlineAdditionalProperties(e, "/fake/inline-additionalProperties", uriBuilderLocalVar.Path, requestBody); throw; } } @@ -2692,12 +2692,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2710,17 +2710,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestJsonFormDataOrDefaultAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2750,10 +2750,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterTestJsonFormData(ApiResponse apiResponse, string param, string param2) + protected virtual void AfterTestJsonFormData(ApiResponse apiResponseLocalVar, string param, string param2) { } @@ -2780,73 +2780,73 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestJsonFormData(param, param2); - param = validatedParameters.Item1; - param2 = validatedParameters.Item2; + var validatedParameterLocalVars = OnTestJsonFormData(param, param2); + param = validatedParameterLocalVars.Item1; + param2 = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/jsonFormData"; - MultipartContent multipartContent = new MultipartContent(); + MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); - formParams.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); + formParameterLocalVars.Add(new KeyValuePair("param", ClientUtils.ParameterToString(param))); - formParams.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); + formParameterLocalVars.Add(new KeyValuePair("param2", ClientUtils.ParameterToString(param2))); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/jsonFormData", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/jsonFormData", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestJsonFormData(apiResponse, param, param2); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestJsonFormData(apiResponseLocalVar, param, param2); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestJsonFormData(e, "/fake/jsonFormData", uriBuilder.Path, param, param2); + OnErrorTestJsonFormData(e, "/fake/jsonFormData", uriBuilderLocalVar.Path, param, param2); throw; } } @@ -2864,12 +2864,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -2885,17 +2885,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestQueryParameterCollectionFormatOrDefaultAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -2937,13 +2937,13 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// /// /// - protected virtual void AfterTestQueryParameterCollectionFormat(ApiResponse apiResponse, List pipe, List ioutil, List http, List url, List context) + protected virtual void AfterTestQueryParameterCollectionFormat(ApiResponse apiResponseLocalVar, List pipe, List ioutil, List http, List url, List context) { } @@ -2976,63 +2976,63 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - pipe = validatedParameters.Item1; - ioutil = validatedParameters.Item2; - http = validatedParameters.Item3; - url = validatedParameters.Item4; - context = validatedParameters.Item5; + var validatedParameterLocalVars = OnTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + pipe = validatedParameterLocalVars.Item1; + ioutil = validatedParameterLocalVars.Item2; + http = validatedParameterLocalVars.Item3; + url = validatedParameterLocalVars.Item4; + context = validatedParameterLocalVars.Item5; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/test-query-parameters"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["pipe"] = Uri.EscapeDataString(pipe.ToString()); - parseQueryString["ioutil"] = Uri.EscapeDataString(ioutil.ToString()); - parseQueryString["http"] = Uri.EscapeDataString(http.ToString()); - parseQueryString["url"] = Uri.EscapeDataString(url.ToString()); - parseQueryString["context"] = Uri.EscapeDataString(context.ToString()); + parseQueryStringLocalVar["pipe"] = pipe.ToString(); + parseQueryStringLocalVar["ioutil"] = ioutil.ToString(); + parseQueryStringLocalVar["http"] = http.ToString(); + parseQueryStringLocalVar["url"] = url.ToString(); + parseQueryStringLocalVar["context"] = context.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = new HttpMethod("PUT"); + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/test-query-parameters", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/test-query-parameters", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestQueryParameterCollectionFormat(apiResponse, pipe, ioutil, http, url, context); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestQueryParameterCollectionFormat(apiResponseLocalVar, pipe, ioutil, http, url, context); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestQueryParameterCollectionFormat(e, "/fake/test-query-parameters", uriBuilder.Path, pipe, ioutil, http, url, context); + OnErrorTestQueryParameterCollectionFormat(e, "/fake/test-query-parameters", uriBuilderLocalVar.Path, pipe, ioutil, http, url, context); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index cced05336fb..a3ef181e5dc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -136,12 +136,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -153,17 +153,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -189,9 +189,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterTestClassname(ApiResponse apiResponse, ModelClient modelClient) + protected virtual void AfterTestClassname(ApiResponse apiResponseLocalVar, ModelClient modelClient) { } @@ -216,83 +216,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { modelClient = OnTestClassname(modelClient); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake_classname_test"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); request.Content = (modelClient as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); httpRequestMessageLocalVar.Content = (modelClient as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(modelClient, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInQuery(request, uriBuilder, parseQueryString, "api_key_query"); + apiKeyTokenLocalVar.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query"); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("PATCH"); + httpRequestMessageLocalVar.Method = new HttpMethod("PATCH"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake_classname_test", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake_classname_test", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterTestClassname(apiResponse, modelClient); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterTestClassname(apiResponseLocalVar, modelClient); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorTestClassname(e, "/fake_classname_test", uriBuilder.Path, modelClient); + OnErrorTestClassname(e, "/fake_classname_test", uriBuilderLocalVar.Path, modelClient); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs index ef93a735adb..cd0b005f8bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs @@ -342,12 +342,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task AddPetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -359,17 +359,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task AddPetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await AddPetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -395,9 +395,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterAddPet(ApiResponse apiResponse, Pet pet) + protected virtual void AfterAddPet(ApiResponse apiResponseLocalVar, Pet pet) { } @@ -422,84 +422,84 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { pet = OnAddPet(pet); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - var url = request.RequestUri = new Uri("http://petstore.swagger.io/v2"); - uriBuilder.Host = url.Authority; - uriBuilder.Scheme = url.Scheme; - uriBuilder.Path = url.AbsolutePath; + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; - request.Content = (pet as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content.ReadAsStringAsync().ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); string[] contentTypes = new string[] { "application/json", "application/xml" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterAddPet(apiResponse, pet); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterAddPet(apiResponseLocalVar, pet); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorAddPet(e, "/pet", uriBuilder.Path, pet); + OnErrorAddPet(e, "/pet", uriBuilderLocalVar.Path, pet); throw; } } @@ -514,12 +514,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeletePetAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -532,17 +532,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeletePetOrDefaultAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -569,10 +569,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterDeletePet(ApiResponse apiResponse, long petId, string apiKey) + protected virtual void AfterDeletePet(ApiResponse apiResponseLocalVar, long petId, string apiKey) { } @@ -599,64 +599,64 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeletePetWithHttpInfoAsync(long petId, string apiKey = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnDeletePet(petId, apiKey); - petId = validatedParameters.Item1; - apiKey = validatedParameters.Item2; + var validatedParameterLocalVars = OnDeletePet(petId, apiKey); + petId = validatedParameterLocalVars.Item1; + apiKey = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); if (apiKey != null) - request.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); if (apiKey != null) + httpRequestMessageLocalVar.Headers.Add("api_key", ClientUtils.ParameterToString(apiKey)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - request.Method = new HttpMethod("DELETE"); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeletePet(apiResponse, petId, apiKey); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeletePet(apiResponseLocalVar, petId, apiKey); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeletePet(e, "/pet/{petId}", uriBuilder.Path, petId, apiKey); + OnErrorDeletePet(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, apiKey); throw; } } @@ -670,12 +670,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + ApiResponse> apiResponseLocalVar = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -687,17 +687,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByStatusOrDefaultAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = null; + ApiResponse> apiResponseLocalVar = null; try { - result = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FindPetsByStatusWithHttpInfoAsync(status, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -723,9 +723,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFindPetsByStatus(ApiResponse> apiResponse, List status) + protected virtual void AfterFindPetsByStatus(ApiResponse> apiResponseLocalVar, List status) { } @@ -750,86 +750,86 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { status = OnFindPetsByStatus(status); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByStatus"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["status"] = Uri.EscapeDataString(status.ToString()); + parseQueryStringLocalVar["status"] = status.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content.ReadAsStringAsync().ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByStatus", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/findByStatus", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterFindPetsByStatus(apiResponse, status); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFindPetsByStatus(apiResponseLocalVar, status); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFindPetsByStatus(e, "/pet/findByStatus", uriBuilder.Path, status); + OnErrorFindPetsByStatus(e, "/pet/findByStatus", uriBuilderLocalVar.Path, status); throw; } } @@ -843,12 +843,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + ApiResponse> apiResponseLocalVar = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -860,17 +860,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task> FindPetsByTagsOrDefaultAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = null; + ApiResponse> apiResponseLocalVar = null; try { - result = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -896,9 +896,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterFindPetsByTags(ApiResponse> apiResponse, List tags) + protected virtual void AfterFindPetsByTags(ApiResponse> apiResponseLocalVar, List tags) { } @@ -923,86 +923,86 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { tags = OnFindPetsByTags(tags); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/findByTags"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["tags"] = Uri.EscapeDataString(tags.ToString()); + parseQueryStringLocalVar["tags"] = tags.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content.ReadAsStringAsync().ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/findByTags", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/findByTags", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterFindPetsByTags(apiResponse, tags); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterFindPetsByTags(apiResponseLocalVar, tags); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorFindPetsByTags(e, "/pet/findByTags", uriBuilder.Path, tags); + OnErrorFindPetsByTags(e, "/pet/findByTags", uriBuilderLocalVar.Path, tags); throw; } } @@ -1016,12 +1016,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetPetByIdAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1033,17 +1033,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetPetByIdOrDefaultAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetPetByIdWithHttpInfoAsync(petId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1069,9 +1069,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetPetById(ApiResponse apiResponse, long petId) + protected virtual void AfterGetPetById(ApiResponse apiResponseLocalVar, long petId) { } @@ -1096,67 +1096,67 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { petId = OnGetPetById(petId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); List tokens = new List(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInHeader(request, "api_key"); + apiKeyTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "api_key"); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetPetById(apiResponse, petId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetPetById(apiResponseLocalVar, petId); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetPetById(e, "/pet/{petId}", uriBuilder.Path, petId); + OnErrorGetPetById(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId); throw; } } @@ -1170,12 +1170,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1187,17 +1187,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetOrDefaultAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdatePetWithHttpInfoAsync(pet, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1223,9 +1223,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterUpdatePet(ApiResponse apiResponse, Pet pet) + protected virtual void AfterUpdatePet(ApiResponse apiResponseLocalVar, Pet pet) { } @@ -1250,84 +1250,84 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { pet = OnUpdatePet(pet); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - var url = request.RequestUri = new Uri("http://petstore.swagger.io/v2"); - uriBuilder.Host = url.Authority; - uriBuilder.Scheme = url.Scheme; - uriBuilder.Path = url.AbsolutePath; + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("http://petstore.swagger.io/v2"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; - request.Content = (pet as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (pet as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(pet, _jsonSerializerOptions)); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + HttpSignatureToken httpSignatureTokenLocalVar = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(signatureToken); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar); - string requestBody = await request.Content.ReadAsStringAsync().ConfigureAwait(false); + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - signatureToken.UseInHeader(request, requestBody, cancellationToken); + httpSignatureTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); string[] contentTypes = new string[] { "application/json", "application/xml" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("PUT"); + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdatePet(apiResponse, pet); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdatePet(apiResponseLocalVar, pet); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdatePet(e, "/pet", uriBuilder.Path, pet); + OnErrorUpdatePet(e, "/pet", uriBuilderLocalVar.Path, pet); throw; } } @@ -1343,12 +1343,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetWithFormAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1362,17 +1362,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdatePetWithFormOrDefaultAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1400,11 +1400,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUpdatePetWithForm(ApiResponse apiResponse, long petId, string name, string status) + protected virtual void AfterUpdatePetWithForm(ApiResponse apiResponseLocalVar, long petId, string name, string status) { } @@ -1433,83 +1433,83 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string name = null, string status = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUpdatePetWithForm(petId, name, status); - petId = validatedParameters.Item1; - name = validatedParameters.Item2; - status = validatedParameters.Item3; + var validatedParameterLocalVars = OnUpdatePetWithForm(petId, name, status); + petId = validatedParameterLocalVars.Item1; + name = validatedParameterLocalVars.Item2; + status = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (name != null) - formParams.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (name != null) + formParameterLocalVars.Add(new KeyValuePair("name", ClientUtils.ParameterToString(name))); if (status != null) - formParams.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); + formParameterLocalVars.Add(new KeyValuePair("status", ClientUtils.ParameterToString(status))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "application/x-www-form-urlencoded" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdatePetWithForm(apiResponse, petId, name, status); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdatePetWithForm(apiResponseLocalVar, petId, name, status); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdatePetWithForm(e, "/pet/{petId}", uriBuilder.Path, petId, name, status); + OnErrorUpdatePetWithForm(e, "/pet/{petId}", uriBuilderLocalVar.Path, petId, name, status); throw; } } @@ -1525,12 +1525,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileAsync(long petId, System.IO.Stream file = null, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1544,17 +1544,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileOrDefaultAsync(long petId, System.IO.Stream file = null, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UploadFileWithHttpInfoAsync(petId, file, additionalMetadata, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1582,11 +1582,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUploadFile(ApiResponse apiResponse, long petId, System.IO.Stream file, string additionalMetadata) + protected virtual void AfterUploadFile(ApiResponse apiResponseLocalVar, long petId, System.IO.Stream file, string additionalMetadata) { } @@ -1615,92 +1615,92 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UploadFileWithHttpInfoAsync(long petId, System.IO.Stream file = null, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUploadFile(petId, file, additionalMetadata); - petId = validatedParameters.Item1; - file = validatedParameters.Item2; - additionalMetadata = validatedParameters.Item3; + var validatedParameterLocalVars = OnUploadFile(petId, file, additionalMetadata); + petId = validatedParameterLocalVars.Item1; + file = validatedParameterLocalVars.Item2; + additionalMetadata = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/pet/{petId}/uploadImage"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); if (file != null) - multipartContent.Add(new StreamContent(file)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); if (file != null) + multipartContentLocalVar.Add(new StreamContent(file)); if (additionalMetadata != null) - formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "multipart/form-data" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/pet/{petId}/uploadImage", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUploadFile(apiResponse, petId, file, additionalMetadata); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUploadFile(apiResponseLocalVar, petId, file, additionalMetadata); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUploadFile(e, "/pet/{petId}/uploadImage", uriBuilder.Path, petId, file, additionalMetadata); + OnErrorUploadFile(e, "/pet/{petId}/uploadImage", uriBuilderLocalVar.Path, petId, file, additionalMetadata); throw; } } @@ -1716,12 +1716,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileWithRequiredFileAsync(System.IO.Stream requiredFile, long petId, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1735,17 +1735,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UploadFileWithRequiredFileOrDefaultAsync(System.IO.Stream requiredFile, long petId, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UploadFileWithRequiredFileWithHttpInfoAsync(requiredFile, petId, additionalMetadata, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1776,11 +1776,11 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// /// - protected virtual void AfterUploadFileWithRequiredFile(ApiResponse apiResponse, System.IO.Stream requiredFile, long petId, string additionalMetadata) + protected virtual void AfterUploadFileWithRequiredFile(ApiResponse apiResponseLocalVar, System.IO.Stream requiredFile, long petId, string additionalMetadata) { } @@ -1809,92 +1809,92 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UploadFileWithRequiredFileWithHttpInfoAsync(System.IO.Stream requiredFile, long petId, string additionalMetadata = null, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); - requiredFile = validatedParameters.Item1; - petId = validatedParameters.Item2; - additionalMetadata = validatedParameters.Item3; + var validatedParameterLocalVars = OnUploadFileWithRequiredFile(requiredFile, petId, additionalMetadata); + requiredFile = validatedParameterLocalVars.Item1; + petId = validatedParameterLocalVars.Item2; + additionalMetadata = validatedParameterLocalVars.Item3; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/fake/{petId}/uploadImageWithRequiredFile"; - uriBuilder.Path = uriBuilder.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContent = new MultipartContent(); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7BpetId%7D", Uri.EscapeDataString(petId.ToString())); MultipartContent multipartContentLocalVar = new MultipartContent(); - request.Content = multipartContent; + httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParams = new List>(); + List> formParameterLocalVars = new List>(); - multipartContent.Add(new FormUrlEncodedContent(formParams)); multipartContent.Add(new StreamContent(requiredFile)); + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars)); multipartContentLocalVar.Add(new StreamContent(requiredFile)); if (additionalMetadata != null) - formParams.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); + formParameterLocalVars.Add(new KeyValuePair("additionalMetadata", ClientUtils.ParameterToString(additionalMetadata))); - List tokens = new List(); + List tokenBaseLocalVars = new List(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + OAuthToken oauthTokenLocalVar = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(oauthToken); + tokenBaseLocalVars.Add(oauthTokenLocalVar); - oauthToken.UseInHeader(request, ""); + oauthTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, ""); string[] contentTypes = new string[] { "multipart/form-data" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUploadFileWithRequiredFile(apiResponse, requiredFile, petId, additionalMetadata); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUploadFileWithRequiredFile(apiResponseLocalVar, requiredFile, petId, additionalMetadata); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUploadFileWithRequiredFile(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilder.Path, requiredFile, petId, additionalMetadata); + OnErrorUploadFileWithRequiredFile(e, "/fake/{petId}/uploadImageWithRequiredFile", uriBuilderLocalVar.Path, requiredFile, petId, additionalMetadata); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/StoreApi.cs index 9d1b7480e80..bc1fe0d6538 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/StoreApi.cs @@ -206,12 +206,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -223,17 +223,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -259,9 +259,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterDeleteOrder(ApiResponse apiResponse, string orderId) + protected virtual void AfterDeleteOrder(ApiResponse apiResponseLocalVar, string orderId) { } @@ -286,48 +286,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { orderId = OnDeleteOrder(orderId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = new HttpMethod("DELETE"); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order/{order_id}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeleteOrder(apiResponse, orderId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeleteOrder(apiResponseLocalVar, orderId); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeleteOrder(e, "/store/order/{order_id}", uriBuilder.Path, orderId); + OnErrorDeleteOrder(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); throw; } } @@ -340,14 +340,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse> result = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse> apiResponseLocalVar = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -362,8 +362,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterGetInventory(ApiResponse> apiResponse) + /// + protected virtual void AfterGetInventory(ApiResponse> apiResponseLocalVar) { } @@ -386,66 +386,66 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnGetInventory(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory"; - List tokens = new List(); + List tokenBaseLocalVars = new List(); - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + ApiKeyToken apiKeyTokenLocalVar = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - tokens.Add(apiKey); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar); - apiKey.UseInHeader(request, "api_key"); + apiKeyTokenLocalVar.UseInHeader(httpRequestMessageLocalVar, "api_key"); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/inventory", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/inventory", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse> apiResponse = new ApiResponse>(responseMessage, responseContent); + ApiResponse> apiResponseLocalVar = new ApiResponse>(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize>(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetInventory(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize>(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetInventory(apiResponseLocalVar); } - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit(); + else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetInventory(e, "/store/inventory", uriBuilder.Path); + OnErrorGetInventory(e, "/store/inventory", uriBuilderLocalVar.Path); throw; } } @@ -459,12 +459,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -476,17 +476,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -512,9 +512,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetOrderById(ApiResponse apiResponse, long orderId) + protected virtual void AfterGetOrderById(ApiResponse apiResponseLocalVar, long orderId) { } @@ -539,58 +539,58 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { orderId = OnGetOrderById(orderId); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order/{order_id}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Border_id%7D", Uri.EscapeDataString(orderId.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order/{order_id}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order/{order_id}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetOrderById(apiResponse, orderId); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetOrderById(apiResponseLocalVar, orderId); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetOrderById(e, "/store/order/{order_id}", uriBuilder.Path, orderId); + OnErrorGetOrderById(e, "/store/order/{order_id}", uriBuilderLocalVar.Path, orderId); throw; } } @@ -604,12 +604,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -621,17 +621,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -657,9 +657,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterPlaceOrder(ApiResponse apiResponse, Order order) + protected virtual void AfterPlaceOrder(ApiResponse apiResponseLocalVar, Order order) { } @@ -684,71 +684,71 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { order = OnPlaceOrder(order); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/store/order"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/order"; - request.Content = (order as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (order as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(order, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/store/order", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/store/order", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterPlaceOrder(apiResponse, order); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterPlaceOrder(apiResponseLocalVar, order); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorPlaceOrder(e, "/store/order", uriBuilder.Path, order); + OnErrorPlaceOrder(e, "/store/order", uriBuilderLocalVar.Path, order); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs index 306be612b3d..4c6d12518f0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs @@ -306,12 +306,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -323,17 +323,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -359,9 +359,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUser(ApiResponse apiResponse, User user) + protected virtual void AfterCreateUser(ApiResponse apiResponseLocalVar, User user) { } @@ -386,61 +386,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUser(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUser(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUser(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUser(e, "/user", uriBuilder.Path, user); + OnErrorCreateUser(e, "/user", uriBuilderLocalVar.Path, user); throw; } } @@ -454,12 +454,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -471,17 +471,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithArrayInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -507,9 +507,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUsersWithArrayInput(ApiResponse apiResponse, List user) + protected virtual void AfterCreateUsersWithArrayInput(ApiResponse apiResponseLocalVar, List user) { } @@ -534,61 +534,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUsersWithArrayInput(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithArray"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithArray", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/createWithArray", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUsersWithArrayInput(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUsersWithArrayInput(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUsersWithArrayInput(e, "/user/createWithArray", uriBuilder.Path, user); + OnErrorCreateUsersWithArrayInput(e, "/user/createWithArray", uriBuilderLocalVar.Path, user); throw; } } @@ -602,12 +602,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -619,17 +619,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task CreateUsersWithListInputOrDefaultAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -655,9 +655,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterCreateUsersWithListInput(ApiResponse apiResponse, List user) + protected virtual void AfterCreateUsersWithListInput(ApiResponse apiResponseLocalVar, List user) { } @@ -682,61 +682,61 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { user = OnCreateUsersWithListInput(user); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/createWithList"; - request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("POST"); + httpRequestMessageLocalVar.Method = new HttpMethod("POST"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/createWithList", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/createWithList", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterCreateUsersWithListInput(apiResponse, user); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterCreateUsersWithListInput(apiResponseLocalVar, user); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorCreateUsersWithListInput(e, "/user/createWithList", uriBuilder.Path, user); + OnErrorCreateUsersWithListInput(e, "/user/createWithList", uriBuilderLocalVar.Path, user); throw; } } @@ -750,12 +750,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -767,17 +767,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -803,9 +803,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterDeleteUser(ApiResponse apiResponse, string username) + protected virtual void AfterDeleteUser(ApiResponse apiResponseLocalVar, string username) { } @@ -830,48 +830,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { username = OnDeleteUser(username); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = new HttpMethod("DELETE"); + httpRequestMessageLocalVar.Method = new HttpMethod("DELETE"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterDeleteUser(apiResponse, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterDeleteUser(apiResponseLocalVar, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorDeleteUser(e, "/user/{username}", uriBuilder.Path, username); + OnErrorDeleteUser(e, "/user/{username}", uriBuilderLocalVar.Path, username); throw; } } @@ -885,12 +885,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -902,17 +902,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -938,9 +938,9 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// - protected virtual void AfterGetUserByName(ApiResponse apiResponse, string username) + protected virtual void AfterGetUserByName(ApiResponse apiResponseLocalVar, string username) { } @@ -965,58 +965,58 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { username = OnGetUserByName(username); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterGetUserByName(apiResponse, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterGetUserByName(apiResponseLocalVar, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorGetUserByName(e, "/user/{username}", uriBuilder.Path, username); + OnErrorGetUserByName(e, "/user/{username}", uriBuilderLocalVar.Path, username); throw; } } @@ -1031,14 +1031,14 @@ namespace Org.OpenAPITools.Api /// <> public async Task LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (result.Content == null) + if (apiResponseLocalVar.Content == null) #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1067,10 +1067,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterLoginUser(ApiResponse apiResponse, string username, string password) + protected virtual void AfterLoginUser(ApiResponse apiResponseLocalVar, string username, string password) { } @@ -1097,67 +1097,67 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnLoginUser(username, password); - username = validatedParameters.Item1; - password = validatedParameters.Item2; + var validatedParameterLocalVars = OnLoginUser(username, password); + username = validatedParameterLocalVars.Item1; + password = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/login"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/login"; - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); - parseQueryString["username"] = Uri.EscapeDataString(username.ToString()); - parseQueryString["password"] = Uri.EscapeDataString(password.ToString()); + parseQueryStringLocalVar["username"] = username.ToString(); + parseQueryStringLocalVar["password"] = password.ToString(); - uriBuilder.Query = parseQueryString.ToString(); + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - string[] accepts = new string[] { + string[] acceptLocalVars = new string[] { "application/xml", "application/json" }; - string accept = ClientUtils.SelectHeaderAccept(accepts); + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/login", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/login", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterLoginUser(apiResponse, username, password); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterLoginUser(apiResponseLocalVar, username, password); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorLoginUser(e, "/user/login", uriBuilder.Path, username, password); + OnErrorLoginUser(e, "/user/login", uriBuilderLocalVar.Path, username, password); throw; } } @@ -1170,12 +1170,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1186,17 +1186,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1212,8 +1212,8 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// - protected virtual void AfterLogoutUser(ApiResponse apiResponse) + /// + protected virtual void AfterLogoutUser(ApiResponse apiResponseLocalVar) { } @@ -1236,48 +1236,48 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { OnLogoutUser(); - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/logout"; - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; - request.Method = new HttpMethod("GET"); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/logout", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/logout", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterLogoutUser(apiResponse); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterLogoutUser(apiResponseLocalVar); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorLogoutUser(e, "/user/logout", uriBuilder.Path); + OnErrorLogoutUser(e, "/user/logout", uriBuilderLocalVar.Path); throw; } } @@ -1292,12 +1292,12 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdateUserAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); + ApiResponse apiResponseLocalVar = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); - if (result.Content == null) - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + if (apiResponseLocalVar.Content == null) + throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent); - return result.Content; + return apiResponseLocalVar.Content; } /// @@ -1310,17 +1310,17 @@ namespace Org.OpenAPITools.Api /// <> public async Task UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = null; + ApiResponse apiResponseLocalVar = null; try { - result = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); + apiResponseLocalVar = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false); } catch (Exception) { } - return result != null && result.IsSuccessStatusCode - ? result.Content + return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode + ? apiResponseLocalVar.Content : null; } @@ -1350,10 +1350,10 @@ namespace Org.OpenAPITools.Api /// /// Processes the server response /// - /// + /// /// /// - protected virtual void AfterUpdateUser(ApiResponse apiResponse, User user, string username) + protected virtual void AfterUpdateUser(ApiResponse apiResponseLocalVar, User user, string username) { } @@ -1380,63 +1380,63 @@ namespace Org.OpenAPITools.Api /// <> where T : public async Task> UpdateUserWithHttpInfoAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null) { - UriBuilder uriBuilder = new UriBuilder(); + UriBuilder uriBuilderLocalVar = new UriBuilder(); try { - var validatedParameters = OnUpdateUser(user, username); - user = validatedParameters.Item1; - username = validatedParameters.Item2; + var validatedParameterLocalVars = OnUpdateUser(user, username); + user = validatedParameterLocalVars.Item1; + username = validatedParameterLocalVars.Item2; - using (HttpRequestMessage request = new HttpRequestMessage()) + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - uriBuilder.Host = HttpClient.BaseAddress.Host; - uriBuilder.Port = HttpClient.BaseAddress.Port; - uriBuilder.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/user/{username}"; - uriBuilder.Path = uriBuilder.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); request.Content = (user as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7Busername%7D", Uri.EscapeDataString(username.ToString())); httpRequestMessageLocalVar.Content = (user as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize(user, _jsonSerializerOptions)); - request.RequestUri = uriBuilder.Uri; + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; string[] contentTypes = new string[] { "application/json" }; - string contentType = ClientUtils.SelectHeaderContentType(contentTypes); + string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); - if (contentType != null) - request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); + if (contentTypeLocalVar != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); - request.Method = new HttpMethod("PUT"); + httpRequestMessageLocalVar.Method = new HttpMethod("PUT"); - DateTime requestedAt = DateTime.UtcNow; + DateTime requestedAtLocalVar = DateTime.UtcNow; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) { - OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/user/{username}", uriBuilder.Path)); + OnApiResponded(new ApiResponseEventArgs(requestedAtLocalVar, DateTime.UtcNow, httpResponseMessageLocalVar.StatusCode, "/user/{username}", uriBuilderLocalVar.Path)); - string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false); + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); - ApiResponse apiResponse = new ApiResponse(responseMessage, responseContent); + ApiResponse apiResponseLocalVar = new ApiResponse(httpResponseMessageLocalVar, responseContentLocalVar); - if (apiResponse.IsSuccessStatusCode) + if (apiResponseLocalVar.IsSuccessStatusCode) { - apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterUpdateUser(apiResponse, user, username); + apiResponseLocalVar.Content = JsonSerializer.Deserialize(apiResponseLocalVar.RawContent, _jsonSerializerOptions); + AfterUpdateUser(apiResponseLocalVar, user, username); } - return apiResponse; + return apiResponseLocalVar; } } } catch(Exception e) { - OnErrorUpdateUser(e, "/user/{username}", uriBuilder.Path, user, username); + OnErrorUpdateUser(e, "/user/{username}", uriBuilderLocalVar.Path, user, username); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ClientUtils.cs index a6ecdf11c02..0ad137a0707 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,10 +10,13 @@ using System; using System.IO; using System.Linq; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; +using Org.OpenAPITools.Model; namespace Org.OpenAPITools.Client { @@ -95,7 +98,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -122,9 +125,50 @@ namespace Org.OpenAPITools.Client // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + if (obj is ChildCatAllOf.PetTypeEnum childCatAllOfPetTypeEnum) + return ChildCatAllOf.PetTypeEnumToJsonValue(childCatAllOfPetTypeEnum); + if (obj is EnumArrays.ArrayEnumEnum enumArraysArrayEnumEnum) + return EnumArrays.ArrayEnumEnumToJsonValue(enumArraysArrayEnumEnum); + if (obj is EnumArrays.JustSymbolEnum enumArraysJustSymbolEnum) + return EnumArrays.JustSymbolEnumToJsonValue(enumArraysJustSymbolEnum); + if (obj is EnumClass enumClass) + return EnumClassConverter.ToJsonValue(enumClass); + if (obj is EnumTest.EnumIntegerEnum enumTestEnumIntegerEnum) + return EnumTest.EnumIntegerEnumToJsonValue(enumTestEnumIntegerEnum).ToString(); + if (obj is EnumTest.EnumIntegerOnlyEnum enumTestEnumIntegerOnlyEnum) + return EnumTest.EnumIntegerOnlyEnumToJsonValue(enumTestEnumIntegerOnlyEnum).ToString(); + if (obj is EnumTest.EnumNumberEnum enumTestEnumNumberEnum) + return EnumTest.EnumNumberEnumToJsonValue(enumTestEnumNumberEnum).ToString(); + if (obj is EnumTest.EnumStringEnum enumTestEnumStringEnum) + return EnumTest.EnumStringEnumToJsonValue(enumTestEnumStringEnum); + if (obj is EnumTest.EnumStringRequiredEnum enumTestEnumStringRequiredEnum) + return EnumTest.EnumStringRequiredEnumToJsonValue(enumTestEnumStringRequiredEnum); + if (obj is MapTest.InnerEnum mapTestInnerEnum) + return MapTest.InnerEnumToJsonValue(mapTestInnerEnum); + if (obj is Order.StatusEnum orderStatusEnum) + return Order.StatusEnumToJsonValue(orderStatusEnum); + if (obj is OuterEnum outerEnum) + return OuterEnumConverter.ToJsonValue(outerEnum); + if (obj is OuterEnumDefaultValue outerEnumDefaultValue) + return OuterEnumDefaultValueConverter.ToJsonValue(outerEnumDefaultValue); + if (obj is OuterEnumInteger outerEnumInteger) + return OuterEnumIntegerConverter.ToJsonValue(outerEnumInteger).ToString(); + if (obj is OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) + return OuterEnumIntegerDefaultValueConverter.ToJsonValue(outerEnumIntegerDefaultValue).ToString(); + if (obj is Pet.StatusEnum petStatusEnum) + return Pet.StatusEnumToJsonValue(petStatusEnum); + if (obj is Zebra.TypeEnum zebraTypeEnum) + return Zebra.TypeEnumToJsonValue(zebraTypeEnum); + if (obj is ICollection collection) + { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs index 6222464831d..e8291cb2e1e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/DateTimeJsonConverter.cs @@ -71,6 +71,6 @@ namespace Org.OpenAPITools.Client /// /// public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs index 4e53bbe9557..e26c40071cd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/DateTimeNullableJsonConverter.cs @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Client if (dateTimeValue == null) writer.WriteNullValue(); else - writer.WriteStringValue(dateTimeValue.Value.ToString(Formats[0], CultureInfo.InvariantCulture)); + writer.WriteStringValue(dateTimeValue.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", CultureInfo.InvariantCulture)); } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs index ad15d6f98cb..e5399ebe850 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -90,6 +90,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new HealthCheckResultJsonConverter()); _jsonOptions.Converters.Add(new IsoscelesTriangleJsonConverter()); _jsonOptions.Converters.Add(new ListJsonConverter()); + _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); @@ -126,6 +127,8 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new SimpleQuadrilateralJsonConverter()); _jsonOptions.Converters.Add(new SpecialModelNameJsonConverter()); _jsonOptions.Converters.Add(new TagJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListJsonConverter()); + _jsonOptions.Converters.Add(new TestCollectionEndingWithWordListObjectJsonConverter()); _jsonOptions.Converters.Add(new TriangleJsonConverter()); _jsonOptions.Converters.Add(new TriangleInterfaceJsonConverter()); _jsonOptions.Converters.Add(new UserJsonConverter()); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Activity.cs index e58d07d5482..33362f78e17 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Activity.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Activity(Dictionary> activityOutputs) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (activityOutputs == null) - throw new ArgumentNullException("activityOutputs is a required property for Activity and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ActivityOutputs = activityOutputs; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "activity_outputs": - activityOutputs = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + activityOutputs = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (activityOutputs == null) + throw new ArgumentNullException(nameof(activityOutputs), "Property is required for class Activity."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Activity(activityOutputs); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 6de49983524..345e7af1c8b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ActivityOutputElementRepresentation(string prop1, Object prop2) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (prop1 == null) - throw new ArgumentNullException("prop1 is a required property for ActivityOutputElementRepresentation and cannot be null."); - - if (prop2 == null) - throw new ArgumentNullException("prop2 is a required property for ActivityOutputElementRepresentation and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Prop1 = prop1; Prop2 = prop2; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -139,7 +128,8 @@ namespace Org.OpenAPITools.Model prop1 = utf8JsonReader.GetString(); break; case "prop2": - prop2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + prop2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (prop1 == null) + throw new ArgumentNullException(nameof(prop1), "Property is required for class ActivityOutputElementRepresentation."); + + if (prop2 == null) + throw new ArgumentNullException(nameof(prop2), "Property is required for class ActivityOutputElementRepresentation."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ActivityOutputElementRepresentation(prop1, prop2); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 23560a4f3d6..81aa51108de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -42,33 +42,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public AdditionalPropertiesClass(Object emptyMap, Dictionary> mapOfMapProperty, Dictionary mapProperty, Object mapWithUndeclaredPropertiesAnytype1, Object mapWithUndeclaredPropertiesAnytype2, Dictionary mapWithUndeclaredPropertiesAnytype3, Dictionary mapWithUndeclaredPropertiesString, Object anytype1 = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mapProperty == null) - throw new ArgumentNullException("mapProperty is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapOfMapProperty == null) - throw new ArgumentNullException("mapOfMapProperty is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype1 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype1 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype2 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype2 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesAnytype3 == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesAnytype3 is a required property for AdditionalPropertiesClass and cannot be null."); - - if (emptyMap == null) - throw new ArgumentNullException("emptyMap is a required property for AdditionalPropertiesClass and cannot be null."); - - if (mapWithUndeclaredPropertiesString == null) - throw new ArgumentNullException("mapWithUndeclaredPropertiesString is a required property for AdditionalPropertiesClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EmptyMap = emptyMap; MapOfMapProperty = mapOfMapProperty; MapProperty = mapProperty; @@ -154,12 +127,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -212,28 +186,36 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "empty_map": - emptyMap = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + emptyMap = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_of_map_property": - mapOfMapProperty = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfMapProperty = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_property": - mapProperty = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapProperty = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_1": - mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_2": - mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_anytype_3": - mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_with_undeclared_properties_string": - mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "anytype_1": - anytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anytype1 = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -241,6 +223,33 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mapProperty == null) + throw new ArgumentNullException(nameof(mapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (mapOfMapProperty == null) + throw new ArgumentNullException(nameof(mapOfMapProperty), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype1 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype1), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype2 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype2), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesAnytype3 == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesAnytype3), "Property is required for class AdditionalPropertiesClass."); + + if (emptyMap == null) + throw new ArgumentNullException(nameof(emptyMap), "Property is required for class AdditionalPropertiesClass."); + + if (mapWithUndeclaredPropertiesString == null) + throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new AdditionalPropertiesClass(emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString, anytype1); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs index a8e6d39ce5f..679cec79c20 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs @@ -34,20 +34,8 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - public Animal(string className, string color = "red") + public Animal(string className, string color = @"red") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for Animal and cannot be null."); - - if (color == null) - throw new ArgumentNullException("color is a required property for Animal and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; Color = color; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -157,6 +146,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Animal."); + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class Animal."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Animal(className, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs index 94585e0fdc6..7343f916f89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -37,21 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ApiResponse(int code, string message, string type) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (code == null) - throw new ArgumentNullException("code is a required property for ApiResponse and cannot be null."); - - if (type == null) - throw new ArgumentNullException("type is a required property for ApiResponse and cannot be null."); - - if (message == null) - throw new ArgumentNullException("message is a required property for ApiResponse and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Code = code; Message = message; Type = type; @@ -96,12 +81,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -149,7 +135,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "code": - code = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + code = utf8JsonReader.GetInt32(); break; case "message": message = utf8JsonReader.GetString(); @@ -163,6 +150,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (code == null) + throw new ArgumentNullException(nameof(code), "Property is required for class ApiResponse."); + + if (type == null) + throw new ArgumentNullException(nameof(type), "Property is required for class ApiResponse."); + + if (message == null) + throw new ArgumentNullException(nameof(message), "Property is required for class ApiResponse."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ApiResponse(code, message, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs index a792416f2ae..f480b93afa0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Apple(string cultivar, string origin) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (cultivar == null) - throw new ArgumentNullException("cultivar is a required property for Apple and cannot be null."); - - if (origin == null) - throw new ArgumentNullException("origin is a required property for Apple and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Cultivar = cultivar; Origin = origin; } @@ -84,22 +72,23 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); @@ -161,6 +150,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (cultivar == null) + throw new ArgumentNullException(nameof(cultivar), "Property is required for class Apple."); + + if (origin == null) + throw new ArgumentNullException(nameof(origin), "Property is required for class Apple."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Apple(cultivar, origin); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs index 4ba2c5c5373..c66103ef9a3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public AppleReq(string cultivar, bool mealy) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (cultivar == null) - throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null."); - - if (mealy == null) - throw new ArgumentNullException("mealy is a required property for AppleReq and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Cultivar = cultivar; Mealy = mealy; } @@ -77,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -132,7 +121,8 @@ namespace Org.OpenAPITools.Model cultivar = utf8JsonReader.GetString(); break; case "mealy": - mealy = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mealy = utf8JsonReader.GetBoolean(); break; default: break; @@ -140,6 +130,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (cultivar == null) + throw new ArgumentNullException(nameof(cultivar), "Property is required for class AppleReq."); + + if (mealy == null) + throw new ArgumentNullException(nameof(mealy), "Property is required for class AppleReq."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new AppleReq(cultivar, mealy); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 1ed9c093bcd..e5b37af5db4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayArrayNumber == null) - throw new ArgumentNullException("arrayArrayNumber is a required property for ArrayOfArrayOfNumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayArrayNumber = arrayArrayNumber; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "ArrayArrayNumber": - arrayArrayNumber = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayNumber = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayArrayNumber == null) + throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 3ebd18816b2..d108d6b142b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayOfNumberOnly(List arrayNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayNumber == null) - throw new ArgumentNullException("arrayNumber is a required property for ArrayOfNumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayNumber = arrayNumber; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "ArrayNumber": - arrayNumber = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNumber = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayNumber == null) + throw new ArgumentNullException(nameof(arrayNumber), "Property is required for class ArrayOfNumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayOfNumberOnly(arrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs index d555055c30e..1d211adb467 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -37,21 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ArrayTest(List> arrayArrayOfInteger, List> arrayArrayOfModel, List arrayOfString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayOfString == null) - throw new ArgumentNullException("arrayOfString is a required property for ArrayTest and cannot be null."); - - if (arrayArrayOfInteger == null) - throw new ArgumentNullException("arrayArrayOfInteger is a required property for ArrayTest and cannot be null."); - - if (arrayArrayOfModel == null) - throw new ArgumentNullException("arrayArrayOfModel is a required property for ArrayTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayArrayOfInteger = arrayArrayOfInteger; ArrayArrayOfModel = arrayArrayOfModel; ArrayOfString = arrayOfString; @@ -96,12 +81,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -149,13 +135,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_array_of_integer": - arrayArrayOfInteger = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfInteger = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_array_of_model": - arrayArrayOfModel = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayArrayOfModel = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_of_string": - arrayOfString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayOfString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -163,6 +152,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayOfString == null) + throw new ArgumentNullException(nameof(arrayOfString), "Property is required for class ArrayTest."); + + if (arrayArrayOfInteger == null) + throw new ArgumentNullException(nameof(arrayArrayOfInteger), "Property is required for class ArrayTest."); + + if (arrayArrayOfModel == null) + throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is required for class ArrayTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs index 1bd23879706..cf67cd3dfdb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Banana(decimal lengthCm) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (lengthCm == null) - throw new ArgumentNullException("lengthCm is a required property for Banana and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - LengthCm = lengthCm; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "lengthCm": - lengthCm = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = utf8JsonReader.GetDecimal(); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (lengthCm == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is required for class Banana."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Banana(lengthCm); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs index b185004e078..f49b6502d8a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public BananaReq(decimal lengthCm, bool sweet) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (lengthCm == null) - throw new ArgumentNullException("lengthCm is a required property for BananaReq and cannot be null."); - - if (sweet == null) - throw new ArgumentNullException("sweet is a required property for BananaReq and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - LengthCm = lengthCm; Sweet = sweet; } @@ -77,12 +65,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -129,10 +118,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "lengthCm": - lengthCm = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + lengthCm = utf8JsonReader.GetDecimal(); break; case "sweet": - sweet = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + sweet = utf8JsonReader.GetBoolean(); break; default: break; @@ -140,6 +131,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (lengthCm == null) + throw new ArgumentNullException(nameof(lengthCm), "Property is required for class BananaReq."); + + if (sweet == null) + throw new ArgumentNullException(nameof(sweet), "Property is required for class BananaReq."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new BananaReq(lengthCm, sweet); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs index f74cda1d968..9370e427dca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public BasquePig(string className) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for BasquePig and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class BasquePig."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new BasquePig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs index 89cb785431b..9727c077679 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -40,30 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Capitalization(string aTTNAME, string capitalCamel, string capitalSnake, string sCAETHFlowPoints, string smallCamel, string smallSnake) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (smallCamel == null) - throw new ArgumentNullException("smallCamel is a required property for Capitalization and cannot be null."); - - if (capitalCamel == null) - throw new ArgumentNullException("capitalCamel is a required property for Capitalization and cannot be null."); - - if (smallSnake == null) - throw new ArgumentNullException("smallSnake is a required property for Capitalization and cannot be null."); - - if (capitalSnake == null) - throw new ArgumentNullException("capitalSnake is a required property for Capitalization and cannot be null."); - - if (sCAETHFlowPoints == null) - throw new ArgumentNullException("sCAETHFlowPoints is a required property for Capitalization and cannot be null."); - - if (aTTNAME == null) - throw new ArgumentNullException("aTTNAME is a required property for Capitalization and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ATT_NAME = aTTNAME; CapitalCamel = capitalCamel; CapitalSnake = capitalSnake; @@ -133,12 +109,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -212,6 +189,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (smallCamel == null) + throw new ArgumentNullException(nameof(smallCamel), "Property is required for class Capitalization."); + + if (capitalCamel == null) + throw new ArgumentNullException(nameof(capitalCamel), "Property is required for class Capitalization."); + + if (smallSnake == null) + throw new ArgumentNullException(nameof(smallSnake), "Property is required for class Capitalization."); + + if (capitalSnake == null) + throw new ArgumentNullException(nameof(capitalSnake), "Property is required for class Capitalization."); + + if (sCAETHFlowPoints == null) + throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is required for class Capitalization."); + + if (aTTNAME == null) + throw new ArgumentNullException(nameof(aTTNAME), "Property is required for class Capitalization."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs index 012918369b3..63a7cbf5597 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Cat.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - internal Cat(Dictionary dictionary, CatAllOf catAllOf, string className, string color = "red") : base(className, color) + internal Cat(Dictionary dictionary, CatAllOf catAllOf, string className, string color = @"red") : base(className, color) { Dictionary = dictionary; CatAllOf = catAllOf; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs index 83d03521f6f..ae49286460d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public CatAllOf(bool declawed) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (declawed == null) - throw new ArgumentNullException("declawed is a required property for CatAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Declawed = declawed; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "declawed": - declawed = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + declawed = utf8JsonReader.GetBoolean(); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (declawed == null) + throw new ArgumentNullException(nameof(declawed), "Property is required for class CatAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new CatAllOf(declawed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs index d165237197e..b3500dbfa01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs @@ -34,20 +34,8 @@ namespace Org.OpenAPITools.Model /// id /// name (default to "default-name") [JsonConstructor] - public Category(long id, string name = "default-name") + public Category(long id, string name = @"default-name") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Category and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Category and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; Name = name; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -136,7 +125,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Category."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Category."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Category(id, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a56a226acfa..2bd9eecb33e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ChildCatAllOf(string name, PetTypeEnum petType = PetTypeEnum.ChildCat) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for ChildCatAllOf and cannot be null."); - - if (petType == null) - throw new ArgumentNullException("petType is a required property for ChildCatAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Name = name; PetType = petType; } @@ -123,12 +111,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -187,6 +176,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class ChildCatAllOf."); + + if (petType == null) + throw new ArgumentNullException(nameof(petType), "Property is required for class ChildCatAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ChildCatAllOf(name, petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs index 932a529ec61..4944bb2e113 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ClassModel(string classProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (classProperty == null) - throw new ArgumentNullException("classProperty is a required property for ClassModel and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassProperty = classProperty; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (classProperty == null) + throw new ArgumentNullException(nameof(classProperty), "Property is required for class ClassModel."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ClassModel(classProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 00b7b9977e8..7b28f72a4b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -68,12 +68,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs index 4dad6503d21..eee848c075c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DanishPig(string className) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (className == null) - throw new ArgumentNullException("className is a required property for DanishPig and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class DanishPig."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DanishPig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs index eaf1ee5431b..262c168d6a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -35,21 +35,13 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DateOnlyClass(DateTime dateOnlyProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (dateOnlyProperty == null) - throw new ArgumentNullException("dateOnlyProperty is a required property for DateOnlyClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DateOnlyProperty = dateOnlyProperty; } /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [JsonPropertyName("dateOnlyProperty")] public DateTime DateOnlyProperty { get; set; } @@ -72,12 +64,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -91,7 +84,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize DateOnlyProperty /// - public static string DateOnlyPropertyFormat { get; set; } = "yyyy-MM-dd"; + public static string DateOnlyPropertyFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// A Json reader. @@ -128,7 +121,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "dateOnlyProperty": - dateOnlyProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateOnlyProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -136,6 +130,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (dateOnlyProperty == null) + throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is required for class DateOnlyClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DateOnlyClass(dateOnlyProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 908406d3bf6..e9015dfa6b5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DeprecatedObject(string name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for DeprecatedObject and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Name = name; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class DeprecatedObject."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DeprecatedObject(name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs index 094c1d2fc79..6bb6413c6d9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Dog.cs @@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model /// className /// color (default to "red") [JsonConstructor] - internal Dog(DogAllOf dogAllOf, string className, string color = "red") : base(className, color) + internal Dog(DogAllOf dogAllOf, string className, string color = @"red") : base(className, color) { DogAllOf = dogAllOf; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs index 171b69d1e1c..c1339c65b5e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public DogAllOf(string breed) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (breed == null) - throw new ArgumentNullException("breed is a required property for DogAllOf and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Breed = breed; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (breed == null) + throw new ArgumentNullException(nameof(breed), "Property is required for class DogAllOf."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new DogAllOf(breed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs index 819790eab36..d0ef8cb3bb4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -38,21 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Drawing(Shape mainShape, ShapeOrNull shapeOrNull, List shapes, NullableShape nullableShape = default) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mainShape == null) - throw new ArgumentNullException("mainShape is a required property for Drawing and cannot be null."); - - if (shapeOrNull == null) - throw new ArgumentNullException("shapeOrNull is a required property for Drawing and cannot be null."); - - if (shapes == null) - throw new ArgumentNullException("shapes is a required property for Drawing and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - MainShape = mainShape; ShapeOrNull = shapeOrNull; Shapes = shapes; @@ -99,12 +84,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -153,16 +139,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "mainShape": - mainShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mainShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "shapeOrNull": - shapeOrNull = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapeOrNull = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "shapes": - shapes = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shapes = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "nullableShape": - nullableShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nullableShape = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -170,6 +160,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mainShape == null) + throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing."); + + if (shapeOrNull == null) + throw new ArgumentNullException(nameof(shapeOrNull), "Property is required for class Drawing."); + + if (shapes == null) + throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Drawing(mainShape, shapeOrNull, shapes, nullableShape); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs index 41c69ce3b0e..5d43a6e312a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public EnumArrays(List arrayEnum, JustSymbolEnum justSymbol) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (justSymbol == null) - throw new ArgumentNullException("justSymbol is a required property for EnumArrays and cannot be null."); - - if (arrayEnum == null) - throw new ArgumentNullException("arrayEnum is a required property for EnumArrays and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayEnum = arrayEnum; JustSymbol = justSymbol; } @@ -144,7 +132,7 @@ namespace Org.OpenAPITools.Model public static string JustSymbolEnumToJsonValue(JustSymbolEnum value) { if (value == JustSymbolEnum.GreaterThanOrEqualTo) - return ">="; + return ">="; if (value == JustSymbolEnum.Dollar) return "$"; @@ -184,12 +172,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -236,7 +225,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_enum": - arrayEnum = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayEnum = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); @@ -248,6 +238,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (justSymbol == null) + throw new ArgumentNullException(nameof(justSymbol), "Property is required for class EnumArrays."); + + if (arrayEnum == null) + throw new ArgumentNullException(nameof(arrayEnum), "Property is required for class EnumArrays."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new EnumArrays(arrayEnum, justSymbol); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs index 67fdded75f6..3904f1f39b6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -43,36 +43,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public EnumTest(EnumIntegerEnum enumInteger, EnumIntegerOnlyEnum enumIntegerOnly, EnumNumberEnum enumNumber, EnumStringEnum enumString, EnumStringRequiredEnum enumStringRequired, OuterEnumDefaultValue outerEnumDefaultValue, OuterEnumInteger outerEnumInteger, OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue, OuterEnum? outerEnum = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (enumString == null) - throw new ArgumentNullException("enumString is a required property for EnumTest and cannot be null."); - - if (enumStringRequired == null) - throw new ArgumentNullException("enumStringRequired is a required property for EnumTest and cannot be null."); - - if (enumInteger == null) - throw new ArgumentNullException("enumInteger is a required property for EnumTest and cannot be null."); - - if (enumIntegerOnly == null) - throw new ArgumentNullException("enumIntegerOnly is a required property for EnumTest and cannot be null."); - - if (enumNumber == null) - throw new ArgumentNullException("enumNumber is a required property for EnumTest and cannot be null."); - - if (outerEnumInteger == null) - throw new ArgumentNullException("outerEnumInteger is a required property for EnumTest and cannot be null."); - - if (outerEnumDefaultValue == null) - throw new ArgumentNullException("outerEnumDefaultValue is a required property for EnumTest and cannot be null."); - - if (outerEnumIntegerDefaultValue == null) - throw new ArgumentNullException("outerEnumIntegerDefaultValue is a required property for EnumTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EnumInteger = enumInteger; EnumIntegerOnly = enumIntegerOnly; EnumNumber = enumNumber; @@ -425,12 +395,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -484,13 +455,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "enum_integer": - enumInteger = (EnumTest.EnumIntegerEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumInteger = (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32(); break; case "enum_integer_only": - enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32(); break; case "enum_number": - enumNumber = (EnumTest.EnumNumberEnum) utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + enumNumber = (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32(); break; case "enum_string": string enumStringRawValue = utf8JsonReader.GetString(); @@ -522,6 +496,36 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (enumString == null) + throw new ArgumentNullException(nameof(enumString), "Property is required for class EnumTest."); + + if (enumStringRequired == null) + throw new ArgumentNullException(nameof(enumStringRequired), "Property is required for class EnumTest."); + + if (enumInteger == null) + throw new ArgumentNullException(nameof(enumInteger), "Property is required for class EnumTest."); + + if (enumIntegerOnly == null) + throw new ArgumentNullException(nameof(enumIntegerOnly), "Property is required for class EnumTest."); + + if (enumNumber == null) + throw new ArgumentNullException(nameof(enumNumber), "Property is required for class EnumTest."); + + if (outerEnumInteger == null) + throw new ArgumentNullException(nameof(outerEnumInteger), "Property is required for class EnumTest."); + + if (outerEnumDefaultValue == null) + throw new ArgumentNullException(nameof(outerEnumDefaultValue), "Property is required for class EnumTest."); + + if (outerEnumIntegerDefaultValue == null) + throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is required for class EnumTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new EnumTest(enumInteger, enumIntegerOnly, enumNumber, enumString, enumStringRequired, outerEnumDefaultValue, outerEnumInteger, outerEnumIntegerDefaultValue, outerEnum); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index f9ccd27de59..ffcc56e02ac 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -68,12 +68,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs index 7997aa35771..6590517a86d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public File(string sourceURI) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (sourceURI == null) - throw new ArgumentNullException("sourceURI is a required property for File and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - SourceURI = sourceURI; } @@ -73,12 +64,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -132,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (sourceURI == null) + throw new ArgumentNullException(nameof(sourceURI), "Property is required for class File."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new File(sourceURI); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 900d8f285f2..30f69094f53 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public FileSchemaTestClass(File file, List files) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (file == null) - throw new ArgumentNullException("file is a required property for FileSchemaTestClass and cannot be null."); - - if (files == null) - throw new ArgumentNullException("files is a required property for FileSchemaTestClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - File = file; Files = files; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -136,10 +125,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "file": - file = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + file = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "files": - files = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + files = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -147,6 +138,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (file == null) + throw new ArgumentNullException(nameof(file), "Property is required for class FileSchemaTestClass."); + + if (files == null) + throw new ArgumentNullException(nameof(files), "Property is required for class FileSchemaTestClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new FileSchemaTestClass(file, files); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs index f6efe68bce5..f1340fbe613 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs @@ -33,17 +33,8 @@ namespace Org.OpenAPITools.Model /// /// bar (default to "bar") [JsonConstructor] - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for Foo and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class Foo."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Foo(bar); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index f2b8c70df21..c1e336dbb78 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public FooGetDefaultResponse(Foo stringProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (stringProperty == null) - throw new ArgumentNullException("stringProperty is a required property for FooGetDefaultResponse and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - StringProperty = stringProperty; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "string": - stringProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + stringProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (stringProperty == null) + throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FooGetDefaultResponse."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new FooGetDefaultResponse(stringProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs index 795e741d1a1..9c63adbde8e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -46,64 +46,12 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// stringProperty + /// unsignedInteger + /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, Guid uuid) + public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (integer == null) - throw new ArgumentNullException("integer is a required property for FormatTest and cannot be null."); - - if (int32 == null) - throw new ArgumentNullException("int32 is a required property for FormatTest and cannot be null."); - - if (int64 == null) - throw new ArgumentNullException("int64 is a required property for FormatTest and cannot be null."); - - if (number == null) - throw new ArgumentNullException("number is a required property for FormatTest and cannot be null."); - - if (floatProperty == null) - throw new ArgumentNullException("floatProperty is a required property for FormatTest and cannot be null."); - - if (doubleProperty == null) - throw new ArgumentNullException("doubleProperty is a required property for FormatTest and cannot be null."); - - if (decimalProperty == null) - throw new ArgumentNullException("decimalProperty is a required property for FormatTest and cannot be null."); - - if (stringProperty == null) - throw new ArgumentNullException("stringProperty is a required property for FormatTest and cannot be null."); - - if (byteProperty == null) - throw new ArgumentNullException("byteProperty is a required property for FormatTest and cannot be null."); - - if (binary == null) - throw new ArgumentNullException("binary is a required property for FormatTest and cannot be null."); - - if (date == null) - throw new ArgumentNullException("date is a required property for FormatTest and cannot be null."); - - if (dateTime == null) - throw new ArgumentNullException("dateTime is a required property for FormatTest and cannot be null."); - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for FormatTest and cannot be null."); - - if (password == null) - throw new ArgumentNullException("password is a required property for FormatTest and cannot be null."); - - if (patternWithDigits == null) - throw new ArgumentNullException("patternWithDigits is a required property for FormatTest and cannot be null."); - - if (patternWithDigitsAndDelimiter == null) - throw new ArgumentNullException("patternWithDigitsAndDelimiter is a required property for FormatTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Binary = binary; ByteProperty = byteProperty; Date = date; @@ -119,6 +67,8 @@ namespace Org.OpenAPITools.Model PatternWithDigits = patternWithDigits; PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; StringProperty = stringProperty; + UnsignedInteger = unsignedInteger; + UnsignedLong = unsignedLong; Uuid = uuid; } @@ -137,12 +87,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [JsonPropertyName("date")] public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [JsonPropertyName("dateTime")] public DateTime DateTime { get; set; } @@ -214,9 +166,22 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string StringProperty { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [JsonPropertyName("unsigned_integer")] + public uint UnsignedInteger { get; set; } + + /// + /// Gets or Sets UnsignedLong + /// + [JsonPropertyName("unsigned_long")] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [JsonPropertyName("uuid")] public Guid Uuid { get; set; } @@ -249,17 +214,20 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" StringProperty: ").Append(StringProperty).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // DoubleProperty (double) maximum if (this.DoubleProperty > (double)123.4) @@ -334,26 +302,38 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); } // StringProperty (string) pattern - Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexStringProperty.Match(this.StringProperty).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + yield break; } } @@ -366,7 +346,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize Date /// - public static string DateFormat { get; set; } = "yyyy-MM-dd"; + public static string DateFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// The format to use to serialize DateTime @@ -405,6 +385,8 @@ namespace Org.OpenAPITools.Model string patternWithDigits = default; string patternWithDigitsAndDelimiter = default; string stringProperty = default; + uint unsignedInteger = default; + ulong unsignedLong = default; Guid uuid = default; while (utf8JsonReader.Read()) @@ -423,37 +405,48 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "binary": - binary = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + binary = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "byte": - byteProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + byteProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "date": - date = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + date = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "dateTime": - dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "decimal": - decimalProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + decimalProperty = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "double": - doubleProperty = utf8JsonReader.GetDouble(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + doubleProperty = utf8JsonReader.GetDouble(); break; case "float": - floatProperty = (float)utf8JsonReader.GetDouble(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + floatProperty = (float)utf8JsonReader.GetDouble(); break; case "int32": - int32 = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32 = utf8JsonReader.GetInt32(); break; case "int64": - int64 = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64 = utf8JsonReader.GetInt64(); break; case "integer": - integer = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + integer = utf8JsonReader.GetInt32(); break; case "number": - number = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + number = utf8JsonReader.GetDecimal(); break; case "password": password = utf8JsonReader.GetString(); @@ -467,8 +460,17 @@ namespace Org.OpenAPITools.Model case "string": stringProperty = utf8JsonReader.GetString(); break; + case "unsigned_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedInteger = utf8JsonReader.GetUInt32(); + break; + case "unsigned_long": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + unsignedLong = utf8JsonReader.GetUInt64(); + break; case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; default: break; @@ -476,7 +478,67 @@ namespace Org.OpenAPITools.Model } } - return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, uuid); +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (integer == null) + throw new ArgumentNullException(nameof(integer), "Property is required for class FormatTest."); + + if (int32 == null) + throw new ArgumentNullException(nameof(int32), "Property is required for class FormatTest."); + + if (unsignedInteger == null) + throw new ArgumentNullException(nameof(unsignedInteger), "Property is required for class FormatTest."); + + if (int64 == null) + throw new ArgumentNullException(nameof(int64), "Property is required for class FormatTest."); + + if (unsignedLong == null) + throw new ArgumentNullException(nameof(unsignedLong), "Property is required for class FormatTest."); + + if (number == null) + throw new ArgumentNullException(nameof(number), "Property is required for class FormatTest."); + + if (floatProperty == null) + throw new ArgumentNullException(nameof(floatProperty), "Property is required for class FormatTest."); + + if (doubleProperty == null) + throw new ArgumentNullException(nameof(doubleProperty), "Property is required for class FormatTest."); + + if (decimalProperty == null) + throw new ArgumentNullException(nameof(decimalProperty), "Property is required for class FormatTest."); + + if (stringProperty == null) + throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FormatTest."); + + if (byteProperty == null) + throw new ArgumentNullException(nameof(byteProperty), "Property is required for class FormatTest."); + + if (binary == null) + throw new ArgumentNullException(nameof(binary), "Property is required for class FormatTest."); + + if (date == null) + throw new ArgumentNullException(nameof(date), "Property is required for class FormatTest."); + + if (dateTime == null) + throw new ArgumentNullException(nameof(dateTime), "Property is required for class FormatTest."); + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class FormatTest."); + + if (password == null) + throw new ArgumentNullException(nameof(password), "Property is required for class FormatTest."); + + if (patternWithDigits == null) + throw new ArgumentNullException(nameof(patternWithDigits), "Property is required for class FormatTest."); + + if (patternWithDigitsAndDelimiter == null) + throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is required for class FormatTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid); } /// @@ -508,6 +570,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits); writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter); writer.WriteString("string", formatTest.StringProperty); + writer.WriteNumber("unsigned_integer", formatTest.UnsignedInteger); + writer.WriteNumber("unsigned_long", formatTest.UnsignedLong); writer.WriteString("uuid", formatTest.Uuid); writer.WriteEndObject(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs index 6d793581a27..1897c29368b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs @@ -36,15 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Apple apple, string color) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException(nameof(Color)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Apple = apple; Color = color; } @@ -57,15 +48,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Fruit(Banana banana, string color) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException(nameof(Color)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Banana = banana; Color = color; } @@ -98,12 +80,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -163,6 +146,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (appleDeserialized) return new Fruit(apple, color); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs index e3c2dde4faa..1f3cebfc712 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs @@ -69,12 +69,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs index d1630926033..e8a5ee705d9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs @@ -37,15 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public GmFruit(Apple apple, Banana banana, string color) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (color == null) - throw new ArgumentNullException("color is a required property for GmFruit and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Apple = Apple; Banana = Banana; Color = color; @@ -79,12 +70,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -144,6 +136,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (color == null) + throw new ArgumentNullException(nameof(color), "Property is required for class GmFruit."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new GmFruit(apple, banana, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index d0ebffcd70c..5eb944b1344 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public GrandparentAnimal(string petType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (petType == null) - throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - PetType = petType; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -141,6 +133,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (petType == null) + throw new ArgumentNullException(nameof(petType), "Property is required for class GrandparentAnimal."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new GrandparentAnimal(petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index ba5b4e850a0..783d3552c2b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] internal HasOnlyReadOnly(string bar, string foo) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for HasOnlyReadOnly and cannot be null."); - - if (foo == null) - throw new ArgumentNullException("foo is a required property for HasOnlyReadOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; Foo = foo; } @@ -121,12 +109,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -184,6 +173,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class HasOnlyReadOnly."); + + if (foo == null) + throw new ArgumentNullException(nameof(foo), "Property is required for class HasOnlyReadOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new HasOnlyReadOnly(bar, foo); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 6db340e73bb..d7f78eef1f4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -63,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 119216e42a3..2c987e36594 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -61,12 +61,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs index 0c52844f3df..4553f4f3a29 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public List(string _123list) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (_123list == null) - throw new ArgumentNullException("_123list is a required property for List and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - _123List = _123list; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (_123list == null) + throw new ArgumentNullException(nameof(_123list), "Property is required for class List."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new List(_123list); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..28084cc3a8b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,171 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + public partial class LiteralStringClass : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username") + /// unescapedLiteralString (default to "C:\Users\username") + [JsonConstructor] + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + EscapedLiteralString = escapedLiteralString; + UnescapedLiteralString = unescapedLiteralString; + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [JsonPropertyName("escapedLiteralString")] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [JsonPropertyName("unescapedLiteralString")] + public string UnescapedLiteralString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type LiteralStringClass + /// + public class LiteralStringClassJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override LiteralStringClass Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string escapedLiteralString = default; + string unescapedLiteralString = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "escapedLiteralString": + escapedLiteralString = utf8JsonReader.GetString(); + break; + case "unescapedLiteralString": + unescapedLiteralString = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (escapedLiteralString == null) + throw new ArgumentNullException(nameof(escapedLiteralString), "Property is required for class LiteralStringClass."); + + if (unescapedLiteralString == null) + throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is required for class LiteralStringClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WriteString("escapedLiteralString", literalStringClass.EscapedLiteralString); + writer.WriteString("unescapedLiteralString", literalStringClass.UnescapedLiteralString); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs index 0751201e466..6a39a41063a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs @@ -91,12 +91,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs index 7e701c9b9a3..57630f7d8ed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -38,24 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public MapTest(Dictionary directMap, Dictionary indirectMap, Dictionary> mapMapOfString, Dictionary mapOfEnumString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (mapMapOfString == null) - throw new ArgumentNullException("mapMapOfString is a required property for MapTest and cannot be null."); - - if (mapOfEnumString == null) - throw new ArgumentNullException("mapOfEnumString is a required property for MapTest and cannot be null."); - - if (directMap == null) - throw new ArgumentNullException("directMap is a required property for MapTest and cannot be null."); - - if (indirectMap == null) - throw new ArgumentNullException("indirectMap is a required property for MapTest and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DirectMap = directMap; IndirectMap = indirectMap; MapMapOfString = mapMapOfString; @@ -158,12 +140,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -212,16 +195,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "direct_map": - directMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + directMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "indirect_map": - indirectMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + indirectMap = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_map_of_string": - mapMapOfString = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapMapOfString = JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions); break; case "map_of_enum_string": - mapOfEnumString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mapOfEnumString = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -229,6 +216,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (mapMapOfString == null) + throw new ArgumentNullException(nameof(mapMapOfString), "Property is required for class MapTest."); + + if (mapOfEnumString == null) + throw new ArgumentNullException(nameof(mapOfEnumString), "Property is required for class MapTest."); + + if (directMap == null) + throw new ArgumentNullException(nameof(directMap), "Property is required for class MapTest."); + + if (indirectMap == null) + throw new ArgumentNullException(nameof(indirectMap), "Property is required for class MapTest."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 30821d80580..a4b87545f05 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -38,24 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid, Guid uuidWithPattern) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (uuidWithPattern == null) - throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (dateTime == null) - throw new ArgumentNullException("dateTime is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - - if (map == null) - throw new ArgumentNullException("map is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - DateTime = dateTime; Map = map; Uuid = uuid; @@ -108,15 +90,16 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); @@ -174,16 +157,20 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "dateTime": - dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateTime = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "map": - map = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + map = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; case "uuid_with_pattern": - uuidWithPattern = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuidWithPattern = utf8JsonReader.GetGuid(); break; default: break; @@ -191,6 +178,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (uuidWithPattern == null) + throw new ArgumentNullException(nameof(uuidWithPattern), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (dateTime == null) + throw new ArgumentNullException(nameof(dateTime), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + + if (map == null) + throw new ArgumentNullException(nameof(map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs index 1ea81633836..25b0862bbc0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Model200Response(string classProperty, int name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (name == null) - throw new ArgumentNullException("name is a required property for Model200Response and cannot be null."); - - if (classProperty == null) - throw new ArgumentNullException("classProperty is a required property for Model200Response and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassProperty = classProperty; Name = name; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -139,7 +128,8 @@ namespace Org.OpenAPITools.Model classProperty = utf8JsonReader.GetString(); break; case "name": - name = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + name = utf8JsonReader.GetInt32(); break; default: break; @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Model200Response."); + + if (classProperty == null) + throw new ArgumentNullException(nameof(classProperty), "Property is required for class Model200Response."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Model200Response(classProperty, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs index ba8b6196a1a..f3ffbd3a822 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ModelClient(string clientProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (clientProperty == null) - throw new ArgumentNullException("clientProperty is a required property for ModelClient and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - _ClientProperty = clientProperty; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (clientProperty == null) + throw new ArgumentNullException(nameof(clientProperty), "Property is required for class ModelClient."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ModelClient(clientProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs index 93864f5241c..9ead9323c34 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs @@ -38,24 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Name(int nameProperty, string property, int snakeCase, int _123number) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (nameProperty == null) - throw new ArgumentNullException("nameProperty is a required property for Name and cannot be null."); - - if (snakeCase == null) - throw new ArgumentNullException("snakeCase is a required property for Name and cannot be null."); - - if (property == null) - throw new ArgumentNullException("property is a required property for Name and cannot be null."); - - if (_123number == null) - throw new ArgumentNullException("_123number is a required property for Name and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - NameProperty = nameProperty; Property = property; SnakeCase = snakeCase; @@ -145,12 +127,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -199,16 +182,19 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "name": - nameProperty = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + nameProperty = utf8JsonReader.GetInt32(); break; case "property": property = utf8JsonReader.GetString(); break; case "snake_case": - snakeCase = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + snakeCase = utf8JsonReader.GetInt32(); break; case "123Number": - _123number = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + _123number = utf8JsonReader.GetInt32(); break; default: break; @@ -216,6 +202,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (nameProperty == null) + throw new ArgumentNullException(nameof(nameProperty), "Property is required for class Name."); + + if (snakeCase == null) + throw new ArgumentNullException(nameof(snakeCase), "Property is required for class Name."); + + if (property == null) + throw new ArgumentNullException(nameof(property), "Property is required for class Name."); + + if (_123number == null) + throw new ArgumentNullException(nameof(_123number), "Property is required for class Name."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Name(nameProperty, property, snakeCase, _123number); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs index fe0f847dc9d..34aeea6c10a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -46,18 +46,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public NullableClass(List arrayItemsNullable, Dictionary objectItemsNullable, List arrayAndItemsNullableProp = default, List arrayNullableProp = default, bool? booleanProp = default, DateTime? dateProp = default, DateTime? datetimeProp = default, int? integerProp = default, decimal? numberProp = default, Dictionary objectAndItemsNullableProp = default, Dictionary objectNullableProp = default, string stringProp = default) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (arrayItemsNullable == null) - throw new ArgumentNullException("arrayItemsNullable is a required property for NullableClass and cannot be null."); - - if (objectItemsNullable == null) - throw new ArgumentNullException("objectItemsNullable is a required property for NullableClass and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ArrayItemsNullable = arrayItemsNullable; ObjectItemsNullable = objectItemsNullable; ArrayAndItemsNullableProp = arrayAndItemsNullableProp; @@ -168,12 +156,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -187,7 +176,7 @@ namespace Org.OpenAPITools.Model /// /// The format to use to serialize DateProp /// - public static string DatePropFormat { get; set; } = "yyyy-MM-dd"; + public static string DatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; /// /// The format to use to serialize DatetimeProp @@ -240,25 +229,32 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "array_items_nullable": - arrayItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "object_items_nullable": - objectItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectItemsNullable = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_and_items_nullable_prop": - arrayAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "array_nullable_prop": - arrayNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + arrayNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "boolean_prop": - booleanProp = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + booleanProp = utf8JsonReader.GetBoolean(); break; case "date_prop": - dateProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + dateProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "datetime_prop": - datetimeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + datetimeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "integer_prop": if (utf8JsonReader.TokenType != JsonTokenType.Null) @@ -269,10 +265,12 @@ namespace Org.OpenAPITools.Model numberProp = utf8JsonReader.GetInt32(); break; case "object_and_items_nullable_prop": - objectAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectAndItemsNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "object_nullable_prop": - objectNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectNullableProp = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "string_prop": stringProp = utf8JsonReader.GetString(); @@ -283,6 +281,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (arrayItemsNullable == null) + throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is required for class NullableClass."); + + if (objectItemsNullable == null) + throw new ArgumentNullException(nameof(objectItemsNullable), "Property is required for class NullableClass."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new NullableClass(arrayItemsNullable, objectItemsNullable, arrayAndItemsNullableProp, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectNullableProp, stringProp); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 233e907c97e..494beaa0c0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [JsonPropertyName("uuid")] public Guid? Uuid { get; set; } @@ -63,12 +64,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -114,7 +116,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "uuid": - uuid = utf8JsonReader.GetGuid(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + uuid = utf8JsonReader.GetGuid(); break; default: break; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs index c07b44d5ebc..86c3ef2b52f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs @@ -76,12 +76,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs index 91a11d39e08..9a61acfc177 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public NumberOnly(decimal justNumber) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (justNumber == null) - throw new ArgumentNullException("justNumber is a required property for NumberOnly and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - JustNumber = justNumber; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "JustNumber": - justNumber = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + justNumber = utf8JsonReader.GetDecimal(); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (justNumber == null) + throw new ArgumentNullException(nameof(justNumber), "Property is required for class NumberOnly."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new NumberOnly(justNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index ac3f6e116b3..c72cefc32ea 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -38,24 +38,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ObjectWithDeprecatedFields(List bars, DeprecatedObject deprecatedRef, decimal id, string uuid) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (uuid == null) - throw new ArgumentNullException("uuid is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (id == null) - throw new ArgumentNullException("id is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (deprecatedRef == null) - throw new ArgumentNullException("deprecatedRef is a required property for ObjectWithDeprecatedFields and cannot be null."); - - if (bars == null) - throw new ArgumentNullException("bars is a required property for ObjectWithDeprecatedFields and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bars = bars; DeprecatedRef = deprecatedRef; Id = id; @@ -111,12 +93,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -165,13 +148,16 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "bars": - bars = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + bars = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "deprecatedRef": - deprecatedRef = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + deprecatedRef = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "id": - id = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetDecimal(); break; case "uuid": uuid = utf8JsonReader.GetString(); @@ -182,6 +168,24 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (uuid == null) + throw new ArgumentNullException(nameof(uuid), "Property is required for class ObjectWithDeprecatedFields."); + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class ObjectWithDeprecatedFields."); + + if (deprecatedRef == null) + throw new ArgumentNullException(nameof(deprecatedRef), "Property is required for class ObjectWithDeprecatedFields."); + + if (bars == null) + throw new ArgumentNullException(nameof(bars), "Property is required for class ObjectWithDeprecatedFields."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ObjectWithDeprecatedFields(bars, deprecatedRef, id, uuid); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs index 00738d9c335..8ebcf3cd50a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs @@ -40,30 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Order(long id, long petId, int quantity, DateTime shipDate, StatusEnum status, bool complete = false) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Order and cannot be null."); - - if (petId == null) - throw new ArgumentNullException("petId is a required property for Order and cannot be null."); - - if (quantity == null) - throw new ArgumentNullException("quantity is a required property for Order and cannot be null."); - - if (shipDate == null) - throw new ArgumentNullException("shipDate is a required property for Order and cannot be null."); - - if (status == null) - throw new ArgumentNullException("status is a required property for Order and cannot be null."); - - if (complete == null) - throw new ArgumentNullException("complete is a required property for Order and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; PetId = petId; Quantity = quantity; @@ -162,6 +138,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [JsonPropertyName("shipDate")] public DateTime ShipDate { get; set; } @@ -195,12 +172,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -256,23 +234,28 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "petId": - petId = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + petId = utf8JsonReader.GetInt64(); break; case "quantity": - quantity = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + quantity = utf8JsonReader.GetInt32(); break; case "shipDate": - shipDate = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shipDate = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "status": string statusRawValue = utf8JsonReader.GetString(); status = Order.StatusEnumFromString(statusRawValue); break; case "complete": - complete = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + complete = utf8JsonReader.GetBoolean(); break; default: break; @@ -280,6 +263,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Order."); + + if (petId == null) + throw new ArgumentNullException(nameof(petId), "Property is required for class Order."); + + if (quantity == null) + throw new ArgumentNullException(nameof(quantity), "Property is required for class Order."); + + if (shipDate == null) + throw new ArgumentNullException(nameof(shipDate), "Property is required for class Order."); + + if (status == null) + throw new ArgumentNullException(nameof(status), "Property is required for class Order."); + + if (complete == null) + throw new ArgumentNullException(nameof(complete), "Property is required for class Order."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Order(id, petId, quantity, shipDate, status, complete); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs index 0d88d627848..fd2a96d97ec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -37,21 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public OuterComposite(bool myBoolean, decimal myNumber, string myString) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (myNumber == null) - throw new ArgumentNullException("myNumber is a required property for OuterComposite and cannot be null."); - - if (myString == null) - throw new ArgumentNullException("myString is a required property for OuterComposite and cannot be null."); - - if (myBoolean == null) - throw new ArgumentNullException("myBoolean is a required property for OuterComposite and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - MyBoolean = myBoolean; MyNumber = myNumber; MyString = myString; @@ -96,12 +81,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -149,10 +135,12 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "my_boolean": - myBoolean = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myBoolean = utf8JsonReader.GetBoolean(); break; case "my_number": - myNumber = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + myNumber = utf8JsonReader.GetDecimal(); break; case "my_string": myString = utf8JsonReader.GetString(); @@ -163,6 +151,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (myNumber == null) + throw new ArgumentNullException(nameof(myNumber), "Property is required for class OuterComposite."); + + if (myString == null) + throw new ArgumentNullException(nameof(myString), "Property is required for class OuterComposite."); + + if (myBoolean == null) + throw new ArgumentNullException(nameof(myBoolean), "Property is required for class OuterComposite."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new OuterComposite(myBoolean, myNumber, myString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs index 9158b93f5f5..fdc59f593c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs @@ -40,30 +40,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Pet(Category category, long id, string name, List photoUrls, StatusEnum status, List tags) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Pet and cannot be null."); - - if (category == null) - throw new ArgumentNullException("category is a required property for Pet and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Pet and cannot be null."); - - if (photoUrls == null) - throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null."); - - if (tags == null) - throw new ArgumentNullException("tags is a required property for Pet and cannot be null."); - - if (status == null) - throw new ArgumentNullException("status is a required property for Pet and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Category = category; Id = id; Name = name; @@ -156,6 +132,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [JsonPropertyName("name")] public string Name { get; set; } @@ -195,12 +172,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -251,23 +229,27 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "category": - category = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + category = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); break; case "photoUrls": - photoUrls = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + photoUrls = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; case "status": string statusRawValue = utf8JsonReader.GetString(); status = Pet.StatusEnumFromString(statusRawValue); break; case "tags": - tags = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + tags = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -275,6 +257,30 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Pet."); + + if (category == null) + throw new ArgumentNullException(nameof(category), "Property is required for class Pet."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Pet."); + + if (photoUrls == null) + throw new ArgumentNullException(nameof(photoUrls), "Property is required for class Pet."); + + if (tags == null) + throw new ArgumentNullException(nameof(tags), "Property is required for class Pet."); + + if (status == null) + throw new ArgumentNullException(nameof(status), "Property is required for class Pet."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Pet(category, id, name, photoUrls, status, tags); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs index 358f8cdbe31..85ab6251f50 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs @@ -76,12 +76,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 9cb8277290b..3c4e3ea5639 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -106,12 +106,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs index 34f1549087f..c2d44ceb5b1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -76,12 +76,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 73b448ebfaf..12f1df4e2fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public QuadrilateralInterface(string quadrilateralType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - QuadrilateralType = quadrilateralType; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class QuadrilateralInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new QuadrilateralInterface(quadrilateralType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index a77197ed839..a627d781b7c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ReadOnlyFirst(string bar, string baz) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (bar == null) - throw new ArgumentNullException("bar is a required property for ReadOnlyFirst and cannot be null."); - - if (baz == null) - throw new ArgumentNullException("baz is a required property for ReadOnlyFirst and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Bar = bar; Baz = baz; } @@ -120,12 +108,13 @@ namespace Org.OpenAPITools.Model return hashCode; } } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -183,6 +172,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (bar == null) + throw new ArgumentNullException(nameof(bar), "Property is required for class ReadOnlyFirst."); + + if (baz == null) + throw new ArgumentNullException(nameof(baz), "Property is required for class ReadOnlyFirst."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ReadOnlyFirst(bar, baz); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs index 23704ea0a86..1e456507b90 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Return(int returnProperty) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (returnProperty == null) - throw new ArgumentNullException("returnProperty is a required property for Return and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ReturnProperty = returnProperty; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -123,7 +115,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "return": - returnProperty = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + returnProperty = utf8JsonReader.GetInt32(); break; default: break; @@ -131,6 +124,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (returnProperty == null) + throw new ArgumentNullException(nameof(returnProperty), "Property is required for class Return."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Return(returnProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index ee156811143..0588ff50679 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -68,12 +68,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs index 2e29d505fd7..0fe8f6619dc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs @@ -36,15 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Shape(Triangle triangle, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Triangle = triangle; QuadrilateralType = quadrilateralType; } @@ -57,15 +48,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Shape(Quadrilateral quadrilateral, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Quadrilateral = quadrilateral; QuadrilateralType = quadrilateralType; } @@ -105,12 +87,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -180,6 +163,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class Shape."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (triangleDeserialized) return new Shape(triangle, quadrilateralType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index c47f5d73c9a..c0693b6831f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeInterface(string shapeType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ShapeType = shapeType; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (shapeType == null) + throw new ArgumentNullException(nameof(shapeType), "Property is required for class ShapeInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new ShapeInterface(shapeType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs index a7de304d7c0..0eb8b07b368 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -36,15 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeOrNull(Triangle triangle, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Triangle = triangle; QuadrilateralType = quadrilateralType; } @@ -57,15 +48,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public ShapeOrNull(Quadrilateral quadrilateral, string quadrilateralType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (quadrilateralType == null) - throw new ArgumentNullException(nameof(QuadrilateralType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Quadrilateral = quadrilateral; QuadrilateralType = quadrilateralType; } @@ -105,12 +87,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -180,6 +163,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (quadrilateralType == null) + throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class ShapeOrNull."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (triangleDeserialized) return new ShapeOrNull(triangle, quadrilateralType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 219c6c795f7..32ec4152f7f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -68,12 +68,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs index 4af7567d283..d460df8625c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public SpecialModelName(string specialModelNameProperty, long specialPropertyName) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (specialPropertyName == null) - throw new ArgumentNullException("specialPropertyName is a required property for SpecialModelName and cannot be null."); - - if (specialModelNameProperty == null) - throw new ArgumentNullException("specialModelNameProperty is a required property for SpecialModelName and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - SpecialModelNameProperty = specialModelNameProperty; SpecialPropertyName = specialPropertyName; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -139,7 +128,8 @@ namespace Org.OpenAPITools.Model specialModelNameProperty = utf8JsonReader.GetString(); break; case "$special[property.name]": - specialPropertyName = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + specialPropertyName = utf8JsonReader.GetInt64(); break; default: break; @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (specialPropertyName == null) + throw new ArgumentNullException(nameof(specialPropertyName), "Property is required for class SpecialModelName."); + + if (specialModelNameProperty == null) + throw new ArgumentNullException(nameof(specialModelNameProperty), "Property is required for class SpecialModelName."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new SpecialModelName(specialModelNameProperty, specialPropertyName); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs index a2f0590c288..25683998ebb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Tag(long id, string name) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for Tag and cannot be null."); - - if (name == null) - throw new ArgumentNullException("name is a required property for Tag and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Id = id; Name = name; } @@ -84,12 +72,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -136,7 +125,8 @@ namespace Org.OpenAPITools.Model switch (propertyName) { case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "name": name = utf8JsonReader.GetString(); @@ -147,6 +137,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class Tag."); + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class Tag."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Tag(id, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..555b289c82f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,154 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + public partial class TestCollectionEndingWithWordList : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value + [JsonConstructor] + public TestCollectionEndingWithWordList(string value) + { + Value = value; + } + + /// + /// Gets or Sets Value + /// + [JsonPropertyName("value")] + public string Value { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type TestCollectionEndingWithWordList + /// + public class TestCollectionEndingWithWordListJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordList Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string value = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "value": + value = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (value == null) + throw new ArgumentNullException(nameof(value), "Property is required for class TestCollectionEndingWithWordList."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new TestCollectionEndingWithWordList(value); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WriteString("value", testCollectionEndingWithWordList.Value); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..0e4dbfd8406 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,156 @@ +// +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + public partial class TestCollectionEndingWithWordListObject : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList + [JsonConstructor] + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList) + { + TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [JsonPropertyName("TestCollectionEndingWithWordList")] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type TestCollectionEndingWithWordListObject + /// + public class TestCollectionEndingWithWordListObjectJsonConverter : JsonConverter + { + /// + /// A Json reader. + /// + /// + /// + /// + /// + /// + public override TestCollectionEndingWithWordListObject Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + List testCollectionEndingWithWordList = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "TestCollectionEndingWithWordList": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + testCollectionEndingWithWordList = JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions); + break; + default: + break; + } + } + } + +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (testCollectionEndingWithWordList == null) + throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); + } + + /// + /// A Json writer + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + writer.WritePropertyName("TestCollectionEndingWithWordList"); + JsonSerializer.Serialize(writer, testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList, jsonSerializerOptions); + + writer.WriteEndObject(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs index 81884177e02..46e762901b3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs @@ -37,18 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(EquilateralTriangle equilateralTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - EquilateralTriangle = equilateralTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -63,18 +51,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(IsoscelesTriangle isoscelesTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - IsoscelesTriangle = isoscelesTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -89,18 +65,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Triangle(ScaleneTriangle scaleneTriangle, string shapeType, string triangleType) { - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (shapeType == null) - throw new ArgumentNullException(nameof(ShapeType)); - - if (triangleType == null) - throw new ArgumentNullException(nameof(TriangleType)); - - #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ScaleneTriangle = scaleneTriangle; ShapeType = shapeType; TriangleType = triangleType; @@ -153,12 +117,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -235,6 +200,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (shapeType == null) + throw new ArgumentNullException(nameof(shapeType), "Property is required for class Triangle."); + + if (triangleType == null) + throw new ArgumentNullException(nameof(triangleType), "Property is required for class Triangle."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (equilateralTriangleDeserialized) return new Triangle(equilateralTriangle, shapeType, triangleType); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index ddb4e8de495..2926c5cd546 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -35,15 +35,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public TriangleInterface(string triangleType) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleType == null) - throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - TriangleType = triangleType; } @@ -72,12 +63,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -131,6 +123,15 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (triangleType == null) + throw new ArgumentNullException(nameof(triangleType), "Property is required for class TriangleInterface."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new TriangleInterface(triangleType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs index 875cebefe8b..b78692934cc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs @@ -46,39 +46,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public User(string email, string firstName, long id, string lastName, Object objectWithNoDeclaredProps, string password, string phone, int userStatus, string username, Object anyTypeProp = default, Object anyTypePropNullable = default, Object objectWithNoDeclaredPropsNullable = default) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (id == null) - throw new ArgumentNullException("id is a required property for User and cannot be null."); - - if (username == null) - throw new ArgumentNullException("username is a required property for User and cannot be null."); - - if (firstName == null) - throw new ArgumentNullException("firstName is a required property for User and cannot be null."); - - if (lastName == null) - throw new ArgumentNullException("lastName is a required property for User and cannot be null."); - - if (email == null) - throw new ArgumentNullException("email is a required property for User and cannot be null."); - - if (password == null) - throw new ArgumentNullException("password is a required property for User and cannot be null."); - - if (phone == null) - throw new ArgumentNullException("phone is a required property for User and cannot be null."); - - if (userStatus == null) - throw new ArgumentNullException("userStatus is a required property for User and cannot be null."); - - if (objectWithNoDeclaredProps == null) - throw new ArgumentNullException("objectWithNoDeclaredProps is a required property for User and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - Email = email; FirstName = firstName; Id = id; @@ -200,12 +167,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -268,13 +236,15 @@ namespace Org.OpenAPITools.Model firstName = utf8JsonReader.GetString(); break; case "id": - id = utf8JsonReader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = utf8JsonReader.GetInt64(); break; case "lastName": lastName = utf8JsonReader.GetString(); break; case "objectWithNoDeclaredProps": - objectWithNoDeclaredProps = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredProps = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "password": password = utf8JsonReader.GetString(); @@ -283,19 +253,23 @@ namespace Org.OpenAPITools.Model phone = utf8JsonReader.GetString(); break; case "userStatus": - userStatus = utf8JsonReader.GetInt32(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + userStatus = utf8JsonReader.GetInt32(); break; case "username": username = utf8JsonReader.GetString(); break; case "anyTypeProp": - anyTypeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypeProp = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "anyTypePropNullable": - anyTypePropNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + anyTypePropNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; case "objectWithNoDeclaredPropsNullable": - objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); break; default: break; @@ -303,6 +277,39 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (id == null) + throw new ArgumentNullException(nameof(id), "Property is required for class User."); + + if (username == null) + throw new ArgumentNullException(nameof(username), "Property is required for class User."); + + if (firstName == null) + throw new ArgumentNullException(nameof(firstName), "Property is required for class User."); + + if (lastName == null) + throw new ArgumentNullException(nameof(lastName), "Property is required for class User."); + + if (email == null) + throw new ArgumentNullException(nameof(email), "Property is required for class User."); + + if (password == null) + throw new ArgumentNullException(nameof(password), "Property is required for class User."); + + if (phone == null) + throw new ArgumentNullException(nameof(phone), "Property is required for class User."); + + if (userStatus == null) + throw new ArgumentNullException(nameof(userStatus), "Property is required for class User."); + + if (objectWithNoDeclaredProps == null) + throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is required for class User."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new User(email, firstName, id, lastName, objectWithNoDeclaredProps, password, phone, userStatus, username, anyTypeProp, anyTypePropNullable, objectWithNoDeclaredPropsNullable); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs index 0129208c866..0296c2082fc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs @@ -37,21 +37,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Whale(string className, bool hasBaleen, bool hasTeeth) { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (hasBaleen == null) - throw new ArgumentNullException("hasBaleen is a required property for Whale and cannot be null."); - - if (hasTeeth == null) - throw new ArgumentNullException("hasTeeth is a required property for Whale and cannot be null."); - - if (className == null) - throw new ArgumentNullException("className is a required property for Whale and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; HasBaleen = hasBaleen; HasTeeth = hasTeeth; @@ -96,12 +81,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -152,10 +138,12 @@ namespace Org.OpenAPITools.Model className = utf8JsonReader.GetString(); break; case "hasBaleen": - hasBaleen = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasBaleen = utf8JsonReader.GetBoolean(); break; case "hasTeeth": - hasTeeth = utf8JsonReader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + hasTeeth = utf8JsonReader.GetBoolean(); break; default: break; @@ -163,6 +151,21 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (hasBaleen == null) + throw new ArgumentNullException(nameof(hasBaleen), "Property is required for class Whale."); + + if (hasTeeth == null) + throw new ArgumentNullException(nameof(hasTeeth), "Property is required for class Whale."); + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Whale."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Whale(className, hasBaleen, hasTeeth); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs index 3df8c300ab6..40970ba5b0b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -36,18 +36,6 @@ namespace Org.OpenAPITools.Model [JsonConstructor] public Zebra(string className, TypeEnum type) : base() { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (type == null) - throw new ArgumentNullException("type is a required property for Zebra and cannot be null."); - - if (className == null) - throw new ArgumentNullException("className is a required property for Zebra and cannot be null."); - -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - ClassName = className; Type = type; } @@ -146,12 +134,13 @@ namespace Org.OpenAPITools.Model sb.Append("}\n"); return sb.ToString(); } + /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } @@ -210,6 +199,18 @@ namespace Org.OpenAPITools.Model } } +#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (type == null) + throw new ArgumentNullException(nameof(type), "Property is required for class Zebra."); + + if (className == null) + throw new ArgumentNullException(nameof(className), "Property is required for class Zebra."); + +#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + return new Zebra(className, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/FILES index 05e40204769..d0801197efe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/Activity.md docs/ActivityOutputElementRepresentation.md @@ -50,6 +51,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/List.md +docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -84,6 +86,8 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -161,6 +165,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -193,6 +198,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/README.md index 15085d15425..704da570647 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/README.md @@ -131,6 +131,7 @@ 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 | *DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello *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 | @@ -217,6 +218,7 @@ Class | Method | HTTP request | Description - [Model.HealthCheckResult](docs/HealthCheckResult.md) - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Model.List](docs/List.md) + - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -249,6 +251,8 @@ Class | Method | HTTP request | Description - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/DefaultApi.md index 3733b7c3ff9..7a5790f4abf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -180,3 +181,93 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient-httpclient/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FormatTest.md index 505dbad52df..bd9e50f80af 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FormatTest.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/LiteralStringClass.md new file mode 100644 index 00000000000..6d3e0d50c1f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient-httpclient/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..0e5568637b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-httpclient/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..7213b3ca8d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..74dc17b9f4a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -0,0 +1,77 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..4def0dcda9c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e9df66daf2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/DefaultApi.cs index 083dc76c26d..a6f788ddcb2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -61,6 +61,25 @@ namespace Org.OpenAPITools.Api /// /// ApiResponse of Object(void) ApiResponse GetCountryWithHttpInfo(string country); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// List<Guid> + List Hello(); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// ApiResponse of List<Guid> + ApiResponse> HelloWithHttpInfo(); #endregion Synchronous Operations } @@ -114,6 +133,27 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> HelloAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -541,5 +581,106 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// List<Guid> + public List Hello() + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = HelloWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// ApiResponse of List<Guid> + public Org.OpenAPITools.Client.ApiResponse> HelloWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/hello", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> HelloAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await HelloWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>("/hello", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs index 2c37082b956..f6e3372563a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -82,7 +82,7 @@ namespace Org.OpenAPITools.Client public async Task Deserialize(HttpResponseMessage response) { - var result = (T) await Deserialize(response, typeof(T)); + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); return result; } @@ -98,17 +98,17 @@ namespace Org.OpenAPITools.Client if (type == typeof(byte[])) // return byte array { - return await response.Content.ReadAsByteArrayAsync(); + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); } else if (type == typeof(FileParameter)) { - return new FileParameter(await response.Content.ReadAsStreamAsync()); + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) if (type == typeof(Stream)) { - var bytes = await response.Content.ReadAsByteArrayAsync(); + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); if (headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) @@ -132,18 +132,18 @@ namespace Org.OpenAPITools.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(await response.Content.ReadAsStringAsync(), null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { - return Convert.ChangeType(await response.Content.ReadAsStringAsync(), type); + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); } // at this point, it must be a model (json) try { - return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync(), type, _serializerSettings); + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); } catch (Exception e) { @@ -402,7 +402,7 @@ namespace Org.OpenAPITools.Client private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { T result = (T) responseData; - string rawContent = await response.Content.ReadAsStringAsync(); + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) { @@ -511,10 +511,10 @@ namespace Org.OpenAPITools.Client if (!response.IsSuccessStatusCode) { - return await ToApiResponse(response, default(T), req.RequestUri); + return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); } - object responseData = await deserializer.Deserialize(response); + object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) @@ -523,12 +523,12 @@ namespace Org.OpenAPITools.Client } else if (typeof(T).Name == "Stream") // for binary response { - responseData = (T) (object) await response.Content.ReadAsStreamAsync(); + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); } InterceptResponse(req, response); - return await ToApiResponse(response, responseData, req.RequestUri); + return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); } catch (OperationCanceledException original) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ClientUtils.cs index 608bdbc195a..85ec4341271 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Activity.cs index a883381f9c7..f80ff387681 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Activity.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 065c023d0a5..383824e58c7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index fb0eca6557b..78209b634de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -216,7 +216,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs index dc511478a57..b770a965366 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs @@ -50,7 +50,7 @@ namespace Org.OpenAPITools.Model /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className = default(string), string color = @"red") { // to ensure "className" is required (not null) if (className == null) @@ -59,7 +59,7 @@ namespace Org.OpenAPITools.Model } this.ClassName = className; // use default value if no "color" provided - this.Color = color ?? "red"; + this.Color = color ?? @"red"; this.AdditionalProperties = new Dictionary(); } @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ApiResponse.cs index 0bf23edced7..78d6bab5e0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs index 26fb7d71d1c..d410331bf57 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs @@ -137,17 +137,17 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs index d0a4bdb172a..ba8e82f6561 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,7 +132,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 3de85f7f649..df188f37a56 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8fad145c570..81c92eaa9e3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayTest.cs index 7c9c235507a..8a23557a185 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Banana.cs index 8b340fae031..451d86897cc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Banana.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BananaReq.cs index 382f8f954fa..56437177c9b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BananaReq.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs index 8e890c68788..715b02a0cb5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Capitalization.cs index 463d63a939f..39630f97eee 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Capitalization.cs @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Cat.cs index e151f038ad2..29f8e087632 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Cat.cs @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// declawed. /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = @"Cat", string color = @"red") : base(className, color) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/CatAllOf.cs index d126477f736..038506f5d04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs index 7a758fc8b15..92158e22999 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + public Category(long id = default(long), string name = @"default-name") { // to ensure "name" is required (not null) if (name == null) @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCat.cs index 4a7f278731c..b4cfff038b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCat.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index f2ae1bcb054..d4f4abb0d22 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -148,7 +148,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ClassModel.cs index 66db9245d6b..376386e55f7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ClassModel.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 2a964cfe403..15f0ce0a64f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs index 6449d058967..e10104c287d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DateOnlyClass.cs index fb83bbebf29..6c50d6900df 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -46,6 +46,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime DateOnlyProperty { get; set; } @@ -125,7 +126,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DeprecatedObject.cs index afd96916888..3e364cc0c6f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Dog.cs index 10944760277..79791c62e40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Dog.cs @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// breed. /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = @"Dog", string color = @"red") : base(className, color) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DogAllOf.cs index 7d6c49788a0..d8d2c3c4da6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Drawing.cs index 7610f5c3bc1..ae441f94c69 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Drawing.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumArrays.cs index 5f374bada4a..5469bad8be9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumTest.cs index fc83b2c83ca..c97d7df08b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -315,7 +315,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index d5fe6f8caa6..0220beeae23 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/File.cs index 36418ba1676..089499517dc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/File.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 13d9f45e3f2..ff5e44d98a4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Foo.cs index c42991826b1..0622c6e23b5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Foo.cs @@ -37,10 +37,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// bar (default to "bar"). - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { // use default value if no "bar" provided - this.Bar = bar ?? "bar"; + this.Bar = bar ?? @"bar"; this.AdditionalProperties = new Dictionary(); } @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 7cb14a9934b..17b4937d0cc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs index 5603e75631c..b905f6c9526 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -46,7 +46,9 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// unsignedInteger. /// int64. + /// unsignedLong. /// number (required). /// _float. /// _double. @@ -60,7 +62,7 @@ namespace Org.OpenAPITools.Model /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), FileParameter binary = default(FileParameter), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), FileParameter binary = default(FileParameter), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { this.Number = number; // to ensure "_byte" is required (not null) @@ -78,7 +80,9 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.UnsignedInteger = unsignedInteger; this.Int64 = int64; + this.UnsignedLong = unsignedLong; this.Float = _float; this.Double = _double; this.Decimal = _decimal; @@ -103,12 +107,24 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] + public uint UnsignedInteger { get; set; } + /// /// Gets or Sets Int64 /// [DataMember(Name = "int64", EmitDefaultValue = false)] public long Int64 { get; set; } + /// + /// Gets or Sets UnsignedLong + /// + [DataMember(Name = "unsigned_long", EmitDefaultValue = false)] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Number /// @@ -154,6 +170,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime Date { get; set; } @@ -161,12 +178,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [DataMember(Name = "dateTime", EmitDefaultValue = false)] public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { get; set; } @@ -206,7 +225,9 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); @@ -265,7 +286,9 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); @@ -319,7 +342,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) @@ -345,6 +368,18 @@ namespace Org.OpenAPITools.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + // Number (decimal) maximum if (this.Number > (decimal)543.2) { @@ -382,7 +417,7 @@ namespace Org.OpenAPITools.Model } // String (string) pattern - Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); @@ -401,14 +436,14 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 4936fff7607..fcbed17b423 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -141,7 +141,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 18b30851956..79815e1812e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 0764cab0edf..c65fbeef844 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 2028dbe7227..efdc5b988c8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/List.cs index 9610ab8c272..0b82ae2a68f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/List.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..eaa4c72410f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,148 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Org.OpenAPITools.Client.FileParameter; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + [DataContract(Name = "LiteralStringClass")] + public partial class LiteralStringClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username"). + /// unescapedLiteralString (default to "C:\Users\username"). + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + // use default value if no "escapedLiteralString" provided + this.EscapedLiteralString = escapedLiteralString ?? @"C:\\Users\\username"; + // use default value if no "unescapedLiteralString" provided + this.UnescapedLiteralString = unescapedLiteralString ?? @"C:\Users\username"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [DataMember(Name = "escapedLiteralString", EmitDefaultValue = false)] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [DataMember(Name = "unescapedLiteralString", EmitDefaultValue = false)] + public string UnescapedLiteralString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as LiteralStringClass).AreEqual; + } + + /// + /// Returns true if LiteralStringClass instances are equal + /// + /// Instance of LiteralStringClass to be compared + /// Boolean + public bool Equals(LiteralStringClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EscapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.EscapedLiteralString.GetHashCode(); + } + if (this.UnescapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.UnescapedLiteralString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MapTest.cs index 9685a3a04da..a75de13c487 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MapTest.cs @@ -183,7 +183,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index ab33594b0e2..8d0985961a8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -163,10 +163,10 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Model200Response.cs index 1f636909766..8a418ebc73f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Model200Response.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ModelClient.cs index 564fedf5ae4..e9371830487 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ModelClient.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Name.cs index 22cd8a4dccb..0b13d4f392f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Name.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableClass.cs index 0b61fdc69e6..e0973555e3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableClass.cs @@ -257,7 +257,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableGuidClass.cs index b3f48fcc200..393c9fd8d14 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -46,6 +46,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = true)] public Guid? Uuid { get; set; } @@ -124,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NumberOnly.cs index e4f90a8e77b..8b4bd992e77 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index c313e46180f..34c6090d7fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Order.cs index 5dbf90d5ef3..befa21e3211 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Order.cs @@ -108,6 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [DataMember(Name = "shipDate", EmitDefaultValue = false)] public DateTime ShipDate { get; set; } @@ -202,7 +203,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/OuterComposite.cs index 2351bbd1e53..2950ad95a56 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -144,7 +144,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ParentPet.cs index b717f6edf83..9f866c87f8b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ParentPet.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// petType (required) (default to "ParentPet"). - public ParentPet(string petType = "ParentPet") : base(petType) + public ParentPet(string petType = @"ParentPet") : base(petType) { this.AdditionalProperties = new Dictionary(); } @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs index 7b574d48283..203a102be55 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs @@ -120,6 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } @@ -229,7 +230,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 649ca6451cf..f198bec3257 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 81adfe7489b..89f41da2fbe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Return.cs index b08ff811705..5c2685ac2a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Return.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 5cb4a808c80..3d10531a27b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs index 780b249dbc6..096d9e7b33c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 051e10685d3..811b72e4cdd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SpecialModelName.cs index d35b2d2d298..7894796d308 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Tag.cs index 3323ce57e28..de31cf796c3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Tag.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..e2d620fa1c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,133 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Org.OpenAPITools.Client.FileParameter; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + [DataContract(Name = "TestCollectionEndingWithWordList")] + public partial class TestCollectionEndingWithWordList : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public TestCollectionEndingWithWordList(string value = default(string)) + { + this.Value = value; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordList).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordList instances are equal + /// + /// Instance of TestCollectionEndingWithWordList to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordList input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..36ebfc80f52 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,133 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Org.OpenAPITools.Client.FileParameter; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + [DataContract(Name = "TestCollectionEndingWithWordListObject")] + public partial class TestCollectionEndingWithWordListObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList. + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList = default(List)) + { + this.TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [DataMember(Name = "TestCollectionEndingWithWordList", EmitDefaultValue = false)] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordListObject).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordListObject instances are equal + /// + /// Instance of TestCollectionEndingWithWordListObject to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordListObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TestCollectionEndingWithWordList != null) + { + hashCode = (hashCode * 59) + this.TestCollectionEndingWithWordList.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs index 2c21c7de838..be6a19dd7a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/User.cs index d099e469095..1185416ea8b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/User.cs @@ -266,7 +266,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs index a4d2c9e820c..27581a3e514 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs index 533d9487bba..f5e625bf80a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 16fc25de9b9..c3a5ce9403f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/FILES index 733114e3828..838976ae425 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/Activity.md docs/ActivityOutputElementRepresentation.md @@ -50,6 +51,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/List.md +docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -84,6 +86,8 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -164,6 +168,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -196,6 +201,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md index 5dae7e02093..49208c7379d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md @@ -118,6 +118,7 @@ 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 | *DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello *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 | @@ -204,6 +205,7 @@ Class | Method | HTTP request | Description - [Model.HealthCheckResult](docs/HealthCheckResult.md) - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Model.List](docs/List.md) + - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -236,6 +238,8 @@ Class | Method | HTTP request | Description - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/DefaultApi.md index 265fec1a6f9..72d1733f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient-net47/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FormatTest.md index 39a70be7ad4..1664a9d7c72 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FormatTest.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/LiteralStringClass.md new file mode 100644 index 00000000000..6d3e0d50c1f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient-net47/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..0e5568637b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-net47/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..7213b3ca8d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..74dc17b9f4a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -0,0 +1,77 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..4def0dcda9c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e9df66daf2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 5fa12ee8933..5d7666a5560 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs index 0ae306612df..1b487bc9248 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -65,6 +65,27 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse GetCountryWithHttpInfo(string country, int operationIndex = 0); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + List Hello(int operationIndex = 0); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + ApiResponse> HelloWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -122,6 +143,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -510,5 +554,131 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + public List Hello(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = HelloWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + public Org.OpenAPITools.Client.ApiResponse> HelloWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/hello", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await HelloWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/hello", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index 8b0ba33499b..f64cfebe67d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); + var response = await client.PostAsync(request).ConfigureAwait(false); return $"{response.TokenType} {response.AccessToken}"; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ClientUtils.cs index 608bdbc195a..85ec4341271 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Activity.cs index 38f1573adb2..3c5a860dd89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Activity.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 59a301721b2..0640bc68500 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b3ddad35a07..ddec6a58568 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs index 83397018b70..78077d2bed4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className = default(string), string color = @"red") { // to ensure "className" is required (not null) if (className == null) @@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Model } this.ClassName = className; // use default value if no "color" provided - this.Color = color ?? "red"; + this.Color = color ?? @"red"; this.AdditionalProperties = new Dictionary(); } @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ApiResponse.cs index 79873f4ddfe..6d70e97a51c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs index 8b1f87d1aa9..c8ffe52a70a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs @@ -136,17 +136,17 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs index 9e09e2da8ce..16df556db5d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 30bf57ef0f5..06e930e774c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8a215aad133..da8a65b26f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayTest.cs index 1a879a1d9ca..3e823100067 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Banana.cs index 97939597ede..70aeea02471 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Banana.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BananaReq.cs index 3edb9a1b6dc..6a4edb3394d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs index f65f049cfd9..838f5741cf6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Capitalization.cs index be68a50a116..bd317ad8747 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Capitalization.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Cat.cs index 86ceaeed1ab..49a0dc8ada3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Cat.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// declawed. /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = @"Cat", string color = @"red") : base(className, color) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/CatAllOf.cs index 3a960e9925e..8fcdcaf5342 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs index 94dea2b30bb..2313431e4d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + public Category(long id = default(long), string name = @"default-name") { // to ensure "name" is required (not null) if (name == null) @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCat.cs index 2aa81264fad..8ba9f729c01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCat.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a353ad7ffd7..efff1d70557 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ClassModel.cs index 7177e9bf0b6..59c85f3e79b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ClassModel.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 353ea1d081e..4c1b999c7f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs index d86ff21df9b..3c1138fe977 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 977c8ed7863..c30936b9684 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime DateOnlyProperty { get; set; } @@ -124,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1928b236bf6..1a6841a713c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Dog.cs index 786270d1c4d..32f2bbd7fa7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Dog.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// breed. /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = @"Dog", string color = @"red") : base(className, color) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DogAllOf.cs index 7b026acbf1e..e82743a7151 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Drawing.cs index d8cd2a70ef6..0a759b37b3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Drawing.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumArrays.cs index 69568d6c87d..08214dd22b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumTest.cs index 7386cffd37d..02e7580cdcf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumTest.cs @@ -314,7 +314,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 773eba5b0a2..ab16133fe4b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/File.cs index e77d15e06bc..cf3b18a81c8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/File.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 6808978c49f..ae9d8e1c05a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Foo.cs index e64aac7b631..570e3de7f65 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Foo.cs @@ -36,10 +36,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// bar (default to "bar"). - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { // use default value if no "bar" provided - this.Bar = bar ?? "bar"; + this.Bar = bar ?? @"bar"; this.AdditionalProperties = new Dictionary(); } @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 259e5e626df..70554062020 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs index 9d0979b6f71..c3fa57791cf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs @@ -45,7 +45,9 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// unsignedInteger. /// int64. + /// unsignedLong. /// number (required). /// _float. /// _double. @@ -59,7 +61,7 @@ namespace Org.OpenAPITools.Model /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { this.Number = number; // to ensure "_byte" is required (not null) @@ -77,7 +79,9 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.UnsignedInteger = unsignedInteger; this.Int64 = int64; + this.UnsignedLong = unsignedLong; this.Float = _float; this.Double = _double; this.Decimal = _decimal; @@ -102,12 +106,24 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] + public uint UnsignedInteger { get; set; } + /// /// Gets or Sets Int64 /// [DataMember(Name = "int64", EmitDefaultValue = false)] public long Int64 { get; set; } + /// + /// Gets or Sets UnsignedLong + /// + [DataMember(Name = "unsigned_long", EmitDefaultValue = false)] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Number /// @@ -153,6 +169,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime Date { get; set; } @@ -160,12 +177,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [DataMember(Name = "dateTime", EmitDefaultValue = false)] public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { get; set; } @@ -205,7 +224,9 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); @@ -264,7 +285,9 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); @@ -318,7 +341,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) @@ -344,6 +367,18 @@ namespace Org.OpenAPITools.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + // Number (decimal) maximum if (this.Number > (decimal)543.2) { @@ -381,7 +416,7 @@ namespace Org.OpenAPITools.Model } // String (string) pattern - Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); @@ -400,14 +435,14 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Fruit.cs index 726b1e8f72e..c2199aefd08 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Fruit.cs @@ -87,26 +87,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, - /// the InvalidClassException will be thrown - /// - /// An instance of Apple - public Apple GetApple() - { - return (Apple)this.ActualInstance; - } - - /// - /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, - /// the InvalidClassException will be thrown - /// - /// An instance of Banana - public Banana GetBanana() - { - return (Banana)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FruitReq.cs index 548da490def..125ac4f8a3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FruitReq.cs @@ -96,26 +96,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, - /// the InvalidClassException will be thrown - /// - /// An instance of AppleReq - public AppleReq GetAppleReq() - { - return (AppleReq)this.ActualInstance; - } - - /// - /// Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, - /// the InvalidClassException will be thrown - /// - /// An instance of BananaReq - public BananaReq GetBananaReq() - { - return (BananaReq)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 28e7729a175..8ca8d20eb0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 52099a7095e..2d4a1cd404f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HealthCheckResult.cs index e8cbb68e2e4..77ad8860aec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index ea18925f87e..3d5a1ff7ad8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/List.cs index 00814d11069..8933b19e210 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/List.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..3efdf123845 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,147 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + [DataContract(Name = "LiteralStringClass")] + public partial class LiteralStringClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username"). + /// unescapedLiteralString (default to "C:\Users\username"). + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + // use default value if no "escapedLiteralString" provided + this.EscapedLiteralString = escapedLiteralString ?? @"C:\\Users\\username"; + // use default value if no "unescapedLiteralString" provided + this.UnescapedLiteralString = unescapedLiteralString ?? @"C:\Users\username"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [DataMember(Name = "escapedLiteralString", EmitDefaultValue = false)] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [DataMember(Name = "unescapedLiteralString", EmitDefaultValue = false)] + public string UnescapedLiteralString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as LiteralStringClass).AreEqual; + } + + /// + /// Returns true if LiteralStringClass instances are equal + /// + /// Instance of LiteralStringClass to be compared + /// Boolean + public bool Equals(LiteralStringClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EscapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.EscapedLiteralString.GetHashCode(); + } + if (this.UnescapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.UnescapedLiteralString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Mammal.cs index 8630f21bba4..1fde96c460b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Mammal.cs @@ -104,36 +104,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `Whale`. If the actual instance is not `Whale`, - /// the InvalidClassException will be thrown - /// - /// An instance of Whale - public Whale GetWhale() - { - return (Whale)this.ActualInstance; - } - - /// - /// Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, - /// the InvalidClassException will be thrown - /// - /// An instance of Zebra - public Zebra GetZebra() - { - return (Zebra)this.ActualInstance; - } - - /// - /// Get the actual instance of `Pig`. If the actual instance is not `Pig`, - /// the InvalidClassException will be thrown - /// - /// An instance of Pig - public Pig GetPig() - { - return (Pig)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MapTest.cs index b2aeedc33ce..424a81efceb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MapTest.cs @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 2a0e96d6bc0..01215c65971 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -162,10 +162,10 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Model200Response.cs index 79a49ef91d2..72383f9de33 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Model200Response.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ModelClient.cs index 1995ec4b169..d9a94592395 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ModelClient.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Name.cs index 1d4e7605066..515b498cb5b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Name.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableClass.cs index 57555c37678..f2d06d7f2a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableClass.cs @@ -256,7 +256,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 9184756cb73..b8bb2b7bcf3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = true)] public Guid? Uuid { get; set; } @@ -123,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableShape.cs index 01cedb8807b..27eed4515c1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableShape.cs @@ -97,26 +97,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, - /// the InvalidClassException will be thrown - /// - /// An instance of Triangle - public Triangle GetTriangle() - { - return (Triangle)this.ActualInstance; - } - - /// - /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, - /// the InvalidClassException will be thrown - /// - /// An instance of Quadrilateral - public Quadrilateral GetQuadrilateral() - { - return (Quadrilateral)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NumberOnly.cs index 0331e1c8db8..d25f420362e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 86ea32998f8..14022ef06ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Order.cs index 5c52482e79b..3f5b1d5f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Order.cs @@ -107,6 +107,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [DataMember(Name = "shipDate", EmitDefaultValue = false)] public DateTime ShipDate { get; set; } @@ -201,7 +202,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/OuterComposite.cs index 3209f6d6244..42ddbc5c56f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ParentPet.cs index 49bed679864..769c3612f3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ParentPet.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// petType (required) (default to "ParentPet"). - public ParentPet(string petType = "ParentPet") : base(petType) + public ParentPet(string petType = @"ParentPet") : base(petType) { this.AdditionalProperties = new Dictionary(); } @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs index 0e6f950d7f9..9e624788f76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs @@ -119,6 +119,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } @@ -228,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pig.cs index c599574b1ce..e6efb45fdf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pig.cs @@ -88,26 +88,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, - /// the InvalidClassException will be thrown - /// - /// An instance of BasquePig - public BasquePig GetBasquePig() - { - return (BasquePig)this.ActualInstance; - } - - /// - /// Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, - /// the InvalidClassException will be thrown - /// - /// An instance of DanishPig - public DanishPig GetDanishPig() - { - return (DanishPig)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 0ce4e18eb2e..35df3197770 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -119,46 +119,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `bool`. If the actual instance is not `bool`, - /// the InvalidClassException will be thrown - /// - /// An instance of bool - public bool GetBool() - { - return (bool)this.ActualInstance; - } - - /// - /// Get the actual instance of `string`. If the actual instance is not `string`, - /// the InvalidClassException will be thrown - /// - /// An instance of string - public string GetString() - { - return (string)this.ActualInstance; - } - - /// - /// Get the actual instance of `Object`. If the actual instance is not `Object`, - /// the InvalidClassException will be thrown - /// - /// An instance of Object - public Object GetObject() - { - return (Object)this.ActualInstance; - } - - /// - /// Get the actual instance of `List<string>`. If the actual instance is not `List<string>`, - /// the InvalidClassException will be thrown - /// - /// An instance of List<string> - public List GetListString() - { - return (List)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Quadrilateral.cs index 2e4fc5cb041..8a9ed990945 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -88,26 +88,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, - /// the InvalidClassException will be thrown - /// - /// An instance of SimpleQuadrilateral - public SimpleQuadrilateral GetSimpleQuadrilateral() - { - return (SimpleQuadrilateral)this.ActualInstance; - } - - /// - /// Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, - /// the InvalidClassException will be thrown - /// - /// An instance of ComplexQuadrilateral - public ComplexQuadrilateral GetComplexQuadrilateral() - { - return (ComplexQuadrilateral)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index d5be5ea3c92..9f2f3d60b1f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index ad59ca83286..233a10492f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Return.cs index e702e015703..c6edbea2f71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Return.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 236020031e6..f50d01492be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Shape.cs index bc73c0d68a7..466c0ccd3e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Shape.cs @@ -88,26 +88,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, - /// the InvalidClassException will be thrown - /// - /// An instance of Triangle - public Triangle GetTriangle() - { - return (Triangle)this.ActualInstance; - } - - /// - /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, - /// the InvalidClassException will be thrown - /// - /// An instance of Quadrilateral - public Quadrilateral GetQuadrilateral() - { - return (Quadrilateral)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs index c9294b0b4e5..c03107d52ee 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeOrNull.cs index a6d3624c26f..aa1fb62e47f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -97,26 +97,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, - /// the InvalidClassException will be thrown - /// - /// An instance of Triangle - public Triangle GetTriangle() - { - return (Triangle)this.ActualInstance; - } - - /// - /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, - /// the InvalidClassException will be thrown - /// - /// An instance of Quadrilateral - public Quadrilateral GetQuadrilateral() - { - return (Quadrilateral)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 59397bf30fc..f589c821c40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7800467822e..fd741fa9e1a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Tag.cs index 3df2c02e2ce..ec78b91f125 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Tag.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..b89ff43ced7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + [DataContract(Name = "TestCollectionEndingWithWordList")] + public partial class TestCollectionEndingWithWordList : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public TestCollectionEndingWithWordList(string value = default(string)) + { + this.Value = value; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordList).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordList instances are equal + /// + /// Instance of TestCollectionEndingWithWordList to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordList input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..54d4db6cf28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + [DataContract(Name = "TestCollectionEndingWithWordListObject")] + public partial class TestCollectionEndingWithWordListObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList. + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList = default(List)) + { + this.TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [DataMember(Name = "TestCollectionEndingWithWordList", EmitDefaultValue = false)] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordListObject).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordListObject instances are equal + /// + /// Instance of TestCollectionEndingWithWordListObject to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordListObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TestCollectionEndingWithWordList != null) + { + hashCode = (hashCode * 59) + this.TestCollectionEndingWithWordList.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Triangle.cs index a68563c154d..27730f8acad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Triangle.cs @@ -104,36 +104,6 @@ namespace Org.OpenAPITools.Model } } - /// - /// Get the actual instance of `EquilateralTriangle`. If the actual instance is not `EquilateralTriangle`, - /// the InvalidClassException will be thrown - /// - /// An instance of EquilateralTriangle - public EquilateralTriangle GetEquilateralTriangle() - { - return (EquilateralTriangle)this.ActualInstance; - } - - /// - /// Get the actual instance of `IsoscelesTriangle`. If the actual instance is not `IsoscelesTriangle`, - /// the InvalidClassException will be thrown - /// - /// An instance of IsoscelesTriangle - public IsoscelesTriangle GetIsoscelesTriangle() - { - return (IsoscelesTriangle)this.ActualInstance; - } - - /// - /// Get the actual instance of `ScaleneTriangle`. If the actual instance is not `ScaleneTriangle`, - /// the InvalidClassException will be thrown - /// - /// An instance of ScaleneTriangle - public ScaleneTriangle GetScaleneTriangle() - { - return (ScaleneTriangle)this.ActualInstance; - } - /// /// Returns the string presentation of the object /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs index cdf2bd1f0f9..1c85da68ec7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/User.cs index 5f2a3020c3d..8744ceac5ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/User.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs index 62ae66415f1..c4ae8981958 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs @@ -156,7 +156,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs index 8a3c713fe6b..2cd7c3f946d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj index caabb448dbf..85b203f7dcb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/.openapi-generator/FILES index 733114e3828..838976ae425 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/Activity.md docs/ActivityOutputElementRepresentation.md @@ -50,6 +51,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/List.md +docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -84,6 +86,8 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -164,6 +168,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -196,6 +201,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/README.md index 5dae7e02093..49208c7379d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/README.md @@ -118,6 +118,7 @@ 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 | *DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello *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 | @@ -204,6 +205,7 @@ Class | Method | HTTP request | Description - [Model.HealthCheckResult](docs/HealthCheckResult.md) - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Model.List](docs/List.md) + - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -236,6 +238,8 @@ Class | Method | HTTP request | Description - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/DefaultApi.md index 265fec1a6f9..72d1733f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient-net48/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/FormatTest.md index 39a70be7ad4..1664a9d7c72 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/FormatTest.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/LiteralStringClass.md new file mode 100644 index 00000000000..6d3e0d50c1f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient-net48/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..0e5568637b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-net48/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..7213b3ca8d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..74dc17b9f4a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -0,0 +1,77 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..4def0dcda9c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e9df66daf2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 8dd131b6d22..01b4744bdb6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Api/DefaultApi.cs index 0ae306612df..1b487bc9248 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -65,6 +65,27 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse GetCountryWithHttpInfo(string country, int operationIndex = 0); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + List Hello(int operationIndex = 0); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + ApiResponse> HelloWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -122,6 +143,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -510,5 +554,131 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + public List Hello(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = HelloWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + public Org.OpenAPITools.Client.ApiResponse> HelloWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/hello", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await HelloWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/hello", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index 8b0ba33499b..f64cfebe67d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); + var response = await client.PostAsync(request).ConfigureAwait(false); return $"{response.TokenType} {response.AccessToken}"; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Client/ClientUtils.cs index 608bdbc195a..85ec4341271 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Activity.cs index 38f1573adb2..3c5a860dd89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Activity.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 59a301721b2..0640bc68500 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b3ddad35a07..ddec6a58568 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Animal.cs index 83397018b70..78077d2bed4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Animal.cs @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className = default(string), string color = @"red") { // to ensure "className" is required (not null) if (className == null) @@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Model } this.ClassName = className; // use default value if no "color" provided - this.Color = color ?? "red"; + this.Color = color ?? @"red"; this.AdditionalProperties = new Dictionary(); } @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ApiResponse.cs index 79873f4ddfe..6d70e97a51c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Apple.cs index 8b1f87d1aa9..c8ffe52a70a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Apple.cs @@ -136,17 +136,17 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/AppleReq.cs index 9e09e2da8ce..16df556db5d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 30bf57ef0f5..06e930e774c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8a215aad133..da8a65b26f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayTest.cs index 1a879a1d9ca..3e823100067 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Banana.cs index 97939597ede..70aeea02471 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Banana.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/BananaReq.cs index 3edb9a1b6dc..6a4edb3394d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/BasquePig.cs index f65f049cfd9..838f5741cf6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/BasquePig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Capitalization.cs index be68a50a116..bd317ad8747 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Capitalization.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Cat.cs index 86ceaeed1ab..49a0dc8ada3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Cat.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// declawed. /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = @"Cat", string color = @"red") : base(className, color) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/CatAllOf.cs index 3a960e9925e..8fcdcaf5342 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Category.cs index 94dea2b30bb..2313431e4d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Category.cs @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + public Category(long id = default(long), string name = @"default-name") { // to ensure "name" is required (not null) if (name == null) @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ChildCat.cs index 2aa81264fad..8ba9f729c01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ChildCat.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a353ad7ffd7..efff1d70557 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ClassModel.cs index 7177e9bf0b6..59c85f3e79b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ClassModel.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 353ea1d081e..4c1b999c7f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DanishPig.cs index d86ff21df9b..3c1138fe977 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DanishPig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 977c8ed7863..c30936b9684 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime DateOnlyProperty { get; set; } @@ -124,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1928b236bf6..1a6841a713c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Dog.cs index 786270d1c4d..32f2bbd7fa7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Dog.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// breed. /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = @"Dog", string color = @"red") : base(className, color) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DogAllOf.cs index 7b026acbf1e..e82743a7151 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Drawing.cs index d8cd2a70ef6..0a759b37b3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Drawing.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EnumArrays.cs index 69568d6c87d..08214dd22b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EnumTest.cs index 7386cffd37d..02e7580cdcf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EnumTest.cs @@ -314,7 +314,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 773eba5b0a2..ab16133fe4b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/File.cs index e77d15e06bc..cf3b18a81c8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/File.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 6808978c49f..ae9d8e1c05a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Foo.cs index e64aac7b631..570e3de7f65 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Foo.cs @@ -36,10 +36,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// bar (default to "bar"). - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { // use default value if no "bar" provided - this.Bar = bar ?? "bar"; + this.Bar = bar ?? @"bar"; this.AdditionalProperties = new Dictionary(); } @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 259e5e626df..70554062020 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FormatTest.cs index 9d0979b6f71..c3fa57791cf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FormatTest.cs @@ -45,7 +45,9 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// unsignedInteger. /// int64. + /// unsignedLong. /// number (required). /// _float. /// _double. @@ -59,7 +61,7 @@ namespace Org.OpenAPITools.Model /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { this.Number = number; // to ensure "_byte" is required (not null) @@ -77,7 +79,9 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.UnsignedInteger = unsignedInteger; this.Int64 = int64; + this.UnsignedLong = unsignedLong; this.Float = _float; this.Double = _double; this.Decimal = _decimal; @@ -102,12 +106,24 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] + public uint UnsignedInteger { get; set; } + /// /// Gets or Sets Int64 /// [DataMember(Name = "int64", EmitDefaultValue = false)] public long Int64 { get; set; } + /// + /// Gets or Sets UnsignedLong + /// + [DataMember(Name = "unsigned_long", EmitDefaultValue = false)] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Number /// @@ -153,6 +169,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime Date { get; set; } @@ -160,12 +177,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [DataMember(Name = "dateTime", EmitDefaultValue = false)] public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { get; set; } @@ -205,7 +224,9 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); @@ -264,7 +285,9 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); @@ -318,7 +341,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) @@ -344,6 +367,18 @@ namespace Org.OpenAPITools.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + // Number (decimal) maximum if (this.Number > (decimal)543.2) { @@ -381,7 +416,7 @@ namespace Org.OpenAPITools.Model } // String (string) pattern - Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); @@ -400,14 +435,14 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 28e7729a175..8ca8d20eb0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 52099a7095e..2d4a1cd404f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/HealthCheckResult.cs index e8cbb68e2e4..77ad8860aec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index ea18925f87e..3d5a1ff7ad8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/List.cs index 00814d11069..8933b19e210 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/List.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..3efdf123845 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,147 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + [DataContract(Name = "LiteralStringClass")] + public partial class LiteralStringClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username"). + /// unescapedLiteralString (default to "C:\Users\username"). + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + // use default value if no "escapedLiteralString" provided + this.EscapedLiteralString = escapedLiteralString ?? @"C:\\Users\\username"; + // use default value if no "unescapedLiteralString" provided + this.UnescapedLiteralString = unescapedLiteralString ?? @"C:\Users\username"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [DataMember(Name = "escapedLiteralString", EmitDefaultValue = false)] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [DataMember(Name = "unescapedLiteralString", EmitDefaultValue = false)] + public string UnescapedLiteralString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as LiteralStringClass).AreEqual; + } + + /// + /// Returns true if LiteralStringClass instances are equal + /// + /// Instance of LiteralStringClass to be compared + /// Boolean + public bool Equals(LiteralStringClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EscapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.EscapedLiteralString.GetHashCode(); + } + if (this.UnescapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.UnescapedLiteralString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MapTest.cs index b2aeedc33ce..424a81efceb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MapTest.cs @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 2a0e96d6bc0..01215c65971 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -162,10 +162,10 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Model200Response.cs index 79a49ef91d2..72383f9de33 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Model200Response.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ModelClient.cs index 1995ec4b169..d9a94592395 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ModelClient.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Name.cs index 1d4e7605066..515b498cb5b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Name.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NullableClass.cs index 57555c37678..f2d06d7f2a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NullableClass.cs @@ -256,7 +256,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 9184756cb73..b8bb2b7bcf3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = true)] public Guid? Uuid { get; set; } @@ -123,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NumberOnly.cs index 0331e1c8db8..d25f420362e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 86ea32998f8..14022ef06ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Order.cs index 5c52482e79b..3f5b1d5f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Order.cs @@ -107,6 +107,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [DataMember(Name = "shipDate", EmitDefaultValue = false)] public DateTime ShipDate { get; set; } @@ -201,7 +202,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/OuterComposite.cs index 3209f6d6244..42ddbc5c56f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ParentPet.cs index 49bed679864..769c3612f3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ParentPet.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// petType (required) (default to "ParentPet"). - public ParentPet(string petType = "ParentPet") : base(petType) + public ParentPet(string petType = @"ParentPet") : base(petType) { this.AdditionalProperties = new Dictionary(); } @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Pet.cs index 0e6f950d7f9..9e624788f76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Pet.cs @@ -119,6 +119,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } @@ -228,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index d5be5ea3c92..9f2f3d60b1f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index ad59ca83286..233a10492f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Return.cs index e702e015703..c6edbea2f71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Return.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 236020031e6..f50d01492be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ShapeInterface.cs index c9294b0b4e5..c03107d52ee 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 59397bf30fc..f589c821c40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7800467822e..fd741fa9e1a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Tag.cs index 3df2c02e2ce..ec78b91f125 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Tag.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..b89ff43ced7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + [DataContract(Name = "TestCollectionEndingWithWordList")] + public partial class TestCollectionEndingWithWordList : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public TestCollectionEndingWithWordList(string value = default(string)) + { + this.Value = value; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordList).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordList instances are equal + /// + /// Instance of TestCollectionEndingWithWordList to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordList input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..54d4db6cf28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + [DataContract(Name = "TestCollectionEndingWithWordListObject")] + public partial class TestCollectionEndingWithWordListObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList. + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList = default(List)) + { + this.TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [DataMember(Name = "TestCollectionEndingWithWordList", EmitDefaultValue = false)] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordListObject).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordListObject instances are equal + /// + /// Instance of TestCollectionEndingWithWordListObject to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordListObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TestCollectionEndingWithWordList != null) + { + hashCode = (hashCode * 59) + this.TestCollectionEndingWithWordList.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TriangleInterface.cs index cdf2bd1f0f9..1c85da68ec7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/User.cs index 5f2a3020c3d..8744ceac5ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/User.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Whale.cs index 62ae66415f1..c4ae8981958 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Whale.cs @@ -156,7 +156,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Zebra.cs index 8a3c713fe6b..2cd7c3f946d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Zebra.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 62f2be39f35..ea1b60243d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/FILES index 733114e3828..838976ae425 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/Activity.md docs/ActivityOutputElementRepresentation.md @@ -50,6 +51,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/List.md +docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -84,6 +86,8 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -164,6 +168,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -196,6 +201,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md index 5dae7e02093..49208c7379d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md @@ -118,6 +118,7 @@ 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 | *DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello *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 | @@ -204,6 +205,7 @@ Class | Method | HTTP request | Description - [Model.HealthCheckResult](docs/HealthCheckResult.md) - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Model.List](docs/List.md) + - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -236,6 +238,8 @@ Class | Method | HTTP request | Description - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/DefaultApi.md index 265fec1a6f9..72d1733f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient-net5.0/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FormatTest.md index 39a70be7ad4..1664a9d7c72 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FormatTest.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/LiteralStringClass.md new file mode 100644 index 00000000000..6d3e0d50c1f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient-net5.0/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..0e5568637b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-net5.0/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..7213b3ca8d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..74dc17b9f4a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -0,0 +1,77 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..4def0dcda9c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e9df66daf2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index d708a4dd9b0..795c6bf1512 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs index 0ae306612df..1b487bc9248 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -65,6 +65,27 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse GetCountryWithHttpInfo(string country, int operationIndex = 0); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + List Hello(int operationIndex = 0); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + ApiResponse> HelloWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -122,6 +143,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -510,5 +554,131 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + public List Hello(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = HelloWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + public Org.OpenAPITools.Client.ApiResponse> HelloWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/hello", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await HelloWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/hello", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index 8b0ba33499b..f64cfebe67d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); + var response = await client.PostAsync(request).ConfigureAwait(false); return $"{response.TokenType} {response.AccessToken}"; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ClientUtils.cs index 608bdbc195a..85ec4341271 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Activity.cs index 38f1573adb2..3c5a860dd89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Activity.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 59a301721b2..0640bc68500 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b3ddad35a07..ddec6a58568 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs index 83397018b70..78077d2bed4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className = default(string), string color = @"red") { // to ensure "className" is required (not null) if (className == null) @@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Model } this.ClassName = className; // use default value if no "color" provided - this.Color = color ?? "red"; + this.Color = color ?? @"red"; this.AdditionalProperties = new Dictionary(); } @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ApiResponse.cs index 79873f4ddfe..6d70e97a51c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs index 8b1f87d1aa9..c8ffe52a70a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs @@ -136,17 +136,17 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs index 9e09e2da8ce..16df556db5d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 30bf57ef0f5..06e930e774c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8a215aad133..da8a65b26f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayTest.cs index 1a879a1d9ca..3e823100067 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Banana.cs index 97939597ede..70aeea02471 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Banana.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BananaReq.cs index 3edb9a1b6dc..6a4edb3394d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs index f65f049cfd9..838f5741cf6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Capitalization.cs index be68a50a116..bd317ad8747 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Cat.cs index 86ceaeed1ab..49a0dc8ada3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Cat.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// declawed. /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = @"Cat", string color = @"red") : base(className, color) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/CatAllOf.cs index 3a960e9925e..8fcdcaf5342 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs index 94dea2b30bb..2313431e4d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + public Category(long id = default(long), string name = @"default-name") { // to ensure "name" is required (not null) if (name == null) @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCat.cs index 2aa81264fad..8ba9f729c01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCat.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a353ad7ffd7..efff1d70557 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ClassModel.cs index 7177e9bf0b6..59c85f3e79b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 353ea1d081e..4c1b999c7f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs index d86ff21df9b..3c1138fe977 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 977c8ed7863..c30936b9684 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime DateOnlyProperty { get; set; } @@ -124,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1928b236bf6..1a6841a713c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Dog.cs index 786270d1c4d..32f2bbd7fa7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Dog.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// breed. /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = @"Dog", string color = @"red") : base(className, color) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DogAllOf.cs index 7b026acbf1e..e82743a7151 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Drawing.cs index d8cd2a70ef6..0a759b37b3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumArrays.cs index 69568d6c87d..08214dd22b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumTest.cs index 7386cffd37d..02e7580cdcf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -314,7 +314,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 773eba5b0a2..ab16133fe4b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/File.cs index e77d15e06bc..cf3b18a81c8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/File.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 6808978c49f..ae9d8e1c05a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Foo.cs index e64aac7b631..570e3de7f65 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Foo.cs @@ -36,10 +36,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// bar (default to "bar"). - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { // use default value if no "bar" provided - this.Bar = bar ?? "bar"; + this.Bar = bar ?? @"bar"; this.AdditionalProperties = new Dictionary(); } @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 259e5e626df..70554062020 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs index 9d0979b6f71..c3fa57791cf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -45,7 +45,9 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// unsignedInteger. /// int64. + /// unsignedLong. /// number (required). /// _float. /// _double. @@ -59,7 +61,7 @@ namespace Org.OpenAPITools.Model /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { this.Number = number; // to ensure "_byte" is required (not null) @@ -77,7 +79,9 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.UnsignedInteger = unsignedInteger; this.Int64 = int64; + this.UnsignedLong = unsignedLong; this.Float = _float; this.Double = _double; this.Decimal = _decimal; @@ -102,12 +106,24 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] + public uint UnsignedInteger { get; set; } + /// /// Gets or Sets Int64 /// [DataMember(Name = "int64", EmitDefaultValue = false)] public long Int64 { get; set; } + /// + /// Gets or Sets UnsignedLong + /// + [DataMember(Name = "unsigned_long", EmitDefaultValue = false)] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Number /// @@ -153,6 +169,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime Date { get; set; } @@ -160,12 +177,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [DataMember(Name = "dateTime", EmitDefaultValue = false)] public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { get; set; } @@ -205,7 +224,9 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); @@ -264,7 +285,9 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); @@ -318,7 +341,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) @@ -344,6 +367,18 @@ namespace Org.OpenAPITools.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + // Number (decimal) maximum if (this.Number > (decimal)543.2) { @@ -381,7 +416,7 @@ namespace Org.OpenAPITools.Model } // String (string) pattern - Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); @@ -400,14 +435,14 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 28e7729a175..8ca8d20eb0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 52099a7095e..2d4a1cd404f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs index e8cbb68e2e4..77ad8860aec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index ea18925f87e..3d5a1ff7ad8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/List.cs index 00814d11069..8933b19e210 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/List.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..3efdf123845 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,147 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + [DataContract(Name = "LiteralStringClass")] + public partial class LiteralStringClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username"). + /// unescapedLiteralString (default to "C:\Users\username"). + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + // use default value if no "escapedLiteralString" provided + this.EscapedLiteralString = escapedLiteralString ?? @"C:\\Users\\username"; + // use default value if no "unescapedLiteralString" provided + this.UnescapedLiteralString = unescapedLiteralString ?? @"C:\Users\username"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [DataMember(Name = "escapedLiteralString", EmitDefaultValue = false)] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [DataMember(Name = "unescapedLiteralString", EmitDefaultValue = false)] + public string UnescapedLiteralString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as LiteralStringClass).AreEqual; + } + + /// + /// Returns true if LiteralStringClass instances are equal + /// + /// Instance of LiteralStringClass to be compared + /// Boolean + public bool Equals(LiteralStringClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EscapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.EscapedLiteralString.GetHashCode(); + } + if (this.UnescapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.UnescapedLiteralString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MapTest.cs index b2aeedc33ce..424a81efceb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 2a0e96d6bc0..01215c65971 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -162,10 +162,10 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Model200Response.cs index 79a49ef91d2..72383f9de33 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ModelClient.cs index 1995ec4b169..d9a94592395 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Name.cs index 1d4e7605066..515b498cb5b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Name.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableClass.cs index 57555c37678..f2d06d7f2a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -256,7 +256,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 9184756cb73..b8bb2b7bcf3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = true)] public Guid? Uuid { get; set; } @@ -123,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NumberOnly.cs index 0331e1c8db8..d25f420362e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 86ea32998f8..14022ef06ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Order.cs index 5c52482e79b..3f5b1d5f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Order.cs @@ -107,6 +107,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [DataMember(Name = "shipDate", EmitDefaultValue = false)] public DateTime ShipDate { get; set; } @@ -201,7 +202,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/OuterComposite.cs index 3209f6d6244..42ddbc5c56f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ParentPet.cs index 49bed679864..769c3612f3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ParentPet.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// petType (required) (default to "ParentPet"). - public ParentPet(string petType = "ParentPet") : base(petType) + public ParentPet(string petType = @"ParentPet") : base(petType) { this.AdditionalProperties = new Dictionary(); } @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs index 0e6f950d7f9..9e624788f76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs @@ -119,6 +119,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } @@ -228,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index d5be5ea3c92..9f2f3d60b1f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index ad59ca83286..233a10492f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Return.cs index e702e015703..c6edbea2f71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Return.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 236020031e6..f50d01492be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index c9294b0b4e5..c03107d52ee 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 59397bf30fc..f589c821c40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7800467822e..fd741fa9e1a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Tag.cs index 3df2c02e2ce..ec78b91f125 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Tag.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..b89ff43ced7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + [DataContract(Name = "TestCollectionEndingWithWordList")] + public partial class TestCollectionEndingWithWordList : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public TestCollectionEndingWithWordList(string value = default(string)) + { + this.Value = value; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordList).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordList instances are equal + /// + /// Instance of TestCollectionEndingWithWordList to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordList input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..54d4db6cf28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + [DataContract(Name = "TestCollectionEndingWithWordListObject")] + public partial class TestCollectionEndingWithWordListObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList. + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList = default(List)) + { + this.TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [DataMember(Name = "TestCollectionEndingWithWordList", EmitDefaultValue = false)] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordListObject).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordListObject instances are equal + /// + /// Instance of TestCollectionEndingWithWordListObject to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordListObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TestCollectionEndingWithWordList != null) + { + hashCode = (hashCode * 59) + this.TestCollectionEndingWithWordList.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index cdf2bd1f0f9..1c85da68ec7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/User.cs index 5f2a3020c3d..8744ceac5ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/User.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs index 62ae66415f1..c4ae8981958 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs @@ -156,7 +156,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs index 8a3c713fe6b..2cd7c3f946d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 656e9e0e07d..be69426a99e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.gitignore b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.gitignore similarity index 100% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.gitignore rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.gitignore diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator-ignore rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.openapi-generator-ignore diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.openapi-generator/FILES new file mode 100644 index 00000000000..36ec9d64116 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.openapi-generator/FILES @@ -0,0 +1,207 @@ +.gitignore +README.md +api/openapi.yaml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/BasquePig.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ChildCat.md +docs/ChildCatAllOf.md +docs/ClassModel.md +docs/ComplexQuadrilateral.md +docs/DanishPig.md +docs/DateOnlyClass.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/DogAllOf.md +docs/Drawing.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/EquilateralTriangle.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/IsoscelesTriangle.md +docs/List.md +docs/LiteralStringClass.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NullableClass.md +docs/NullableGuidClass.md +docs/NullableShape.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Pig.md +docs/PolymorphicProperty.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md +docs/Triangle.md +docs/TriangleInterface.md +docs/User.md +docs/UserApi.md +docs/Whale.md +docs/Zebra.md +git_push.sh +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.asmdef +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/DefaultApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ConnectionException.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IAsynchronousClient.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/ISynchronousClient.cs +src/Org.OpenAPITools/Client/Multimap.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RequestOptions.cs +src/Org.OpenAPITools/Client/UnexpectedResponseException.cs +src/Org.OpenAPITools/Client/WebRequestPathBuilder.cs +src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +src/Org.OpenAPITools/Model/Activity.cs +src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/Apple.cs +src/Org.OpenAPITools/Model/AppleReq.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/Banana.cs +src/Org.OpenAPITools/Model/BananaReq.cs +src/Org.OpenAPITools/Model/BasquePig.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ChildCat.cs +src/Org.OpenAPITools/Model/ChildCatAllOf.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +src/Org.OpenAPITools/Model/DanishPig.cs +src/Org.OpenAPITools/Model/DateOnlyClass.cs +src/Org.OpenAPITools/Model/DeprecatedObject.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/Drawing.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/EquilateralTriangle.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/Foo.cs +src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/Fruit.cs +src/Org.OpenAPITools/Model/FruitReq.cs +src/Org.OpenAPITools/Model/GmFruit.cs +src/Org.OpenAPITools/Model/GrandparentAnimal.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/HealthCheckResult.cs +src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs +src/Org.OpenAPITools/Model/Mammal.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NullableClass.cs +src/Org.OpenAPITools/Model/NullableGuidClass.cs +src/Org.OpenAPITools/Model/NullableShape.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs +src/Org.OpenAPITools/Model/OuterEnumInteger.cs +src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs +src/Org.OpenAPITools/Model/ParentPet.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/Pig.cs +src/Org.OpenAPITools/Model/PolymorphicProperty.cs +src/Org.OpenAPITools/Model/Quadrilateral.cs +src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/ScaleneTriangle.cs +src/Org.OpenAPITools/Model/Shape.cs +src/Org.OpenAPITools/Model/ShapeInterface.cs +src/Org.OpenAPITools/Model/ShapeOrNull.cs +src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +src/Org.OpenAPITools/Model/Triangle.cs +src/Org.OpenAPITools/Model/TriangleInterface.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/Whale.cs +src/Org.OpenAPITools/Model/Zebra.cs +src/Org.OpenAPITools/Org.OpenAPITools.asmdef diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.openapi-generator/VERSION new file mode 100644 index 00000000000..757e6740040 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/README.md new file mode 100644 index 00000000000..d916762b2cf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/README.md @@ -0,0 +1,264 @@ +# Org.OpenAPITools - the C# library for the 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: \" \\ + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- SDK version: 1.0.0 +- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen + + +## Version support +This generator should support all current LTS versions of Unity +- Unity 2020.3 (LTS) and up +- .NET Standard 2.1 / .NET Framework + + +## Dependencies + +- [Newtonsoft.Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html) - 3.0.2 or later +- [Unity Test Framework](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/index.html) - 1.1.33 or later + + +## Installation +Add the dependencies to `Packages/manifest.json` +``` +{ + "dependencies": { + ... + "com.unity.nuget.newtonsoft-json": "3.0.2", + "com.unity.test-framework": "1.1.33", + } +} +``` + +Then use the namespaces: +```csharp +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; +``` + + +## Getting Started + +```csharp +using System; +using System.Collections.Generic; +using UnityEngine; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPIToolsExample +{ + + public class Call123TestSpecialTagsExample : MonoBehaviour + { + async void Start() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = await apiInstance.Call123TestSpecialTagsAsync(modelClient); + Debug.Log(result); + Debug.Log("Done!"); + } + catch (ApiException e) + { + Debug.LogError("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.LogError("Status Code: "+ e.ErrorCode); + Debug.LogError(e.StackTrace); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | +*DefaultApi* | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello +*FakeApi* | [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +*FakeClassnameTags123Api* | [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [Model.Activity](Activity.md) + - [Model.ActivityOutputElementRepresentation](ActivityOutputElementRepresentation.md) + - [Model.AdditionalPropertiesClass](AdditionalPropertiesClass.md) + - [Model.Animal](Animal.md) + - [Model.ApiResponse](ApiResponse.md) + - [Model.Apple](Apple.md) + - [Model.AppleReq](AppleReq.md) + - [Model.ArrayOfArrayOfNumberOnly](ArrayOfArrayOfNumberOnly.md) + - [Model.ArrayOfNumberOnly](ArrayOfNumberOnly.md) + - [Model.ArrayTest](ArrayTest.md) + - [Model.Banana](Banana.md) + - [Model.BananaReq](BananaReq.md) + - [Model.BasquePig](BasquePig.md) + - [Model.Capitalization](Capitalization.md) + - [Model.Cat](Cat.md) + - [Model.CatAllOf](CatAllOf.md) + - [Model.Category](Category.md) + - [Model.ChildCat](ChildCat.md) + - [Model.ChildCatAllOf](ChildCatAllOf.md) + - [Model.ClassModel](ClassModel.md) + - [Model.ComplexQuadrilateral](ComplexQuadrilateral.md) + - [Model.DanishPig](DanishPig.md) + - [Model.DateOnlyClass](DateOnlyClass.md) + - [Model.DeprecatedObject](DeprecatedObject.md) + - [Model.Dog](Dog.md) + - [Model.DogAllOf](DogAllOf.md) + - [Model.Drawing](Drawing.md) + - [Model.EnumArrays](EnumArrays.md) + - [Model.EnumClass](EnumClass.md) + - [Model.EnumTest](EnumTest.md) + - [Model.EquilateralTriangle](EquilateralTriangle.md) + - [Model.File](File.md) + - [Model.FileSchemaTestClass](FileSchemaTestClass.md) + - [Model.Foo](Foo.md) + - [Model.FooGetDefaultResponse](FooGetDefaultResponse.md) + - [Model.FormatTest](FormatTest.md) + - [Model.Fruit](Fruit.md) + - [Model.FruitReq](FruitReq.md) + - [Model.GmFruit](GmFruit.md) + - [Model.GrandparentAnimal](GrandparentAnimal.md) + - [Model.HasOnlyReadOnly](HasOnlyReadOnly.md) + - [Model.HealthCheckResult](HealthCheckResult.md) + - [Model.IsoscelesTriangle](IsoscelesTriangle.md) + - [Model.List](List.md) + - [Model.LiteralStringClass](LiteralStringClass.md) + - [Model.Mammal](Mammal.md) + - [Model.MapTest](MapTest.md) + - [Model.MixedPropertiesAndAdditionalPropertiesClass](MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model.Model200Response](Model200Response.md) + - [Model.ModelClient](ModelClient.md) + - [Model.Name](Name.md) + - [Model.NullableClass](NullableClass.md) + - [Model.NullableGuidClass](NullableGuidClass.md) + - [Model.NullableShape](NullableShape.md) + - [Model.NumberOnly](NumberOnly.md) + - [Model.ObjectWithDeprecatedFields](ObjectWithDeprecatedFields.md) + - [Model.Order](Order.md) + - [Model.OuterComposite](OuterComposite.md) + - [Model.OuterEnum](OuterEnum.md) + - [Model.OuterEnumDefaultValue](OuterEnumDefaultValue.md) + - [Model.OuterEnumInteger](OuterEnumInteger.md) + - [Model.OuterEnumIntegerDefaultValue](OuterEnumIntegerDefaultValue.md) + - [Model.ParentPet](ParentPet.md) + - [Model.Pet](Pet.md) + - [Model.Pig](Pig.md) + - [Model.PolymorphicProperty](PolymorphicProperty.md) + - [Model.Quadrilateral](Quadrilateral.md) + - [Model.QuadrilateralInterface](QuadrilateralInterface.md) + - [Model.ReadOnlyFirst](ReadOnlyFirst.md) + - [Model.Return](Return.md) + - [Model.ScaleneTriangle](ScaleneTriangle.md) + - [Model.Shape](Shape.md) + - [Model.ShapeInterface](ShapeInterface.md) + - [Model.ShapeOrNull](ShapeOrNull.md) + - [Model.SimpleQuadrilateral](SimpleQuadrilateral.md) + - [Model.SpecialModelName](SpecialModelName.md) + - [Model.Tag](Tag.md) + - [Model.TestCollectionEndingWithWordList](TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](TestCollectionEndingWithWordListObject.md) + - [Model.Triangle](Triangle.md) + - [Model.TriangleInterface](TriangleInterface.md) + - [Model.User](User.md) + - [Model.Whale](Whale.md) + - [Model.Zebra](Zebra.md) + + + +## Documentation for Authorization + + +### 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 + + +### 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 + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### bearer_test + +- **Type**: Bearer Authentication + + +### http_signature_test + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Activity.md similarity index 61% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Activity.md index 40e16da1bb7..27a4e457199 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Activity.md @@ -1,10 +1,11 @@ -# Org.OpenAPITools.Model.InlineObject +# Org.OpenAPITools.Model.Activity +test map of maps + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | Updated name of the pet | [optional] -**Status** | **string** | Updated status of the pet | [optional] +**ActivityOutputs** | **Dictionary<string, List<ActivityOutputElementRepresentation>>** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..21f226b3952 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ActivityOutputElementRepresentation.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ActivityOutputElementRepresentation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prop1** | **string** | | [optional] +**Prop2** | **Object** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..c40cd0f8acc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# Org.OpenAPITools.Model.AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**Anytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**MapWithUndeclaredPropertiesAnytype3** | **Dictionary<string, Object>** | | [optional] +**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**MapWithUndeclaredPropertiesString** | **Dictionary<string, 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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Animal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Animal.md new file mode 100644 index 00000000000..f14b7a3ae4e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Animal.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AnotherFakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..0ddc28a1191 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AnotherFakeApi.md @@ -0,0 +1,99 @@ +# Org.OpenAPITools.Api.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** +> ModelClient Call123TestSpecialTags (ModelClient modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### 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 Call123TestSpecialTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the Call123TestSpecialTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test special tags + ApiResponse response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/ApiResponse.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ApiResponse.md similarity index 91% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/ApiResponse.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ApiResponse.md index 01b35815bd4..bb723d2baa1 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/ApiResponse.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ApiResponse.md @@ -1,9 +1,10 @@ # Org.OpenAPITools.Model.ApiResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] +**Code** | **int** | | [optional] **Type** | **string** | | [optional] **Message** | **string** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Apple.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Apple.md new file mode 100644 index 00000000000..1f819f8f281 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Apple.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | [optional] +**Origin** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AppleReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AppleReq.md new file mode 100644 index 00000000000..005b8f8058a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/AppleReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..4764c0ff80c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **List<List<decimal>>** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..d93717103b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **List<decimal>** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayTest.md new file mode 100644 index 00000000000..d74d11bae77 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Banana.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Banana.md new file mode 100644 index 00000000000..226952d1cec --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Banana.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/BananaReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/BananaReq.md new file mode 100644 index 00000000000..f99aab99e38 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/BananaReq.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/BasquePig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/BasquePig.md new file mode 100644 index 00000000000..681be0bc7e3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/BasquePig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Capitalization.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Capitalization.md new file mode 100644 index 00000000000..1b1352d918f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Capitalization.md @@ -0,0 +1,15 @@ +# Org.OpenAPITools.Model.Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | **string** | | [optional] +**CapitalCamel** | **string** | | [optional] +**SmallSnake** | **string** | | [optional] +**CapitalSnake** | **string** | | [optional] +**SCAETHFlowPoints** | **string** | | [optional] +**ATT_NAME** | **string** | Name 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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Cat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Cat.md new file mode 100644 index 00000000000..aa1ac17604e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Cat.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Declawed** | **bool** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/CatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/CatAllOf.md new file mode 100644 index 00000000000..6cbaaa14e81 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [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/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Category.md similarity index 77% rename from samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Category.md index 860a468e35c..032a1faeb3f 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Category.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Category.md @@ -1,10 +1,11 @@ # Org.OpenAPITools.Model.Category + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Name** | **string** | | [optional] +**Id** | **long** | | [optional] +**Name** | **string** | | [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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Category.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ChildCat.md similarity index 73% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Category.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ChildCat.md index 860a468e35c..072ad05b36d 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Category.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ChildCat.md @@ -1,10 +1,11 @@ -# Org.OpenAPITools.Model.Category +# Org.OpenAPITools.Model.ChildCat + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] **Name** | **string** | | [optional] +**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat] [[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ChildCatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ChildCatAllOf.md new file mode 100644 index 00000000000..864d33e80e7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ChildCatAllOf.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ChildCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] +**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat] + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ClassModel.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ClassModel.md new file mode 100644 index 00000000000..f39982657c8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ClassModel.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ClassModel +Model for testing model with \"_class\" property + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ComplexQuadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ComplexQuadrilateral.md new file mode 100644 index 00000000000..65a6097ce3f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ComplexQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DanishPig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DanishPig.md new file mode 100644 index 00000000000..d9cf6527a3f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DanishPig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DateOnlyClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DateOnlyClass.md new file mode 100644 index 00000000000..d0912d2ac41 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DateOnlyClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DateOnlyClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DateOnlyProperty** | **DateTime** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DefaultApi.md new file mode 100644 index 00000000000..72d1733f4c6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DefaultApi.md @@ -0,0 +1,261 @@ +# Org.OpenAPITools.Api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | +| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | + + +# **FooGet** +> FooGetDefaultResponse FooGet () + + + +### 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 FooGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + FooGetDefaultResponse result = apiInstance.FooGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FooGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FooGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.FooGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +[[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) + + +# **GetCountry** +> void GetCountry (string country) + + + +### 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 GetCountryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + var country = "country_example"; // string | + + try + { + apiInstance.GetCountry(country); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetCountryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.GetCountryWithHttpInfo(country); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **country** | **string** | | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + +[[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) + + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Tag.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DeprecatedObject.md similarity index 82% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Tag.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DeprecatedObject.md index 6a76c28595f..bb7824a3d64 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Tag.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DeprecatedObject.md @@ -1,9 +1,9 @@ -# Org.OpenAPITools.Model.Tag +# Org.OpenAPITools.Model.DeprecatedObject + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] **Name** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Dog.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Dog.md new file mode 100644 index 00000000000..3aa00144e9a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Dog.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] +**Breed** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DogAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DogAllOf.md new file mode 100644 index 00000000000..c1096f2c310 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Drawing.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Drawing.md new file mode 100644 index 00000000000..6b7122940af --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Drawing.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MainShape** | [**Shape**](Shape.md) | | [optional] +**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**Shapes** | [**List<Shape>**](Shape.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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumArrays.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumArrays.md new file mode 100644 index 00000000000..62e34f03dbc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustSymbol** | **string** | | [optional] +**ArrayEnum** | **List<EnumArrays.ArrayEnumEnum>** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumClass.md new file mode 100644 index 00000000000..38f309437db --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumClass.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumTest.md new file mode 100644 index 00000000000..5ce3c4addd9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EnumTest.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Model.EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | **string** | | [optional] +**EnumStringRequired** | **string** | | +**EnumInteger** | **int** | | [optional] +**EnumIntegerOnly** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] +**OuterEnum** | **OuterEnum** | | [optional] +**OuterEnumInteger** | **OuterEnumInteger** | | [optional] +**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EquilateralTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EquilateralTriangle.md new file mode 100644 index 00000000000..ab06d96ca30 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/EquilateralTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FakeApi.md new file mode 100644 index 00000000000..4b5bf803c4e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FakeApi.md @@ -0,0 +1,1394 @@ +# Org.OpenAPITools.Api.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 | | +| [**GetArrayOfEnums**](FakeApi.md#getarrayofenums) | **GET** /fake/array-of-enums | Array of Enums | +| [**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-parameters | | + + +# **FakeHealthGet** +> HealthCheckResult FakeHealthGet () + +Health check endpoint + +### 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 FakeHealthGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Health check endpoint + HealthCheckResult result = apiInstance.FakeHealthGet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeHealthGet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeHealthGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Health check endpoint + ApiResponse response = apiInstance.FakeHealthGetWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeHealthGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +[[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) + + +# **FakeOuterBooleanSerialize** +> bool FakeOuterBooleanSerialize (bool? body = null) + + + +Test serialization of outer boolean types + +### 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 FakeOuterBooleanSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = true; // bool? | Input boolean as post body (optional) + + try + { + bool result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterBooleanSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterBooleanSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **bool?** | Input boolean as post body | [optional] | + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +[[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) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + + + +Test serialization of object with outer number type + +### 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 FakeOuterCompositeSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterCompositeSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + +[[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) + + +# **FakeOuterNumberSerialize** +> decimal FakeOuterNumberSerialize (decimal? body = null) + + + +Test serialization of outer number types + +### 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 FakeOuterNumberSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var body = 8.14D; // decimal? | Input number as post body (optional) + + try + { + decimal result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterNumberSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterNumberSerializeWithHttpInfo(body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **body** | **decimal?** | Input number as post body | [optional] | + +### Return type + +**decimal** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[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) + + +# **FakeOuterStringSerialize** +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) + + + +Test serialization of outer string types + +### 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 FakeOuterStringSerializeExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String + var body = "body_example"; // string | Input string as post body (optional) + + try + { + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FakeOuterStringSerializeWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerializeWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | +| **body** | **string** | Input string as post body | [optional] | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + +[[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) + + +# **GetArrayOfEnums** +> List<OuterEnum> GetArrayOfEnums () + +Array of Enums + +### 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 GetArrayOfEnumsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + + try + { + // Array of Enums + List result = apiInstance.GetArrayOfEnums(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.GetArrayOfEnums: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetArrayOfEnumsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Array of Enums + ApiResponse> response = apiInstance.GetArrayOfEnumsWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.GetArrayOfEnumsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +[[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) + + +# **TestBodyWithFileSchema** +> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### 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 TestBodyWithFileSchemaExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + + try + { + apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithFileSchemaWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchemaWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + + +# **TestBodyWithQueryParams** +> void TestBodyWithQueryParams (string query, User user) + + + +### 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 TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var query = "query_example"; // string | + var user = new User(); // User | + + try + { + apiInstance.TestBodyWithQueryParams(query, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestBodyWithQueryParamsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestBodyWithQueryParamsWithHttpInfo(query, user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParamsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **query** | **string** | | | +| **user** | [**User**](User.md) | | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + + +# **TestClientModel** +> ModelClient TestClientModel (ModelClient modelClient) + +To test \"client\" model + +To test \"client\" model + +### 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 TestClientModelExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test \"client\" model + ModelClient result = apiInstance.TestClientModel(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClientModelWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test \"client\" model + ApiResponse response = apiInstance.TestClientModelWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestClientModelWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestEndpointParameters** +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various 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 TestEndpointParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure HTTP basic authorization: http_basic_test + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new FakeApi(config); + var number = 8.14D; // decimal | None + var _double = 1.2D; // double | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None + var integer = 56; // int? | None (optional) + var int32 = 56; // int? | None (optional) + var int64 = 789L; // long? | None (optional) + var _float = 3.4F; // float? | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) + + try + { + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEndpointParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + apiInstance.TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEndpointParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **number** | **decimal** | None | | +| **_double** | **double** | None | | +| **patternWithoutDelimiter** | **string** | None | | +| **_byte** | **byte[]** | None | | +| **integer** | **int?** | None | [optional] | +| **int32** | **int?** | None | [optional] | +| **int64** | **long?** | None | [optional] | +| **_float** | **float?** | None | [optional] | +| **_string** | **string** | None | [optional] | +| **binary** | **System.IO.Stream****System.IO.Stream** | None | [optional] | +| **date** | **DateTime?** | None | [optional] | +| **dateTime** | **DateTime?** | None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] | +| **password** | **string** | None | [optional] | +| **callback** | **string** | None | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[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) + + +# **TestEnumParameters** +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + +To test enum parameters + +To test enum 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 TestEnumParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) + + try + { + // To test enum parameters + apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestEnumParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test enum parameters + apiInstance.TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestEnumParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **enumHeaderStringArray** | [**List<string>**](string.md) | Header parameter enum test (string array) | [optional] | +| **enumHeaderString** | **string** | Header parameter enum test (string) | [optional] [default to -efg] | +| **enumQueryStringArray** | [**List<string>**](string.md) | Query parameter enum test (string array) | [optional] | +| **enumQueryString** | **string** | Query parameter enum test (string) | [optional] [default to -efg] | +| **enumQueryInteger** | **int?** | Query parameter enum test (double) | [optional] | +| **enumQueryDouble** | **double?** | Query parameter enum test (double) | [optional] | +| **enumFormStringArray** | [**List<string>**](string.md) | Form parameter enum test (string array) | [optional] [default to $] | +| **enumFormString** | **string** | Form parameter enum test (string) | [optional] [default to -efg] | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +[[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) + + +# **TestGroupParameters** +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### 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 TestGroupParametersExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure Bearer token for authorization: bearer_test + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new FakeApi(config); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters + var stringGroup = 56; // int? | String in group parameters (optional) + var booleanGroup = true; // bool? | Boolean in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) + + try + { + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestGroupParametersWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestGroupParametersWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requiredStringGroup** | **int** | Required String in group parameters | | +| **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | | +| **requiredInt64Group** | **long** | Required Integer in group parameters | | +| **stringGroup** | **int?** | String in group parameters | [optional] | +| **booleanGroup** | **bool?** | Boolean in group parameters | [optional] | +| **int64Group** | **long?** | Integer in group parameters | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + +[[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) + + +# **TestInlineAdditionalProperties** +> void TestInlineAdditionalProperties (Dictionary requestBody) + +test inline additionalProperties + +### 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 TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var requestBody = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(requestBody); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestInlineAdditionalPropertiesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test inline additionalProperties + apiInstance.TestInlineAdditionalPropertiesWithHttpInfo(requestBody); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalPropertiesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **requestBody** | [**Dictionary<string, string>**](string.md) | request body | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **TestJsonFormData** +> void TestJsonFormData (string param, string param2) + +test json serialization of form data + +### 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 TestJsonFormDataExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 + + try + { + // test json serialization of form data + apiInstance.TestJsonFormData(param, param2); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestJsonFormDataWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // test json serialization of form data + apiInstance.TestJsonFormDataWithHttpInfo(param, param2); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestJsonFormDataWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **param** | **string** | field1 | | +| **param2** | **string** | field2 | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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 config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(config); + 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); + } + } + } +} +``` + +#### Using the TestQueryParameterCollectionFormatWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + apiInstance.TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormatWithHttpInfo: " + 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/OpenAPIClient-unityWebRequest/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..aff9fbdf0ef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FakeClassnameTags123Api.md @@ -0,0 +1,104 @@ +# Org.OpenAPITools.Api.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** +> ModelClient TestClassname (ModelClient modelClient) + +To test class name in snake case + +To test class name in snake case + +### 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 TestClassnameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key_query + config.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(config); + var modelClient = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(modelClient); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the TestClassnameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // To test class name in snake case + ApiResponse response = apiInstance.TestClassnameWithHttpInfo(modelClient); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassnameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **modelClient** | [**ModelClient**](ModelClient.md) | client model | | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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/OpenAPIClient-unityWebRequest/docs/File.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/File.md new file mode 100644 index 00000000000..28959feda08 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/File.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.File +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FileSchemaTestClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..0ce4be56cc7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Foo.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Foo.md new file mode 100644 index 00000000000..92cf4572321 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Foo.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [default to "bar"] + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FooGetDefaultResponse.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FooGetDefaultResponse.md new file mode 100644 index 00000000000..dde9b9729b9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FooGetDefaultResponse.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.FooGetDefaultResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | [**Foo**](Foo.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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FormatTest.md new file mode 100644 index 00000000000..1664a9d7c72 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FormatTest.md @@ -0,0 +1,27 @@ +# Org.OpenAPITools.Model.FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**UnsignedInteger** | **uint** | | [optional] +**Int64** | **long** | | [optional] +**UnsignedLong** | **ulong** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] +**Decimal** | **decimal** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | +**Binary** | **System.IO.Stream** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] +**Password** | **string** | | +**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Fruit.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Fruit.md new file mode 100644 index 00000000000..56b1c9f00ab --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Fruit.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] +**LengthCm** | **decimal** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FruitReq.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FruitReq.md new file mode 100644 index 00000000000..5db6b0e2d1d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/FruitReq.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cultivar** | **string** | | +**Mealy** | **bool** | | [optional] +**LengthCm** | **decimal** | | +**Sweet** | **bool** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/GmFruit.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/GmFruit.md new file mode 100644 index 00000000000..2cc2d496e67 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/GmFruit.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] +**Cultivar** | **string** | | [optional] +**Origin** | **string** | | [optional] +**LengthCm** | **decimal** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/GrandparentAnimal.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/GrandparentAnimal.md new file mode 100644 index 00000000000..461ebfe34c2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/HasOnlyReadOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..64549c18b0a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Foo** | **string** | | [optional] [readonly] + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/HealthCheckResult.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/HealthCheckResult.md new file mode 100644 index 00000000000..f7d1a7eb688 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/HealthCheckResult.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.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. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/IsoscelesTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/IsoscelesTriangle.md new file mode 100644 index 00000000000..f0eef14fabb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/IsoscelesTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/List.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/List.md new file mode 100644 index 00000000000..2862c7e5321 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/List.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/LiteralStringClass.md new file mode 100644 index 00000000000..6d3e0d50c1f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object_1.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Mammal.md similarity index 59% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object_1.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Mammal.md index 2e6d226754e..aab8f4db9c7 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Inline_object_1.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Mammal.md @@ -1,10 +1,13 @@ -# Org.OpenAPITools.Model.InlineObject1 +# Org.OpenAPITools.Model.Mammal + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] -**File** | **System.IO.Stream** | file to upload | [optional] +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [optional] +**ClassName** | **string** | | +**Type** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/MapTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/MapTest.md new file mode 100644 index 00000000000..516f9d4fd37 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/MapTest.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapOfEnumString** | **Dictionary<string, MapTest.InnerEnum>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..050210a3e37 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UuidWithPattern** | **Guid** | | [optional] +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Model200Response.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Model200Response.md new file mode 100644 index 00000000000..31f4d86fe43 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Model200Response.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Model200Response +Model for testing model name starting with number + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **int** | | [optional] +**Class** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ModelClient.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ModelClient.md new file mode 100644 index 00000000000..c29a6287433 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ModelClient.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ModelClient + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Client** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Name.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Name.md new file mode 100644 index 00000000000..692af702b5b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Name.md @@ -0,0 +1,14 @@ +# Org.OpenAPITools.Model.Name +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] [readonly] +**Property** | **string** | | [optional] +**_123Number** | **int** | | [optional] [readonly] + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableClass.md new file mode 100644 index 00000000000..7bab4fa20ee --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableClass.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | **int?** | | [optional] +**NumberProp** | **decimal?** | | [optional] +**BooleanProp** | **bool?** | | [optional] +**StringProp** | **string** | | [optional] +**DateProp** | **DateTime?** | | [optional] +**DatetimeProp** | **DateTime?** | | [optional] +**ArrayNullableProp** | **List<Object>** | | [optional] +**ArrayAndItemsNullableProp** | **List<Object>** | | [optional] +**ArrayItemsNullable** | **List<Object>** | | [optional] +**ObjectNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectAndItemsNullableProp** | **Dictionary<string, Object>** | | [optional] +**ObjectItemsNullable** | **Dictionary<string, Object>** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableGuidClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableGuidClass.md new file mode 100644 index 00000000000..5ada17b4db8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableGuidClass.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NullableGuidClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **Guid?** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableShape.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableShape.md new file mode 100644 index 00000000000..f8fb004da80 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NullableShape.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.NullableShape +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NumberOnly.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NumberOnly.md new file mode 100644 index 00000000000..14a7c0f1071 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **decimal** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..7a335d446f4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Model.ObjectWithDeprecatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **string** | | [optional] +**Id** | **decimal** | | [optional] +**DeprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**Bars** | **List<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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Order.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Order.md similarity index 61% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Order.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Order.md index 984bd5ca063..66c55c3b473 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Order.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Order.md @@ -1,14 +1,15 @@ # Org.OpenAPITools.Model.Order + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] **Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] +**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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterComposite.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterComposite.md new file mode 100644 index 00000000000..eb42bcc1aaa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | **decimal** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **bool** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnum.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnum.md new file mode 100644 index 00000000000..245765c7845 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnum.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumDefaultValue.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..3ffaa1086a6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumInteger.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..567858392db --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..35c75a44372 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ParentPet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ParentPet.md new file mode 100644 index 00000000000..0e18ba6d591 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ParentPet.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PetType** | **string** | | + +[[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/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Pet.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Pet.md similarity index 76% rename from samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Pet.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Pet.md index ce9fe873cd2..c7224764e2d 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/Pet.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Pet.md @@ -1,13 +1,14 @@ # Org.OpenAPITools.Model.Pet + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | -**PhotoUrls** | **List** | | -**Tags** | [**List**](Tag.md) | | [optional] +**PhotoUrls** | **List<string>** | | +**Tags** | [**List<Tag>**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/PetApi.md new file mode 100644 index 00000000000..03dec23f686 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/PetApi.md @@ -0,0 +1,856 @@ +# Org.OpenAPITools.Api.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** +> void AddPet (Pet pet) + +Add a new pet to the store + +### 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 AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + apiInstance.AddPet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the AddPetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Add a new pet to the store + apiInstance.AddPetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**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_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[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** +> void DeletePet (long petId, string apiKey = null) + +Deletes a pet + +### 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 DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeletePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Deletes a pet + apiInstance.DeletePetWithHttpInfo(petId, apiKey); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | Pet id to delete | | +| **apiKey** | **string** | | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[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<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### 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 FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByStatusWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by status + ApiResponse> response = apiInstance.FindPetsByStatusWithHttpInfo(status); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByStatusWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **status** | [**List<string>**](string.md) | Status values that need to be considered for filter | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[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<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### 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 FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the FindPetsByTagsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Finds Pets by tags + ApiResponse> response = apiInstance.FindPetsByTagsWithHttpInfo(tags); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.FindPetsByTagsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **tags** | [**List<string>**](string.md) | Tags to filter by | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[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 (long petId) + +Find pet by ID + +Returns a single pet + +### 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 GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetPetByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find pet by ID + ApiResponse response = apiInstance.GetPetByIdWithHttpInfo(petId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.GetPetByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[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** +> void UpdatePet (Pet pet) + +Update an existing pet + +### 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 UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + apiInstance.UpdatePet(pet); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Update an existing pet + apiInstance.UpdatePetWithHttpInfo(pet); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pet** | [**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_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[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** +> void UpdatePetWithForm (long petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### 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 UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdatePetWithFormWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updates a pet in the store with form data + apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet that needs to be updated | | +| **name** | **string** | Updated name of the pet | [optional] | +| **status** | **string** | Updated status of the pet | [optional] | + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[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 (long petId, string additionalMetadata = null, System.IO.Stream file = null) + +uploads an image + +### 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 UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image + ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, additionalMetadata, file); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to update | | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | +| **file** | **System.IO.Stream****System.IO.Stream** | file to upload | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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) + + +# **UploadFileWithRequiredFile** +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) + +uploads an image (required) + +### 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 UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UploadFileWithRequiredFileWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // uploads an image (required) + ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **petId** | **long** | ID of pet to update | | +| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | | +| **additionalMetadata** | **string** | Additional data to pass to server | [optional] | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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/OpenAPIClient-unityWebRequest/docs/Pig.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Pig.md new file mode 100644 index 00000000000..6e86d0760d5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Pig.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/PolymorphicProperty.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/PolymorphicProperty.md new file mode 100644 index 00000000000..8262a41c50d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/PolymorphicProperty.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.PolymorphicProperty + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Quadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Quadrilateral.md new file mode 100644 index 00000000000..0165ddcc0e4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Quadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/QuadrilateralInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/QuadrilateralInterface.md new file mode 100644 index 00000000000..6daf340a141 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/QuadrilateralInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QuadrilateralType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ReadOnlyFirst.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..b3f4a17ea34 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | **string** | | [optional] [readonly] +**Baz** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Return.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Return.md new file mode 100644 index 00000000000..2c7c97e09da --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Return.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Return +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int** | | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ScaleneTriangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ScaleneTriangle.md new file mode 100644 index 00000000000..76da8f1de81 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ScaleneTriangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Shape.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Shape.md new file mode 100644 index 00000000000..9a54628cd41 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Shape.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ShapeInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ShapeInterface.md new file mode 100644 index 00000000000..57456d6793f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ShapeInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ShapeOrNull.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ShapeOrNull.md new file mode 100644 index 00000000000..cbf61ebe77a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/ShapeOrNull.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.ShapeOrNull +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/SimpleQuadrilateral.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/SimpleQuadrilateral.md new file mode 100644 index 00000000000..c329495425d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/SimpleQuadrilateral.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**QuadrilateralType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/SpecialModelName.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/SpecialModelName.md new file mode 100644 index 00000000000..648179799e1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/SpecialModelName.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | **long** | | [optional] +**_SpecialModelName** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/StoreApi.md new file mode 100644 index 00000000000..de4414feafc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/StoreApi.md @@ -0,0 +1,373 @@ +# Org.OpenAPITools.Api.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** +> void DeleteOrder (string 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 +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete purchase order by ID + apiInstance.DeleteOrderWithHttpInfo(orderId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **orderId** | **string** | ID of the order that needs to be deleted | | + +### 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 | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[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** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### 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 GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetInventoryWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Returns pet inventories by status + ApiResponse> response = apiInstance.GetInventoryWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetInventoryWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[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 (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### 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 GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789L; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetOrderByIdWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Find purchase order by ID + ApiResponse response = apiInstance.GetOrderByIdWithHttpInfo(orderId); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.GetOrderByIdWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **orderId** | **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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[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) + +Place an order for a pet + +### 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 PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the PlaceOrderWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Place an order for a pet + ApiResponse response = apiInstance.PlaceOrderWithHttpInfo(order); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling StoreApi.PlaceOrderWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[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-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Tag.md similarity index 90% rename from samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Tag.md index 6a76c28595f..fdd22eb31fd 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Tag.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Tag.md @@ -1,9 +1,10 @@ # Org.OpenAPITools.Model.Tag + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..0e5568637b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..7213b3ca8d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Triangle.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Triangle.md new file mode 100644 index 00000000000..c4d0452b4e8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Triangle.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ShapeType** | **string** | | +**TriangleType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TriangleInterface.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TriangleInterface.md new file mode 100644 index 00000000000..e0d8b5a5913 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/TriangleInterface.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TriangleType** | **string** | | + +[[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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/User.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/User.md new file mode 100644 index 00000000000..b0cd4dc042b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/User.md @@ -0,0 +1,21 @@ +# Org.OpenAPITools.Model.User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] +**ObjectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ObjectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**AnyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**AnyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [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/csharp-netcore/OpenAPIClient-unityWebRequest/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/UserApi.md new file mode 100644 index 00000000000..a3d461b04c1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/UserApi.md @@ -0,0 +1,713 @@ +# Org.OpenAPITools.Api.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** +> void CreateUser (User user) + +Create user + +This can only be done by the logged in user. + +### 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 CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create user + apiInstance.CreateUserWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**User**](User.md) | Created user object | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[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** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### 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 CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithArrayInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[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** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### 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 CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the CreateUsersWithListInputWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Creates list of users with given input array + apiInstance.CreateUsersWithListInputWithHttpInfo(user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **user** | [**List<User>**](User.md) | List of user object | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[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** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### 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 DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the DeleteUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete user + apiInstance.DeleteUserWithHttpInfo(username); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The name that needs to be deleted | | + +### 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 | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[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 (string username) + +Get user by user name + +### 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 GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetUserByNameWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get user by user name + ApiResponse response = apiInstance.GetUserByNameWithHttpInfo(username); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.GetUserByNameWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[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 (string username, string password) + +Logs user into the system + +### 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 LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LoginUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs user into the system + ApiResponse response = apiInstance.LoginUserWithHttpInfo(username, password); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LoginUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | The user name for login | | +| **password** | **string** | The password for login in clear text | | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + +[[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** +> void LogoutUser () + +Logs out current logged in user session + +### 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 LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the LogoutUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Logs out current logged in user session + apiInstance.LogoutUserWithHttpInfo(); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### 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 + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[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** +> void UpdateUser (string username, User user) + +Updated user + +This can only be done by the logged in user. + +### 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 UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(config); + var username = "username_example"; // string | name that need to be deleted + var user = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the UpdateUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Updated user + apiInstance.UpdateUserWithHttpInfo(username, user); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **username** | **string** | name that need to be deleted | | +| **user** | [**User**](User.md) | Updated user object | | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[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/OpenAPIClient-unityWebRequest/docs/Whale.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Whale.md new file mode 100644 index 00000000000..5fc3dc7f85c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Whale.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasBaleen** | **bool** | | [optional] +**HasTeeth** | **bool** | | [optional] +**ClassName** | **string** | | + +[[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/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Zebra.md similarity index 72% rename from samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md rename to samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Zebra.md index 01b35815bd4..31e686adf0e 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/ApiResponse.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/docs/Zebra.md @@ -1,11 +1,11 @@ -# Org.OpenAPITools.Model.ApiResponse +# Org.OpenAPITools.Model.Zebra + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] **Type** | **string** | | [optional] -**Message** | **string** | | [optional] +**ClassName** | **string** | | [[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/csharp-netcore/OpenAPIClient-unityWebRequest/git_push.sh b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/git_push.sh @@ -0,0 +1,57 @@ +#!/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" "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/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 00000000000..5291df5c3f4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/AnotherFakeApiTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing AnotherFakeApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class AnotherFakeApiTests : IDisposable + { + private AnotherFakeApi instance; + + public AnotherFakeApiTests() + { + instance = new AnotherFakeApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AnotherFakeApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' AnotherFakeApi + //Assert.IsType(instance); + } + + /// + /// Test Call123TestSpecialTags + /// + [Test] + public void Call123TestSpecialTagsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //ModelClient modelClient = null; + //var response = instance.Call123TestSpecialTags(modelClient); + //Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs new file mode 100644 index 00000000000..389c61984c1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/DefaultApiTests.cs @@ -0,0 +1,78 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing DefaultApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class DefaultApiTests : IDisposable + { + private DefaultApi instance; + + public DefaultApiTests() + { + instance = new DefaultApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DefaultApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' DefaultApi + //Assert.IsType(instance); + } + + /// + /// Test FooGet + /// + [Test] + public void FooGetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.FooGet(); + //Assert.IsType(response); + } + + /// + /// Test GetCountry + /// + [Test] + public void GetCountryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string country = null; + //instance.GetCountry(country); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs new file mode 100644 index 00000000000..99c071961eb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -0,0 +1,258 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class FakeApiTests : IDisposable + { + private FakeApi instance; + + public FakeApiTests() + { + instance = new FakeApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FakeApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' FakeApi + //Assert.IsType(instance); + } + + /// + /// Test FakeHealthGet + /// + [Test] + public void FakeHealthGetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.FakeHealthGet(); + //Assert.IsType(response); + } + + /// + /// Test FakeOuterBooleanSerialize + /// + [Test] + public void FakeOuterBooleanSerializeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //bool? body = null; + //var response = instance.FakeOuterBooleanSerialize(body); + //Assert.IsType(response); + } + + /// + /// Test FakeOuterCompositeSerialize + /// + [Test] + public void FakeOuterCompositeSerializeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //OuterComposite outerComposite = null; + //var response = instance.FakeOuterCompositeSerialize(outerComposite); + //Assert.IsType(response); + } + + /// + /// Test FakeOuterNumberSerialize + /// + [Test] + public void FakeOuterNumberSerializeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //decimal? body = null; + //var response = instance.FakeOuterNumberSerialize(body); + //Assert.IsType(response); + } + + /// + /// Test FakeOuterStringSerialize + /// + [Test] + public void FakeOuterStringSerializeTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Guid requiredStringUuid = null; + //string body = null; + //var response = instance.FakeOuterStringSerialize(requiredStringUuid, body); + //Assert.IsType(response); + } + + /// + /// Test GetArrayOfEnums + /// + [Test] + public void GetArrayOfEnumsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetArrayOfEnums(); + //Assert.IsType>(response); + } + + /// + /// Test TestBodyWithFileSchema + /// + [Test] + public void TestBodyWithFileSchemaTest() + { + // TODO uncomment below to test the method and replace null with proper value + //FileSchemaTestClass fileSchemaTestClass = null; + //instance.TestBodyWithFileSchema(fileSchemaTestClass); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Test] + public void TestBodyWithQueryParamsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string query = null; + //User user = null; + //instance.TestBodyWithQueryParams(query, user); + } + + /// + /// Test TestClientModel + /// + [Test] + public void TestClientModelTest() + { + // TODO uncomment below to test the method and replace null with proper value + //ModelClient modelClient = null; + //var response = instance.TestClientModel(modelClient); + //Assert.IsType(response); + } + + /// + /// Test TestEndpointParameters + /// + [Test] + public void TestEndpointParametersTest() + { + // TODO uncomment below to test the method and replace null with proper value + //decimal number = null; + //double _double = null; + //string patternWithoutDelimiter = null; + //byte[] _byte = null; + //int? integer = null; + //int? int32 = null; + //long? int64 = null; + //float? _float = null; + //string _string = null; + //System.IO.Stream binary = null; + //DateTime? date = null; + //DateTime? dateTime = null; + //string password = null; + //string callback = null; + //instance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + + /// + /// Test TestEnumParameters + /// + [Test] + public void TestEnumParametersTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List enumHeaderStringArray = null; + //string enumHeaderString = null; + //List enumQueryStringArray = null; + //string enumQueryString = null; + //int? enumQueryInteger = null; + //double? enumQueryDouble = null; + //List enumFormStringArray = null; + //string enumFormString = null; + //instance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /// + /// Test TestGroupParameters + /// + [Test] + public void TestGroupParametersTest() + { + // TODO uncomment below to test the method and replace null with proper value + //int requiredStringGroup = null; + //bool requiredBooleanGroup = null; + //long requiredInt64Group = null; + //int? stringGroup = null; + //bool? booleanGroup = null; + //long? int64Group = null; + //instance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /// + /// Test TestInlineAdditionalProperties + /// + [Test] + public void TestInlineAdditionalPropertiesTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Dictionary requestBody = null; + //instance.TestInlineAdditionalProperties(requestBody); + } + + /// + /// Test TestJsonFormData + /// + [Test] + public void TestJsonFormDataTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string param = null; + //string param2 = null; + //instance.TestJsonFormData(param, param2); + } + + /// + /// Test TestQueryParameterCollectionFormat + /// + [Test] + public void TestQueryParameterCollectionFormatTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List pipe = null; + //List ioutil = null; + //List http = null; + //List url = null; + //List context = null; + //instance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 00000000000..de83d1442ce --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/FakeClassnameTags123ApiTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class FakeClassnameTags123ApiTests : IDisposable + { + private FakeClassnameTags123Api instance; + + public FakeClassnameTags123ApiTests() + { + instance = new FakeClassnameTags123Api(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FakeClassnameTags123Api + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' FakeClassnameTags123Api + //Assert.IsType(instance); + } + + /// + /// Test TestClassname + /// + [Test] + public void TestClassnameTest() + { + // TODO uncomment below to test the method and replace null with proper value + //ModelClient modelClient = null; + //var response = instance.TestClassname(modelClient); + //Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/PetApiTests.cs new file mode 100644 index 00000000000..30879e209dd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/PetApiTests.cs @@ -0,0 +1,167 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class PetApiTests : IDisposable + { + private PetApi instance; + + public PetApiTests() + { + instance = new PetApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PetApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' PetApi + //Assert.IsType(instance); + } + + /// + /// Test AddPet + /// + [Test] + public void AddPetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Pet pet = null; + //instance.AddPet(pet); + } + + /// + /// Test DeletePet + /// + [Test] + public void DeletePetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //string apiKey = null; + //instance.DeletePet(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Test] + public void FindPetsByStatusTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List status = null; + //var response = instance.FindPetsByStatus(status); + //Assert.IsType>(response); + } + + /// + /// Test FindPetsByTags + /// + [Test] + public void FindPetsByTagsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List tags = null; + //var response = instance.FindPetsByTags(tags); + //Assert.IsType>(response); + } + + /// + /// Test GetPetById + /// + [Test] + public void GetPetByIdTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //var response = instance.GetPetById(petId); + //Assert.IsType(response); + } + + /// + /// Test UpdatePet + /// + [Test] + public void UpdatePetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Pet pet = null; + //instance.UpdatePet(pet); + } + + /// + /// Test UpdatePetWithForm + /// + [Test] + public void UpdatePetWithFormTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //string name = null; + //string status = null; + //instance.UpdatePetWithForm(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Test] + public void UploadFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //string additionalMetadata = null; + //System.IO.Stream file = null; + //var response = instance.UploadFile(petId, additionalMetadata, file); + //Assert.IsType(response); + } + + /// + /// Test UploadFileWithRequiredFile + /// + [Test] + public void UploadFileWithRequiredFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //System.IO.Stream requiredFile = null; + //string additionalMetadata = null; + //var response = instance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + //Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs new file mode 100644 index 00000000000..68f3ec5957d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/StoreApiTests.cs @@ -0,0 +1,102 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class StoreApiTests : IDisposable + { + private StoreApi instance; + + public StoreApiTests() + { + instance = new StoreApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of StoreApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' StoreApi + //Assert.IsType(instance); + } + + /// + /// Test DeleteOrder + /// + [Test] + public void DeleteOrderTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string orderId = null; + //instance.DeleteOrder(orderId); + } + + /// + /// Test GetInventory + /// + [Test] + public void GetInventoryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetInventory(); + //Assert.IsType>(response); + } + + /// + /// Test GetOrderById + /// + [Test] + public void GetOrderByIdTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long orderId = null; + //var response = instance.GetOrderById(orderId); + //Assert.IsType(response); + } + + /// + /// Test PlaceOrder + /// + [Test] + public void PlaceOrderTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Order order = null; + //var response = instance.PlaceOrder(order); + //Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/UserApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/UserApiTests.cs new file mode 100644 index 00000000000..ea0996624f7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Api/UserApiTests.cs @@ -0,0 +1,147 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +// uncomment below to import models +//using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class UserApiTests : IDisposable + { + private UserApi instance; + + public UserApiTests() + { + instance = new UserApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of UserApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' UserApi + //Assert.IsType(instance); + } + + /// + /// Test CreateUser + /// + [Test] + public void CreateUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User user = null; + //instance.CreateUser(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Test] + public void CreateUsersWithArrayInputTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List user = null; + //instance.CreateUsersWithArrayInput(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Test] + public void CreateUsersWithListInputTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List user = null; + //instance.CreateUsersWithListInput(user); + } + + /// + /// Test DeleteUser + /// + [Test] + public void DeleteUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //instance.DeleteUser(username); + } + + /// + /// Test GetUserByName + /// + [Test] + public void GetUserByNameTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //var response = instance.GetUserByName(username); + //Assert.IsType(response); + } + + /// + /// Test LoginUser + /// + [Test] + public void LoginUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //string password = null; + //var response = instance.LoginUser(username, password); + //Assert.IsType(response); + } + + /// + /// Test LogoutUser + /// + [Test] + public void LogoutUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.LogoutUser(); + } + + /// + /// Test UpdateUser + /// + [Test] + public void UpdateUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //User user = null; + //instance.UpdateUser(username, user); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..2cbfde17b03 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ActivityOutputElementRepresentation + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityOutputElementRepresentationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ActivityOutputElementRepresentation + //private ActivityOutputElementRepresentation instance; + + public ActivityOutputElementRepresentationTests() + { + // TODO uncomment below to create an instance of ActivityOutputElementRepresentation + //instance = new ActivityOutputElementRepresentation(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ActivityOutputElementRepresentation + /// + [Test] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Test] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Test] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..deeed412e65 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Activity + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ActivityTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Activity + //private Activity instance; + + public ActivityTests() + { + // TODO uncomment below to create an instance of Activity + //instance = new Activity(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Activity + /// + [Test] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Test] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..5a474328dec --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AdditionalPropertiesClassTests.cs @@ -0,0 +1,123 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing AdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AdditionalPropertiesClass + //private AdditionalPropertiesClass instance; + + public AdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of AdditionalPropertiesClass + //instance = new AdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AdditionalPropertiesClass + /// + [Test] + public void AdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" AdditionalPropertiesClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MapProperty' + /// + [Test] + public void MapPropertyTest() + { + // TODO unit test for the property 'MapProperty' + } + /// + /// Test the property 'MapOfMapProperty' + /// + [Test] + public void MapOfMapPropertyTest() + { + // TODO unit test for the property 'MapOfMapProperty' + } + /// + /// Test the property 'Anytype1' + /// + [Test] + public void Anytype1Test() + { + // TODO unit test for the property 'Anytype1' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype1' + /// + [Test] + public void MapWithUndeclaredPropertiesAnytype1Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype1' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype2' + /// + [Test] + public void MapWithUndeclaredPropertiesAnytype2Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype2' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesAnytype3' + /// + [Test] + public void MapWithUndeclaredPropertiesAnytype3Test() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesAnytype3' + } + /// + /// Test the property 'EmptyMap' + /// + [Test] + public void EmptyMapTest() + { + // TODO unit test for the property 'EmptyMap' + } + /// + /// Test the property 'MapWithUndeclaredPropertiesString' + /// + [Test] + public void MapWithUndeclaredPropertiesStringTest() + { + // TODO unit test for the property 'MapWithUndeclaredPropertiesString' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AnimalTests.cs new file mode 100644 index 00000000000..f4224abd70f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AnimalTests.cs @@ -0,0 +1,93 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Animal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Animal + //private Animal instance; + + public AnimalTests() + { + // TODO uncomment below to create an instance of Animal + //instance = new Animal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Animal + /// + [Test] + public void AnimalInstanceTest() + { + // TODO uncomment below to test "IsType" Animal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a Cat from type Animal + /// + [Test] + public void CatDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Cat from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Cat().ToJson())); + } + /// + /// Test deserialize a Dog from type Animal + /// + [Test] + public void DogDeserializeFromAnimalTest() + { + // TODO uncomment below to test deserialize a Dog from type Animal + //Assert.IsType(JsonConvert.DeserializeObject(new Dog().ToJson())); + } + + /// + /// Test the property 'ClassName' + /// + [Test] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Color' + /// + [Test] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs new file mode 100644 index 00000000000..9562b8029bc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ApiResponseTests.cs @@ -0,0 +1,83 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Test] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Code' + /// + [Test] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + /// + /// Test the property 'Type' + /// + [Test] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'Message' + /// + [Test] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs new file mode 100644 index 00000000000..26ba6e79e24 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AppleReqTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing AppleReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for AppleReq + //private AppleReq instance; + + public AppleReqTests() + { + // TODO uncomment below to create an instance of AppleReq + //instance = new AppleReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AppleReq + /// + [Test] + public void AppleReqInstanceTest() + { + // TODO uncomment below to test "IsType" AppleReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Test] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Mealy' + /// + [Test] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AppleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AppleTests.cs new file mode 100644 index 00000000000..0c5ba63b2cf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/AppleTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Apple + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class AppleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Apple + //private Apple instance; + + public AppleTests() + { + // TODO uncomment below to create an instance of Apple + //instance = new Apple(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Apple + /// + [Test] + public void AppleInstanceTest() + { + // TODO uncomment below to test "IsType" Apple + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Test] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Test] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..5800f457b15 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayOfArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly + //private ArrayOfArrayOfNumberOnly instance; + + public ArrayOfArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly + //instance = new ArrayOfArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfArrayOfNumberOnly + /// + [Test] + public void ArrayOfArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfArrayOfNumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayArrayNumber' + /// + [Test] + public void ArrayArrayNumberTest() + { + // TODO unit test for the property 'ArrayArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs new file mode 100644 index 00000000000..4cdbd60a826 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayOfNumberOnlyTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayOfNumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayOfNumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayOfNumberOnly + //private ArrayOfNumberOnly instance; + + public ArrayOfNumberOnlyTests() + { + // TODO uncomment below to create an instance of ArrayOfNumberOnly + //instance = new ArrayOfNumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayOfNumberOnly + /// + [Test] + public void ArrayOfNumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayOfNumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayNumber' + /// + [Test] + public void ArrayNumberTest() + { + // TODO unit test for the property 'ArrayNumber' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs new file mode 100644 index 00000000000..c274c6ab67c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ArrayTestTests.cs @@ -0,0 +1,83 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ArrayTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ArrayTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ArrayTest + //private ArrayTest instance; + + public ArrayTestTests() + { + // TODO uncomment below to create an instance of ArrayTest + //instance = new ArrayTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ArrayTest + /// + [Test] + public void ArrayTestInstanceTest() + { + // TODO uncomment below to test "IsType" ArrayTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ArrayOfString' + /// + [Test] + public void ArrayOfStringTest() + { + // TODO unit test for the property 'ArrayOfString' + } + /// + /// Test the property 'ArrayArrayOfInteger' + /// + [Test] + public void ArrayArrayOfIntegerTest() + { + // TODO unit test for the property 'ArrayArrayOfInteger' + } + /// + /// Test the property 'ArrayArrayOfModel' + /// + [Test] + public void ArrayArrayOfModelTest() + { + // TODO unit test for the property 'ArrayArrayOfModel' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs new file mode 100644 index 00000000000..058d71226a2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BananaReqTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing BananaReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BananaReq + //private BananaReq instance; + + public BananaReqTests() + { + // TODO uncomment below to create an instance of BananaReq + //instance = new BananaReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BananaReq + /// + [Test] + public void BananaReqInstanceTest() + { + // TODO uncomment below to test "IsType" BananaReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'LengthCm' + /// + [Test] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + /// + /// Test the property 'Sweet' + /// + [Test] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BananaTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BananaTests.cs new file mode 100644 index 00000000000..d5112b7a47a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BananaTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Banana + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BananaTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Banana + //private Banana instance; + + public BananaTests() + { + // TODO uncomment below to create an instance of Banana + //instance = new Banana(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Banana + /// + [Test] + public void BananaInstanceTest() + { + // TODO uncomment below to test "IsType" Banana + //Assert.IsType(instance); + } + + + /// + /// Test the property 'LengthCm' + /// + [Test] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs new file mode 100644 index 00000000000..2cb313e243d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/BasquePigTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing BasquePig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BasquePigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BasquePig + //private BasquePig instance; + + public BasquePigTests() + { + // TODO uncomment below to create an instance of BasquePig + //instance = new BasquePig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BasquePig + /// + [Test] + public void BasquePigInstanceTest() + { + // TODO uncomment below to test "IsType" BasquePig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Test] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs new file mode 100644 index 00000000000..5d7c929f9ef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CapitalizationTests.cs @@ -0,0 +1,107 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Capitalization + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CapitalizationTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Capitalization + //private Capitalization instance; + + public CapitalizationTests() + { + // TODO uncomment below to create an instance of Capitalization + //instance = new Capitalization(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Capitalization + /// + [Test] + public void CapitalizationInstanceTest() + { + // TODO uncomment below to test "IsType" Capitalization + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SmallCamel' + /// + [Test] + public void SmallCamelTest() + { + // TODO unit test for the property 'SmallCamel' + } + /// + /// Test the property 'CapitalCamel' + /// + [Test] + public void CapitalCamelTest() + { + // TODO unit test for the property 'CapitalCamel' + } + /// + /// Test the property 'SmallSnake' + /// + [Test] + public void SmallSnakeTest() + { + // TODO unit test for the property 'SmallSnake' + } + /// + /// Test the property 'CapitalSnake' + /// + [Test] + public void CapitalSnakeTest() + { + // TODO unit test for the property 'CapitalSnake' + } + /// + /// Test the property 'SCAETHFlowPoints' + /// + [Test] + public void SCAETHFlowPointsTest() + { + // TODO unit test for the property 'SCAETHFlowPoints' + } + /// + /// Test the property 'ATT_NAME' + /// + [Test] + public void ATT_NAMETest() + { + // TODO unit test for the property 'ATT_NAME' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs new file mode 100644 index 00000000000..1c3850b8cb9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CatAllOfTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing CatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for CatAllOf + //private CatAllOf instance; + + public CatAllOfTests() + { + // TODO uncomment below to create an instance of CatAllOf + //instance = new CatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of CatAllOf + /// + [Test] + public void CatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" CatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Test] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CatTests.cs new file mode 100644 index 00000000000..67ceac90588 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CatTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Cat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Cat + //private Cat instance; + + public CatTests() + { + // TODO uncomment below to create an instance of Cat + //instance = new Cat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Cat + /// + [Test] + public void CatInstanceTest() + { + // TODO uncomment below to test "IsType" Cat + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Declawed' + /// + [Test] + public void DeclawedTest() + { + // TODO unit test for the property 'Declawed' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CategoryTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CategoryTests.cs new file mode 100644 index 00000000000..a8ffd8b5dfd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/CategoryTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Test] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs new file mode 100644 index 00000000000..e5ad6c39f83 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ChildCatAllOfTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCatAllOf + //private ChildCatAllOf instance; + + public ChildCatAllOfTests() + { + // TODO uncomment below to create an instance of ChildCatAllOf + //instance = new ChildCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCatAllOf + /// + [Test] + public void ChildCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCatAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Test] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs new file mode 100644 index 00000000000..cd37ee5fddf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ChildCatTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ChildCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ChildCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ChildCat + //private ChildCat instance; + + public ChildCatTests() + { + // TODO uncomment below to create an instance of ChildCat + //instance = new ChildCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ChildCat + /// + [Test] + public void ChildCatInstanceTest() + { + // TODO uncomment below to test "IsType" ChildCat + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PetType' + /// + [Test] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs new file mode 100644 index 00000000000..0ff535c000f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ClassModel + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ClassModelTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ClassModel + //private ClassModel instance; + + public ClassModelTests() + { + // TODO uncomment below to create an instance of ClassModel + //instance = new ClassModel(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ClassModel + /// + [Test] + public void ClassModelInstanceTest() + { + // TODO uncomment below to test "IsType" ClassModel + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Class' + /// + [Test] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs new file mode 100644 index 00000000000..b0238f3f2ab --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ComplexQuadrilateralTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ComplexQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ComplexQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ComplexQuadrilateral + //private ComplexQuadrilateral instance; + + public ComplexQuadrilateralTests() + { + // TODO uncomment below to create an instance of ComplexQuadrilateral + //instance = new ComplexQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ComplexQuadrilateral + /// + [Test] + public void ComplexQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" ComplexQuadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Test] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs new file mode 100644 index 00000000000..cd9cf8f5429 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DanishPigTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DanishPig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DanishPigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DanishPig + //private DanishPig instance; + + public DanishPigTests() + { + // TODO uncomment below to create an instance of DanishPig + //instance = new DanishPig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DanishPig + /// + [Test] + public void DanishPigInstanceTest() + { + // TODO uncomment below to test "IsType" DanishPig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Test] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs new file mode 100644 index 00000000000..5a39eded762 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DateOnlyClassTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DateOnlyClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DateOnlyClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DateOnlyClass + //private DateOnlyClass instance; + + public DateOnlyClassTests() + { + // TODO uncomment below to create an instance of DateOnlyClass + //instance = new DateOnlyClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DateOnlyClass + /// + [Test] + public void DateOnlyClassInstanceTest() + { + // TODO uncomment below to test "IsType" DateOnlyClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'DateOnlyProperty' + /// + [Test] + public void DateOnlyPropertyTest() + { + // TODO unit test for the property 'DateOnlyProperty' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs new file mode 100644 index 00000000000..422afdae10c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DeprecatedObjectTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DeprecatedObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DeprecatedObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DeprecatedObject + //private DeprecatedObject instance; + + public DeprecatedObjectTests() + { + // TODO uncomment below to create an instance of DeprecatedObject + //instance = new DeprecatedObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DeprecatedObject + /// + [Test] + public void DeprecatedObjectInstanceTest() + { + // TODO uncomment below to test "IsType" DeprecatedObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs new file mode 100644 index 00000000000..4eb50bfe931 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DogAllOfTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing DogAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for DogAllOf + //private DogAllOf instance; + + public DogAllOfTests() + { + // TODO uncomment below to create an instance of DogAllOf + //instance = new DogAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of DogAllOf + /// + [Test] + public void DogAllOfInstanceTest() + { + // TODO uncomment below to test "IsType" DogAllOf + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Test] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DogTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DogTests.cs new file mode 100644 index 00000000000..ef33138673e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DogTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Dog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Dog + //private Dog instance; + + public DogTests() + { + // TODO uncomment below to create an instance of Dog + //instance = new Dog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Dog + /// + [Test] + public void DogInstanceTest() + { + // TODO uncomment below to test "IsType" Dog + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Breed' + /// + [Test] + public void BreedTest() + { + // TODO unit test for the property 'Breed' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DrawingTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DrawingTests.cs new file mode 100644 index 00000000000..e0d787fff17 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/DrawingTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Drawing + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class DrawingTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Drawing + //private Drawing instance; + + public DrawingTests() + { + // TODO uncomment below to create an instance of Drawing + //instance = new Drawing(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Drawing + /// + [Test] + public void DrawingInstanceTest() + { + // TODO uncomment below to test "IsType" Drawing + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MainShape' + /// + [Test] + public void MainShapeTest() + { + // TODO unit test for the property 'MainShape' + } + /// + /// Test the property 'ShapeOrNull' + /// + [Test] + public void ShapeOrNullTest() + { + // TODO unit test for the property 'ShapeOrNull' + } + /// + /// Test the property 'NullableShape' + /// + [Test] + public void NullableShapeTest() + { + // TODO unit test for the property 'NullableShape' + } + /// + /// Test the property 'Shapes' + /// + [Test] + public void ShapesTest() + { + // TODO unit test for the property 'Shapes' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs new file mode 100644 index 00000000000..caa95abbb23 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumArraysTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumArrays + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumArraysTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumArrays + //private EnumArrays instance; + + public EnumArraysTests() + { + // TODO uncomment below to create an instance of EnumArrays + //instance = new EnumArrays(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumArrays + /// + [Test] + public void EnumArraysInstanceTest() + { + // TODO uncomment below to test "IsType" EnumArrays + //Assert.IsType(instance); + } + + + /// + /// Test the property 'JustSymbol' + /// + [Test] + public void JustSymbolTest() + { + // TODO unit test for the property 'JustSymbol' + } + /// + /// Test the property 'ArrayEnum' + /// + [Test] + public void ArrayEnumTest() + { + // TODO unit test for the property 'ArrayEnum' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs new file mode 100644 index 00000000000..a273865be5e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumClassTests.cs @@ -0,0 +1,59 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumClass + //private EnumClass instance; + + public EnumClassTests() + { + // TODO uncomment below to create an instance of EnumClass + //instance = new EnumClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumClass + /// + [Test] + public void EnumClassInstanceTest() + { + // TODO uncomment below to test "IsType" EnumClass + //Assert.IsType(instance); + } + + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs new file mode 100644 index 00000000000..7ae3a87006f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EnumTestTests.cs @@ -0,0 +1,131 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EnumTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EnumTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EnumTest + //private EnumTest instance; + + public EnumTestTests() + { + // TODO uncomment below to create an instance of EnumTest + //instance = new EnumTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EnumTest + /// + [Test] + public void EnumTestInstanceTest() + { + // TODO uncomment below to test "IsType" EnumTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EnumString' + /// + [Test] + public void EnumStringTest() + { + // TODO unit test for the property 'EnumString' + } + /// + /// Test the property 'EnumStringRequired' + /// + [Test] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// + /// Test the property 'EnumInteger' + /// + [Test] + public void EnumIntegerTest() + { + // TODO unit test for the property 'EnumInteger' + } + /// + /// Test the property 'EnumIntegerOnly' + /// + [Test] + public void EnumIntegerOnlyTest() + { + // TODO unit test for the property 'EnumIntegerOnly' + } + /// + /// Test the property 'EnumNumber' + /// + [Test] + public void EnumNumberTest() + { + // TODO unit test for the property 'EnumNumber' + } + /// + /// Test the property 'OuterEnum' + /// + [Test] + public void OuterEnumTest() + { + // TODO unit test for the property 'OuterEnum' + } + /// + /// Test the property 'OuterEnumInteger' + /// + [Test] + public void OuterEnumIntegerTest() + { + // TODO unit test for the property 'OuterEnumInteger' + } + /// + /// Test the property 'OuterEnumDefaultValue' + /// + [Test] + public void OuterEnumDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumDefaultValue' + } + /// + /// Test the property 'OuterEnumIntegerDefaultValue' + /// + [Test] + public void OuterEnumIntegerDefaultValueTest() + { + // TODO unit test for the property 'OuterEnumIntegerDefaultValue' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs new file mode 100644 index 00000000000..7530ad8087c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/EquilateralTriangleTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing EquilateralTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class EquilateralTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for EquilateralTriangle + //private EquilateralTriangle instance; + + public EquilateralTriangleTests() + { + // TODO uncomment below to create an instance of EquilateralTriangle + //instance = new EquilateralTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of EquilateralTriangle + /// + [Test] + public void EquilateralTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" EquilateralTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Test] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs new file mode 100644 index 00000000000..971b8adbc9f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FileSchemaTestClassTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FileSchemaTestClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileSchemaTestClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FileSchemaTestClass + //private FileSchemaTestClass instance; + + public FileSchemaTestClassTests() + { + // TODO uncomment below to create an instance of FileSchemaTestClass + //instance = new FileSchemaTestClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FileSchemaTestClass + /// + [Test] + public void FileSchemaTestClassInstanceTest() + { + // TODO uncomment below to test "IsType" FileSchemaTestClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'File' + /// + [Test] + public void FileTest() + { + // TODO unit test for the property 'File' + } + /// + /// Test the property 'Files' + /// + [Test] + public void FilesTest() + { + // TODO unit test for the property 'Files' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FileTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FileTests.cs new file mode 100644 index 00000000000..27d417cf409 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FileTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing File + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FileTests : IDisposable + { + // TODO uncomment below to declare an instance variable for File + //private File instance; + + public FileTests() + { + // TODO uncomment below to create an instance of File + //instance = new File(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of File + /// + [Test] + public void FileInstanceTest() + { + // TODO uncomment below to test "IsType" File + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SourceURI' + /// + [Test] + public void SourceURITest() + { + // TODO unit test for the property 'SourceURI' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs new file mode 100644 index 00000000000..6c2350cd28c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FooGetDefaultResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooGetDefaultResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FooGetDefaultResponse + //private FooGetDefaultResponse instance; + + public FooGetDefaultResponseTests() + { + // TODO uncomment below to create an instance of FooGetDefaultResponse + //instance = new FooGetDefaultResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FooGetDefaultResponse + /// + [Test] + public void FooGetDefaultResponseInstanceTest() + { + // TODO uncomment below to test "IsType" FooGetDefaultResponse + //Assert.IsType(instance); + } + + + /// + /// Test the property 'String' + /// + [Test] + public void StringTest() + { + // TODO unit test for the property 'String' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FooTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FooTests.cs new file mode 100644 index 00000000000..fb264e72f61 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FooTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Foo + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FooTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Foo + //private Foo instance; + + public FooTests() + { + // TODO uncomment below to create an instance of Foo + //instance = new Foo(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Foo + /// + [Test] + public void FooInstanceTest() + { + // TODO uncomment below to test "IsType" Foo + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Test] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs new file mode 100644 index 00000000000..2d797f8b1a3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -0,0 +1,187 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FormatTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FormatTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FormatTest + //private FormatTest instance; + + public FormatTestTests() + { + // TODO uncomment below to create an instance of FormatTest + //instance = new FormatTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FormatTest + /// + [Test] + public void FormatTestInstanceTest() + { + // TODO uncomment below to test "IsType" FormatTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Integer' + /// + [Test] + public void IntegerTest() + { + // TODO unit test for the property 'Integer' + } + /// + /// Test the property 'Int32' + /// + [Test] + public void Int32Test() + { + // TODO unit test for the property 'Int32' + } + /// + /// Test the property 'Int64' + /// + [Test] + public void Int64Test() + { + // TODO unit test for the property 'Int64' + } + /// + /// Test the property 'Number' + /// + [Test] + public void NumberTest() + { + // TODO unit test for the property 'Number' + } + /// + /// Test the property 'Float' + /// + [Test] + public void FloatTest() + { + // TODO unit test for the property 'Float' + } + /// + /// Test the property 'Double' + /// + [Test] + public void DoubleTest() + { + // TODO unit test for the property 'Double' + } + /// + /// Test the property 'Decimal' + /// + [Test] + public void DecimalTest() + { + // TODO unit test for the property 'Decimal' + } + /// + /// Test the property 'String' + /// + [Test] + public void StringTest() + { + // TODO unit test for the property 'String' + } + /// + /// Test the property 'Byte' + /// + [Test] + public void ByteTest() + { + // TODO unit test for the property 'Byte' + } + /// + /// Test the property 'Binary' + /// + [Test] + public void BinaryTest() + { + // TODO unit test for the property 'Binary' + } + /// + /// Test the property 'Date' + /// + [Test] + public void DateTest() + { + // TODO unit test for the property 'Date' + } + /// + /// Test the property 'DateTime' + /// + [Test] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Uuid' + /// + [Test] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Password' + /// + [Test] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'PatternWithDigits' + /// + [Test] + public void PatternWithDigitsTest() + { + // TODO unit test for the property 'PatternWithDigits' + } + /// + /// Test the property 'PatternWithDigitsAndDelimiter' + /// + [Test] + public void PatternWithDigitsAndDelimiterTest() + { + // TODO unit test for the property 'PatternWithDigitsAndDelimiter' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs new file mode 100644 index 00000000000..216f6e9ed23 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FruitReqTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing FruitReq + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitReqTests : IDisposable + { + // TODO uncomment below to declare an instance variable for FruitReq + //private FruitReq instance; + + public FruitReqTests() + { + // TODO uncomment below to create an instance of FruitReq + //instance = new FruitReq(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of FruitReq + /// + [Test] + public void FruitReqInstanceTest() + { + // TODO uncomment below to test "IsType" FruitReq + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Cultivar' + /// + [Test] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Mealy' + /// + [Test] + public void MealyTest() + { + // TODO unit test for the property 'Mealy' + } + /// + /// Test the property 'LengthCm' + /// + [Test] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + /// + /// Test the property 'Sweet' + /// + [Test] + public void SweetTest() + { + // TODO unit test for the property 'Sweet' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FruitTests.cs new file mode 100644 index 00000000000..35c0fd5df7e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/FruitTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Fruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class FruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Fruit + //private Fruit instance; + + public FruitTests() + { + // TODO uncomment below to create an instance of Fruit + //instance = new Fruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Fruit + /// + [Test] + public void FruitInstanceTest() + { + // TODO uncomment below to test "IsType" Fruit + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Color' + /// + [Test] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'Cultivar' + /// + [Test] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Test] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + /// + /// Test the property 'LengthCm' + /// + [Test] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs new file mode 100644 index 00000000000..34dbc9d271f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/GmFruitTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GmFruit + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GmFruitTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GmFruit + //private GmFruit instance; + + public GmFruitTests() + { + // TODO uncomment below to create an instance of GmFruit + //instance = new GmFruit(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GmFruit + /// + [Test] + public void GmFruitInstanceTest() + { + // TODO uncomment below to test "IsType" GmFruit + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Color' + /// + [Test] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'Cultivar' + /// + [Test] + public void CultivarTest() + { + // TODO unit test for the property 'Cultivar' + } + /// + /// Test the property 'Origin' + /// + [Test] + public void OriginTest() + { + // TODO unit test for the property 'Origin' + } + /// + /// Test the property 'LengthCm' + /// + [Test] + public void LengthCmTest() + { + // TODO unit test for the property 'LengthCm' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs new file mode 100644 index 00000000000..c66e6d56f66 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/GrandparentAnimalTests.cs @@ -0,0 +1,85 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing GrandparentAnimal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class GrandparentAnimalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for GrandparentAnimal + //private GrandparentAnimal instance; + + public GrandparentAnimalTests() + { + // TODO uncomment below to create an instance of GrandparentAnimal + //instance = new GrandparentAnimal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of GrandparentAnimal + /// + [Test] + public void GrandparentAnimalInstanceTest() + { + // TODO uncomment below to test "IsType" GrandparentAnimal + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Test] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + /// + /// Test deserialize a ParentPet from type GrandparentAnimal + /// + [Test] + public void ParentPetDeserializeFromGrandparentAnimalTest() + { + // TODO uncomment below to test deserialize a ParentPet from type GrandparentAnimal + //Assert.IsType(JsonConvert.DeserializeObject(new ParentPet().ToJson())); + } + + /// + /// Test the property 'PetType' + /// + [Test] + public void PetTypeTest() + { + // TODO unit test for the property 'PetType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs new file mode 100644 index 00000000000..2dd8cc591f8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/HasOnlyReadOnlyTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing HasOnlyReadOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HasOnlyReadOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HasOnlyReadOnly + //private HasOnlyReadOnly instance; + + public HasOnlyReadOnlyTests() + { + // TODO uncomment below to create an instance of HasOnlyReadOnly + //instance = new HasOnlyReadOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HasOnlyReadOnly + /// + [Test] + public void HasOnlyReadOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" HasOnlyReadOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Test] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Foo' + /// + [Test] + public void FooTest() + { + // TODO unit test for the property 'Foo' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs new file mode 100644 index 00000000000..80ebb93e08e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/HealthCheckResultTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing HealthCheckResult + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class HealthCheckResultTests : IDisposable + { + // TODO uncomment below to declare an instance variable for HealthCheckResult + //private HealthCheckResult instance; + + public HealthCheckResultTests() + { + // TODO uncomment below to create an instance of HealthCheckResult + //instance = new HealthCheckResult(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of HealthCheckResult + /// + [Test] + public void HealthCheckResultInstanceTest() + { + // TODO uncomment below to test "IsType" HealthCheckResult + //Assert.IsType(instance); + } + + + /// + /// Test the property 'NullableMessage' + /// + [Test] + public void NullableMessageTest() + { + // TODO unit test for the property 'NullableMessage' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs new file mode 100644 index 00000000000..b7ba1a6794d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/IsoscelesTriangleTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing IsoscelesTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class IsoscelesTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for IsoscelesTriangle + //private IsoscelesTriangle instance; + + public IsoscelesTriangleTests() + { + // TODO uncomment below to create an instance of IsoscelesTriangle + //instance = new IsoscelesTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of IsoscelesTriangle + /// + [Test] + public void IsoscelesTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" IsoscelesTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Test] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ListTests.cs new file mode 100644 index 00000000000..d4b921008ff --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ListTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing List + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for List + //private List instance; + + public ListTests() + { + // TODO uncomment below to create an instance of List + //instance = new List(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of List + /// + [Test] + public void ListInstanceTest() + { + // TODO uncomment below to test "IsType" List + //Assert.IsType(instance); + } + + + /// + /// Test the property '_123List' + /// + [Test] + public void _123ListTest() + { + // TODO unit test for the property '_123List' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..fe53ed94de6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Test] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + /// + /// Test the property 'EscapedLiteralString' + /// + [Test] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Test] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MammalTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MammalTests.cs new file mode 100644 index 00000000000..17eb2fb79b6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MammalTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Mammal + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MammalTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Mammal + //private Mammal instance; + + public MammalTests() + { + // TODO uncomment below to create an instance of Mammal + //instance = new Mammal(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Mammal + /// + [Test] + public void MammalInstanceTest() + { + // TODO uncomment below to test "IsType" Mammal + //Assert.IsType(instance); + } + + + /// + /// Test the property 'HasBaleen' + /// + [Test] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + /// + /// Test the property 'HasTeeth' + /// + [Test] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + /// + /// Test the property 'ClassName' + /// + [Test] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + /// + /// Test the property 'Type' + /// + [Test] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MapTestTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MapTestTests.cs new file mode 100644 index 00000000000..b76e755c815 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MapTestTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MapTest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MapTestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MapTest + //private MapTest instance; + + public MapTestTests() + { + // TODO uncomment below to create an instance of MapTest + //instance = new MapTest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MapTest + /// + [Test] + public void MapTestInstanceTest() + { + // TODO uncomment below to test "IsType" MapTest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MapMapOfString' + /// + [Test] + public void MapMapOfStringTest() + { + // TODO unit test for the property 'MapMapOfString' + } + /// + /// Test the property 'MapOfEnumString' + /// + [Test] + public void MapOfEnumStringTest() + { + // TODO unit test for the property 'MapOfEnumString' + } + /// + /// Test the property 'DirectMap' + /// + [Test] + public void DirectMapTest() + { + // TODO unit test for the property 'DirectMap' + } + /// + /// Test the property 'IndirectMap' + /// + [Test] + public void IndirectMapTest() + { + // TODO unit test for the property 'IndirectMap' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs new file mode 100644 index 00000000000..42ea53f9da3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/MixedPropertiesAndAdditionalPropertiesClassTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixedPropertiesAndAdditionalPropertiesClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixedPropertiesAndAdditionalPropertiesClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixedPropertiesAndAdditionalPropertiesClass + //private MixedPropertiesAndAdditionalPropertiesClass instance; + + public MixedPropertiesAndAdditionalPropertiesClassTests() + { + // TODO uncomment below to create an instance of MixedPropertiesAndAdditionalPropertiesClass + //instance = new MixedPropertiesAndAdditionalPropertiesClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixedPropertiesAndAdditionalPropertiesClass + /// + [Test] + public void MixedPropertiesAndAdditionalPropertiesClassInstanceTest() + { + // TODO uncomment below to test "IsType" MixedPropertiesAndAdditionalPropertiesClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'UuidWithPattern' + /// + [Test] + public void UuidWithPatternTest() + { + // TODO unit test for the property 'UuidWithPattern' + } + /// + /// Test the property 'Uuid' + /// + [Test] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'DateTime' + /// + [Test] + public void DateTimeTest() + { + // TODO unit test for the property 'DateTime' + } + /// + /// Test the property 'Map' + /// + [Test] + public void MapTest() + { + // TODO unit test for the property 'Map' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs new file mode 100644 index 00000000000..ef14ea7ce6f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Model200Response + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class Model200ResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Model200Response + //private Model200Response instance; + + public Model200ResponseTests() + { + // TODO uncomment below to create an instance of Model200Response + //instance = new Model200Response(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Model200Response + /// + [Test] + public void Model200ResponseInstanceTest() + { + // TODO uncomment below to test "IsType" Model200Response + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'Class' + /// + [Test] + public void ClassTest() + { + // TODO unit test for the property 'Class' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs new file mode 100644 index 00000000000..16393b85aaf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ModelClientTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ModelClient + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ModelClientTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ModelClient + //private ModelClient instance; + + public ModelClientTests() + { + // TODO uncomment below to create an instance of ModelClient + //instance = new ModelClient(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ModelClient + /// + [Test] + public void ModelClientInstanceTest() + { + // TODO uncomment below to test "IsType" ModelClient + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Client' + /// + [Test] + public void _ClientTest() + { + // TODO unit test for the property '_Client' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NameTests.cs new file mode 100644 index 00000000000..7131673e7bf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NameTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Name + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Name + //private Name instance; + + public NameTests() + { + // TODO uncomment below to create an instance of Name + //instance = new Name(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Name + /// + [Test] + public void NameInstanceTest() + { + // TODO uncomment below to test "IsType" Name + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Name' + /// + [Test] + public void _NameTest() + { + // TODO unit test for the property '_Name' + } + /// + /// Test the property 'SnakeCase' + /// + [Test] + public void SnakeCaseTest() + { + // TODO unit test for the property 'SnakeCase' + } + /// + /// Test the property 'Property' + /// + [Test] + public void PropertyTest() + { + // TODO unit test for the property 'Property' + } + /// + /// Test the property '_123Number' + /// + [Test] + public void _123NumberTest() + { + // TODO unit test for the property '_123Number' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs new file mode 100644 index 00000000000..029631e7671 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableClassTests.cs @@ -0,0 +1,155 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableClass + //private NullableClass instance; + + public NullableClassTests() + { + // TODO uncomment below to create an instance of NullableClass + //instance = new NullableClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableClass + /// + [Test] + public void NullableClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'IntegerProp' + /// + [Test] + public void IntegerPropTest() + { + // TODO unit test for the property 'IntegerProp' + } + /// + /// Test the property 'NumberProp' + /// + [Test] + public void NumberPropTest() + { + // TODO unit test for the property 'NumberProp' + } + /// + /// Test the property 'BooleanProp' + /// + [Test] + public void BooleanPropTest() + { + // TODO unit test for the property 'BooleanProp' + } + /// + /// Test the property 'StringProp' + /// + [Test] + public void StringPropTest() + { + // TODO unit test for the property 'StringProp' + } + /// + /// Test the property 'DateProp' + /// + [Test] + public void DatePropTest() + { + // TODO unit test for the property 'DateProp' + } + /// + /// Test the property 'DatetimeProp' + /// + [Test] + public void DatetimePropTest() + { + // TODO unit test for the property 'DatetimeProp' + } + /// + /// Test the property 'ArrayNullableProp' + /// + [Test] + public void ArrayNullablePropTest() + { + // TODO unit test for the property 'ArrayNullableProp' + } + /// + /// Test the property 'ArrayAndItemsNullableProp' + /// + [Test] + public void ArrayAndItemsNullablePropTest() + { + // TODO unit test for the property 'ArrayAndItemsNullableProp' + } + /// + /// Test the property 'ArrayItemsNullable' + /// + [Test] + public void ArrayItemsNullableTest() + { + // TODO unit test for the property 'ArrayItemsNullable' + } + /// + /// Test the property 'ObjectNullableProp' + /// + [Test] + public void ObjectNullablePropTest() + { + // TODO unit test for the property 'ObjectNullableProp' + } + /// + /// Test the property 'ObjectAndItemsNullableProp' + /// + [Test] + public void ObjectAndItemsNullablePropTest() + { + // TODO unit test for the property 'ObjectAndItemsNullableProp' + } + /// + /// Test the property 'ObjectItemsNullable' + /// + [Test] + public void ObjectItemsNullableTest() + { + // TODO unit test for the property 'ObjectItemsNullable' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs new file mode 100644 index 00000000000..c6835470618 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableGuidClassTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableGuidClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableGuidClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableGuidClass + //private NullableGuidClass instance; + + public NullableGuidClassTests() + { + // TODO uncomment below to create an instance of NullableGuidClass + //instance = new NullableGuidClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableGuidClass + /// + [Test] + public void NullableGuidClassInstanceTest() + { + // TODO uncomment below to test "IsType" NullableGuidClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Uuid' + /// + [Test] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs new file mode 100644 index 00000000000..278ebdb2d8a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NullableShapeTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NullableShape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NullableShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NullableShape + //private NullableShape instance; + + public NullableShapeTests() + { + // TODO uncomment below to create an instance of NullableShape + //instance = new NullableShape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NullableShape + /// + [Test] + public void NullableShapeInstanceTest() + { + // TODO uncomment below to test "IsType" NullableShape + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Test] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs new file mode 100644 index 00000000000..cbead7232a9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/NumberOnlyTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing NumberOnly + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class NumberOnlyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for NumberOnly + //private NumberOnly instance; + + public NumberOnlyTests() + { + // TODO uncomment below to create an instance of NumberOnly + //instance = new NumberOnly(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of NumberOnly + /// + [Test] + public void NumberOnlyInstanceTest() + { + // TODO uncomment below to test "IsType" NumberOnly + //Assert.IsType(instance); + } + + + /// + /// Test the property 'JustNumber' + /// + [Test] + public void JustNumberTest() + { + // TODO unit test for the property 'JustNumber' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs new file mode 100644 index 00000000000..d3b17323263 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ObjectWithDeprecatedFieldsTests.cs @@ -0,0 +1,91 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ObjectWithDeprecatedFields + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ObjectWithDeprecatedFieldsTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ObjectWithDeprecatedFields + //private ObjectWithDeprecatedFields instance; + + public ObjectWithDeprecatedFieldsTests() + { + // TODO uncomment below to create an instance of ObjectWithDeprecatedFields + //instance = new ObjectWithDeprecatedFields(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ObjectWithDeprecatedFields + /// + [Test] + public void ObjectWithDeprecatedFieldsInstanceTest() + { + // TODO uncomment below to test "IsType" ObjectWithDeprecatedFields + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Uuid' + /// + [Test] + public void UuidTest() + { + // TODO unit test for the property 'Uuid' + } + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'DeprecatedRef' + /// + [Test] + public void DeprecatedRefTest() + { + // TODO unit test for the property 'DeprecatedRef' + } + /// + /// Test the property 'Bars' + /// + [Test] + public void BarsTest() + { + // TODO unit test for the property 'Bars' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OrderTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OrderTests.cs new file mode 100644 index 00000000000..683d422a3f4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OrderTests.cs @@ -0,0 +1,107 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Test] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'PetId' + /// + [Test] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + /// + /// Test the property 'Quantity' + /// + [Test] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + /// + /// Test the property 'ShipDate' + /// + [Test] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + /// + /// Test the property 'Complete' + /// + [Test] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs new file mode 100644 index 00000000000..39c7730a0f2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterCompositeTests.cs @@ -0,0 +1,83 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterComposite + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterCompositeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + public OuterCompositeTests() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterComposite + /// + [Test] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsType" OuterComposite + //Assert.IsType(instance); + } + + + /// + /// Test the property 'MyNumber' + /// + [Test] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + /// + /// Test the property 'MyString' + /// + [Test] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + /// + /// Test the property 'MyBoolean' + /// + [Test] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs new file mode 100644 index 00000000000..6376c258476 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumDefaultValueTests.cs @@ -0,0 +1,59 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumDefaultValue + //private OuterEnumDefaultValue instance; + + public OuterEnumDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumDefaultValue + //instance = new OuterEnumDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumDefaultValue + /// + [Test] + public void OuterEnumDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumDefaultValue + //Assert.IsType(instance); + } + + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs new file mode 100644 index 00000000000..b8fd4b863dc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerDefaultValueTests.cs @@ -0,0 +1,59 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumIntegerDefaultValue + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerDefaultValueTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumIntegerDefaultValue + //private OuterEnumIntegerDefaultValue instance; + + public OuterEnumIntegerDefaultValueTests() + { + // TODO uncomment below to create an instance of OuterEnumIntegerDefaultValue + //instance = new OuterEnumIntegerDefaultValue(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumIntegerDefaultValue + /// + [Test] + public void OuterEnumIntegerDefaultValueInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumIntegerDefaultValue + //Assert.IsType(instance); + } + + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs new file mode 100644 index 00000000000..3cfb128a9e2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumIntegerTests.cs @@ -0,0 +1,59 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnumInteger + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumIntegerTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnumInteger + //private OuterEnumInteger instance; + + public OuterEnumIntegerTests() + { + // TODO uncomment below to create an instance of OuterEnumInteger + //instance = new OuterEnumInteger(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnumInteger + /// + [Test] + public void OuterEnumIntegerInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnumInteger + //Assert.IsType(instance); + } + + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs new file mode 100644 index 00000000000..a13bfd83401 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/OuterEnumTests.cs @@ -0,0 +1,59 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing OuterEnum + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OuterEnumTests : IDisposable + { + // TODO uncomment below to declare an instance variable for OuterEnum + //private OuterEnum instance; + + public OuterEnumTests() + { + // TODO uncomment below to create an instance of OuterEnum + //instance = new OuterEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of OuterEnum + /// + [Test] + public void OuterEnumInstanceTest() + { + // TODO uncomment below to test "IsType" OuterEnum + //Assert.IsType(instance); + } + + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs new file mode 100644 index 00000000000..1f16980516b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ParentPetTests.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ParentPet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ParentPetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ParentPet + //private ParentPet instance; + + public ParentPetTests() + { + // TODO uncomment below to create an instance of ParentPet + //instance = new ParentPet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ParentPet + /// + [Test] + public void ParentPetInstanceTest() + { + // TODO uncomment below to test "IsType" ParentPet + //Assert.IsType(instance); + } + + /// + /// Test deserialize a ChildCat from type ParentPet + /// + [Test] + public void ChildCatDeserializeFromParentPetTest() + { + // TODO uncomment below to test deserialize a ChildCat from type ParentPet + //Assert.IsType(JsonConvert.DeserializeObject(new ChildCat().ToJson())); + } + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PetTests.cs new file mode 100644 index 00000000000..7b7fff9cf81 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -0,0 +1,107 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Test] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Category' + /// + [Test] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PhotoUrls' + /// + [Test] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + /// + /// Test the property 'Tags' + /// + [Test] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PigTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PigTests.cs new file mode 100644 index 00000000000..a18f7330cef --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PigTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pig + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PigTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pig + //private Pig instance; + + public PigTests() + { + // TODO uncomment below to create an instance of Pig + //instance = new Pig(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pig + /// + [Test] + public void PigInstanceTest() + { + // TODO uncomment below to test "IsType" Pig + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ClassName' + /// + [Test] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs new file mode 100644 index 00000000000..435a70afe61 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/PolymorphicPropertyTests.cs @@ -0,0 +1,59 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing PolymorphicProperty + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PolymorphicPropertyTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PolymorphicProperty + //private PolymorphicProperty instance; + + public PolymorphicPropertyTests() + { + // TODO uncomment below to create an instance of PolymorphicProperty + //instance = new PolymorphicProperty(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PolymorphicProperty + /// + [Test] + public void PolymorphicPropertyInstanceTest() + { + // TODO uncomment below to test "IsType" PolymorphicProperty + //Assert.IsType(instance); + } + + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs new file mode 100644 index 00000000000..079fc105426 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/QuadrilateralInterfaceTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing QuadrilateralInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for QuadrilateralInterface + //private QuadrilateralInterface instance; + + public QuadrilateralInterfaceTests() + { + // TODO uncomment below to create an instance of QuadrilateralInterface + //instance = new QuadrilateralInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of QuadrilateralInterface + /// + [Test] + public void QuadrilateralInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" QuadrilateralInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'QuadrilateralType' + /// + [Test] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs new file mode 100644 index 00000000000..cc2f53d3d68 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/QuadrilateralTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Quadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class QuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Quadrilateral + //private Quadrilateral instance; + + public QuadrilateralTests() + { + // TODO uncomment below to create an instance of Quadrilateral + //instance = new Quadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Quadrilateral + /// + [Test] + public void QuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" Quadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Test] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs new file mode 100644 index 00000000000..1d73a2e93e0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ReadOnlyFirstTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ReadOnlyFirst + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReadOnlyFirstTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ReadOnlyFirst + //private ReadOnlyFirst instance; + + public ReadOnlyFirstTests() + { + // TODO uncomment below to create an instance of ReadOnlyFirst + //instance = new ReadOnlyFirst(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ReadOnlyFirst + /// + [Test] + public void ReadOnlyFirstInstanceTest() + { + // TODO uncomment below to test "IsType" ReadOnlyFirst + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Bar' + /// + [Test] + public void BarTest() + { + // TODO unit test for the property 'Bar' + } + /// + /// Test the property 'Baz' + /// + [Test] + public void BazTest() + { + // TODO unit test for the property 'Baz' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ReturnTests.cs new file mode 100644 index 00000000000..1ad460b5392 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ReturnTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + public ReturnTests() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsType" Return + //Assert.IsType(instance); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs new file mode 100644 index 00000000000..4eef3141e21 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ScaleneTriangleTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ScaleneTriangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ScaleneTriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ScaleneTriangle + //private ScaleneTriangle instance; + + public ScaleneTriangleTests() + { + // TODO uncomment below to create an instance of ScaleneTriangle + //instance = new ScaleneTriangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ScaleneTriangle + /// + [Test] + public void ScaleneTriangleInstanceTest() + { + // TODO uncomment below to test "IsType" ScaleneTriangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Test] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs new file mode 100644 index 00000000000..d0e787e2a98 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeInterfaceTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ShapeInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeInterface + //private ShapeInterface instance; + + public ShapeInterfaceTests() + { + // TODO uncomment below to create an instance of ShapeInterface + //instance = new ShapeInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeInterface + /// + [Test] + public void ShapeInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs new file mode 100644 index 00000000000..5bfd6b024fc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeOrNullTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ShapeOrNull + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeOrNullTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ShapeOrNull + //private ShapeOrNull instance; + + public ShapeOrNullTests() + { + // TODO uncomment below to create an instance of ShapeOrNull + //instance = new ShapeOrNull(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ShapeOrNull + /// + [Test] + public void ShapeOrNullInstanceTest() + { + // TODO uncomment below to test "IsType" ShapeOrNull + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Test] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeTests.cs new file mode 100644 index 00000000000..0a00f468ec0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ShapeTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Shape + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ShapeTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Shape + //private Shape instance; + + public ShapeTests() + { + // TODO uncomment below to create an instance of Shape + //instance = new Shape(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Shape + /// + [Test] + public void ShapeInstanceTest() + { + // TODO uncomment below to test "IsType" Shape + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Test] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs new file mode 100644 index 00000000000..0477e530d9f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/SimpleQuadrilateralTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SimpleQuadrilateral + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SimpleQuadrilateralTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SimpleQuadrilateral + //private SimpleQuadrilateral instance; + + public SimpleQuadrilateralTests() + { + // TODO uncomment below to create an instance of SimpleQuadrilateral + //instance = new SimpleQuadrilateral(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SimpleQuadrilateral + /// + [Test] + public void SimpleQuadrilateralInstanceTest() + { + // TODO uncomment below to test "IsType" SimpleQuadrilateral + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'QuadrilateralType' + /// + [Test] + public void QuadrilateralTypeTest() + { + // TODO unit test for the property 'QuadrilateralType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs new file mode 100644 index 00000000000..1f3dc827152 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing SpecialModelName + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialModelNameTests : IDisposable + { + // TODO uncomment below to declare an instance variable for SpecialModelName + //private SpecialModelName instance; + + public SpecialModelNameTests() + { + // TODO uncomment below to create an instance of SpecialModelName + //instance = new SpecialModelName(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of SpecialModelName + /// + [Test] + public void SpecialModelNameInstanceTest() + { + // TODO uncomment below to test "IsType" SpecialModelName + //Assert.IsType(instance); + } + + + /// + /// Test the property 'SpecialPropertyName' + /// + [Test] + public void SpecialPropertyNameTest() + { + // TODO unit test for the property 'SpecialPropertyName' + } + /// + /// Test the property '_SpecialModelName' + /// + [Test] + public void _SpecialModelNameTest() + { + // TODO unit test for the property '_SpecialModelName' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TagTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TagTests.cs new file mode 100644 index 00000000000..e956f3b15a2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TagTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Test] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..7fd26f4832a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,66 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Test] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Test] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..3eb23f92df8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,66 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Test] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + /// + /// Test the property 'Value' + /// + [Test] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs new file mode 100644 index 00000000000..73b7803a431 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TriangleInterfaceTests.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TriangleInterface + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleInterfaceTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TriangleInterface + //private TriangleInterface instance; + + public TriangleInterfaceTests() + { + // TODO uncomment below to create an instance of TriangleInterface + //instance = new TriangleInterface(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TriangleInterface + /// + [Test] + public void TriangleInterfaceInstanceTest() + { + // TODO uncomment below to test "IsType" TriangleInterface + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TriangleType' + /// + [Test] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TriangleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TriangleTests.cs new file mode 100644 index 00000000000..f2ca943e59b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/TriangleTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Triangle + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TriangleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Triangle + //private Triangle instance; + + public TriangleTests() + { + // TODO uncomment below to create an instance of Triangle + //instance = new Triangle(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Triangle + /// + [Test] + public void TriangleInstanceTest() + { + // TODO uncomment below to test "IsType" Triangle + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ShapeType' + /// + [Test] + public void ShapeTypeTest() + { + // TODO unit test for the property 'ShapeType' + } + /// + /// Test the property 'TriangleType' + /// + [Test] + public void TriangleTypeTest() + { + // TODO unit test for the property 'TriangleType' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/UserTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/UserTests.cs new file mode 100644 index 00000000000..1859aad97fe --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/UserTests.cs @@ -0,0 +1,155 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Test] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Username' + /// + [Test] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + /// + /// Test the property 'FirstName' + /// + [Test] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + /// + /// Test the property 'LastName' + /// + [Test] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + /// + /// Test the property 'Email' + /// + [Test] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + /// + /// Test the property 'Password' + /// + [Test] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'Phone' + /// + [Test] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + /// + /// Test the property 'UserStatus' + /// + [Test] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + /// + /// Test the property 'ObjectWithNoDeclaredProps' + /// + [Test] + public void ObjectWithNoDeclaredPropsTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredProps' + } + /// + /// Test the property 'ObjectWithNoDeclaredPropsNullable' + /// + [Test] + public void ObjectWithNoDeclaredPropsNullableTest() + { + // TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable' + } + /// + /// Test the property 'AnyTypeProp' + /// + [Test] + public void AnyTypePropTest() + { + // TODO unit test for the property 'AnyTypeProp' + } + /// + /// Test the property 'AnyTypePropNullable' + /// + [Test] + public void AnyTypePropNullableTest() + { + // TODO unit test for the property 'AnyTypePropNullable' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/WhaleTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/WhaleTests.cs new file mode 100644 index 00000000000..2be2a2dd8cc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/WhaleTests.cs @@ -0,0 +1,83 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Whale + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class WhaleTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Whale + //private Whale instance; + + public WhaleTests() + { + // TODO uncomment below to create an instance of Whale + //instance = new Whale(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Whale + /// + [Test] + public void WhaleInstanceTest() + { + // TODO uncomment below to test "IsType" Whale + //Assert.IsType(instance); + } + + + /// + /// Test the property 'HasBaleen' + /// + [Test] + public void HasBaleenTest() + { + // TODO unit test for the property 'HasBaleen' + } + /// + /// Test the property 'HasTeeth' + /// + [Test] + public void HasTeethTest() + { + // TODO unit test for the property 'HasTeeth' + } + /// + /// Test the property 'ClassName' + /// + [Test] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ZebraTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ZebraTests.cs new file mode 100644 index 00000000000..ff81e57c0b5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/ZebraTests.cs @@ -0,0 +1,75 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Zebra + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ZebraTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Zebra + //private Zebra instance; + + public ZebraTests() + { + // TODO uncomment below to create an instance of Zebra + //instance = new Zebra(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Zebra + /// + [Test] + public void ZebraInstanceTest() + { + // TODO uncomment below to test "IsType" Zebra + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Type' + /// + [Test] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'ClassName' + /// + [Test] + public void ClassNameTest() + { + // TODO unit test for the property 'ClassName' + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.asmdef b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.asmdef new file mode 100644 index 00000000000..464bf977d5b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.asmdef @@ -0,0 +1,15 @@ +{ + "name": "Org.OpenAPITools.Test", + "references": [ + "Org.OpenAPITools", + "UnityEngine.TestRunner" + ], + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll", + "Newtonsoft.Json.dll" + ], + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ] +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..285d9313360 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient Call123TestSpecialTags(ModelClient modelClient); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse Call123TestSpecialTagsWithHttpInfo(ModelClient modelClient); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ModelClient + System.Threading.Tasks.Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// To test special tags + /// + /// + /// To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApi : IAnotherFakeApiSync, IAnotherFakeApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class AnotherFakeApi : IDisposable, IAnotherFakeApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public AnotherFakeApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public AnotherFakeApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public AnotherFakeApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + /// + public AnotherFakeApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public Org.OpenAPITools.Client.ApiClient ApiClient { get; set; } = null; + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient Call123TestSpecialTags(ModelClient modelClient) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(modelClient); + return localVarResponse.Data; + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWithHttpInfo(ModelClient modelClient) + { + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = modelClient; + + + // make the HTTP request + var localVarResponse = this.Client.Patch("/another-fake/dummy", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ModelClient + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// To test special tags To test special tags and operation ID starting with number + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = modelClient; + + + // make the HTTP request + + var task = this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/DefaultApi.cs new file mode 100644 index 00000000000..f9182ee8f45 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -0,0 +1,649 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// + /// + /// Thrown when fails to make API call + /// FooGetDefaultResponse + FooGetDefaultResponse FooGet(); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of FooGetDefaultResponse + ApiResponse FooGetWithHttpInfo(); + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + void GetCountry(string country); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse GetCountryWithHttpInfo(string country); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// List<Guid> + List Hello(); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// ApiResponse of List<Guid> + ApiResponse> HelloWithHttpInfo(); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of FooGetDefaultResponse + System.Threading.Tasks.Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FooGetDefaultResponse) + System.Threading.Tasks.Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> HelloAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IDefaultApi : IDefaultApiSync, IDefaultApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class DefaultApi : IDisposable, IDefaultApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public DefaultApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public DefaultApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public DefaultApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + /// + public DefaultApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public Org.OpenAPITools.Client.ApiClient ApiClient { get; set; } = null; + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// FooGetDefaultResponse + public FooGetDefaultResponse FooGet() + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = FooGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of FooGetDefaultResponse + public Org.OpenAPITools.Client.ApiResponse FooGetWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get("/foo", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of FooGetDefaultResponse + public async System.Threading.Tasks.Task FooGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = FooGetWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FooGetDefaultResponse) + public async System.Threading.Tasks.Task> FooGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/foo", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + public void GetCountry(string country) + { + GetCountryWithHttpInfo(country); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse GetCountryWithHttpInfo(string country) + { + // verify the required parameter 'country' is set + if (country == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter + + + // make the HTTP request + var localVarResponse = this.Client.Post("/country", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = GetCountryWithHttpInfoAsync(country, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'country' is set + if (country == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/country", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// List<Guid> + public List Hello() + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = HelloWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// ApiResponse of List<Guid> + public Org.OpenAPITools.Client.ApiResponse> HelloWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/hello", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> HelloAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = HelloWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync>("/hello", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeApi.cs new file mode 100644 index 00000000000..c09437cad92 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeApi.cs @@ -0,0 +1,3148 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// HealthCheckResult + HealthCheckResult FakeHealthGet(); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of HealthCheckResult + ApiResponse FakeHealthGetWithHttpInfo(); + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// bool + bool FakeOuterBooleanSerialize(bool? body = default(bool?)); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of bool + ApiResponse FakeOuterBooleanSerializeWithHttpInfo(bool? body = default(bool?)); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + OuterComposite FakeOuterCompositeSerialize(OuterComposite outerComposite = default(OuterComposite)); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + ApiResponse FakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite = default(OuterComposite)); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// decimal + decimal FakeOuterNumberSerialize(decimal? body = default(decimal?)); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of decimal + ApiResponse FakeOuterNumberSerializeWithHttpInfo(decimal? body = default(decimal?)); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// string + string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string)); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string)); + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// List<OuterEnum> + List GetArrayOfEnums(); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<OuterEnum> + ApiResponse> GetArrayOfEnumsWithHttpInfo(); + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// + void TestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse TestBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass); + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + void TestBodyWithQueryParams(string query, User user); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestBodyWithQueryParamsWithHttpInfo(string query, User user); + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClientModel(ModelClient modelClient); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClientModelWithHttpInfo(ModelClient modelClient); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// + void TestEndpointParameters(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + ApiResponse TestEndpointParametersWithHttpInfo(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// + void TestEnumParameters(List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// ApiResponse of Object(void) + ApiResponse TestEnumParametersWithHttpInfo(List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// + void TestGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// ApiResponse of Object(void) + ApiResponse TestGroupParametersWithHttpInfo(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + void TestInlineAdditionalProperties(Dictionary requestBody); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody); + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// + void TestJsonFormData(string param, string param2); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// 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 + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of HealthCheckResult + System.Threading.Tasks.Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Health check endpoint + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HealthCheckResult) + System.Threading.Tasks.Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of bool + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync(bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (bool) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of OuterComposite + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync(OuterComposite outerComposite = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (OuterComposite) + System.Threading.Tasks.Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite outerComposite = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of decimal + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync(decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (decimal) + System.Threading.Tasks.Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<OuterEnum> + System.Threading.Tasks.Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Array of Enums + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<OuterEnum>) + System.Threading.Tasks.Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestBodyWithQueryParamsWithHttpInfoAsync(string query, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ModelClient + System.Threading.Tasks.Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// To test \"client\" model + /// + /// + /// To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestEndpointParametersAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEndpointParametersWithHttpInfoAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestEnumParametersAsync(List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// To test enum parameters + /// + /// + /// To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestEnumParametersWithHttpInfoAsync(List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestGroupParametersWithHttpInfoAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test inline additionalProperties + /// + /// + /// + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// test json serialization of form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeApi : IFakeApiSync, IFakeApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeApi : IDisposable, IFakeApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public FakeApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public FakeApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public FakeApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + /// + public FakeApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public Org.OpenAPITools.Client.ApiClient ApiClient { get; set; } = null; + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// HealthCheckResult + public HealthCheckResult FakeHealthGet() + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeHealthGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// ApiResponse of HealthCheckResult + public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/health", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of HealthCheckResult + public async System.Threading.Tasks.Task FakeHealthGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = FakeHealthGetWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Health check endpoint + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (HealthCheckResult) + public async System.Threading.Tasks.Task> FakeHealthGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/fake/health", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// bool + public bool FakeOuterBooleanSerialize(bool? body = default(bool?)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of bool + public Org.OpenAPITools.Client.ApiResponse FakeOuterBooleanSerializeWithHttpInfo(bool? body = default(bool?)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "*/*" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/outer/boolean", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of bool + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync(bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = FakeOuterBooleanSerializeWithHttpInfoAsync(body, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (bool) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeWithHttpInfoAsync(bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "*/*" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + public OuterComposite FakeOuterCompositeSerialize(OuterComposite outerComposite = default(OuterComposite)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + return localVarResponse.Data; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + public Org.OpenAPITools.Client.ApiResponse FakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite = default(OuterComposite)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "*/*" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = outerComposite; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/outer/composite", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of OuterComposite + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync(OuterComposite outerComposite = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = FakeOuterCompositeSerializeWithHttpInfoAsync(outerComposite, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (OuterComposite) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeWithHttpInfoAsync(OuterComposite outerComposite = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "*/*" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = outerComposite; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// decimal + public decimal FakeOuterNumberSerialize(decimal? body = default(decimal?)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of decimal + public Org.OpenAPITools.Client.ApiResponse FakeOuterNumberSerializeWithHttpInfo(decimal? body = default(decimal?)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "*/*" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/outer/number", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of decimal + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync(decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = FakeOuterNumberSerializeWithHttpInfoAsync(body, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (decimal) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeWithHttpInfoAsync(decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "*/*" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = body; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// string + public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// ApiResponse of string + public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "*/*" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); + localVarRequestOptions.Data = body; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/outer/string", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Required UUID String + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "*/*" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); + localVarRequestOptions.Data = body; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// List<OuterEnum> + public List GetArrayOfEnums() + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = GetArrayOfEnumsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// ApiResponse of List<OuterEnum> + public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/fake/array-of-enums", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<OuterEnum> + public async System.Threading.Tasks.Task> GetArrayOfEnumsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = GetArrayOfEnumsWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Array of Enums + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<OuterEnum>) + public async System.Threading.Tasks.Task>> GetArrayOfEnumsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync>("/fake/array-of-enums", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// + public void TestBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) + { + TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) + { + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = fileSchemaTestClass; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestBodyWithFileSchemaWithHttpInfoAsync(fileSchemaTestClass, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaWithHttpInfoAsync(FileSchemaTestClass fileSchemaTestClass, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = fileSchemaTestClass; + + + // make the HTTP request + + var task = this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// + public void TestBodyWithQueryParams(string query, User user) + { + TestBodyWithQueryParamsWithHttpInfo(query, user); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHttpInfo(string query, User user) + { + // verify the required parameter 'query' is set + if (query == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); + localVarRequestOptions.Data = user; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestBodyWithQueryParamsWithHttpInfoAsync(query, user, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsWithHttpInfoAsync(string query, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'query' is set + if (query == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); + localVarRequestOptions.Data = user; + + + // make the HTTP request + + var task = this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClientModel(ModelClient modelClient) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = TestClientModelWithHttpInfo(modelClient); + return localVarResponse.Data; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpInfo(ModelClient modelClient) + { + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = modelClient; + + + // make the HTTP request + var localVarResponse = this.Client.Patch("/fake", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClientModelAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestClientModelWithHttpInfoAsync(modelClient, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// To test \"client\" model To test \"client\" model + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClientModelWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = modelClient; + + + // make the HTTP request + + var task = this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// + public void TestEndpointParameters(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + { + TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestEndpointParametersWithHttpInfo(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + { + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + + // verify the required parameter '_byte' is set + if (_byte == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (integer != null) + { + localVarRequestOptions.FormParameters.Add("integer", Org.OpenAPITools.Client.ClientUtils.ParameterToString(integer)); // form parameter + } + if (int32 != null) + { + localVarRequestOptions.FormParameters.Add("int32", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int32)); // form parameter + } + if (int64 != null) + { + localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter + } + localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter + if (_float != null) + { + localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter + } + localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter + if (_string != null) + { + localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter + } + localVarRequestOptions.FormParameters.Add("pattern_without_delimiter", Org.OpenAPITools.Client.ClientUtils.ParameterToString(patternWithoutDelimiter)); // form parameter + localVarRequestOptions.FormParameters.Add("byte", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_byte)); // form parameter + if (binary != null) + { + } + if (date != null) + { + localVarRequestOptions.FormParameters.Add("date", Org.OpenAPITools.Client.ClientUtils.ParameterToString(date)); // form parameter + } + if (dateTime != null) + { + localVarRequestOptions.FormParameters.Add("dateTime", Org.OpenAPITools.Client.ClientUtils.ParameterToString(dateTime)); // form parameter + } + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", Org.OpenAPITools.Client.ClientUtils.ParameterToString(password)); // form parameter + } + if (callback != null) + { + localVarRequestOptions.FormParameters.Add("callback", Org.OpenAPITools.Client.ClientUtils.ParameterToString(callback)); // form parameter + } + + // authentication (http_basic_test) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestEndpointParametersAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestEndpointParametersWithHttpInfoAsync(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Thrown when fails to make API call + /// None + /// None + /// None + /// None + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional) + /// None (optional, default to "2010-02-01T10:20:10.111110+01:00") + /// None (optional) + /// None (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEndpointParametersWithHttpInfoAsync(decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + + // verify the required parameter '_byte' is set + if (_byte == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (integer != null) + { + localVarRequestOptions.FormParameters.Add("integer", Org.OpenAPITools.Client.ClientUtils.ParameterToString(integer)); // form parameter + } + if (int32 != null) + { + localVarRequestOptions.FormParameters.Add("int32", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int32)); // form parameter + } + if (int64 != null) + { + localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter + } + localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter + if (_float != null) + { + localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter + } + localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter + if (_string != null) + { + localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter + } + localVarRequestOptions.FormParameters.Add("pattern_without_delimiter", Org.OpenAPITools.Client.ClientUtils.ParameterToString(patternWithoutDelimiter)); // form parameter + localVarRequestOptions.FormParameters.Add("byte", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_byte)); // form parameter + if (binary != null) + { + } + if (date != null) + { + localVarRequestOptions.FormParameters.Add("date", Org.OpenAPITools.Client.ClientUtils.ParameterToString(date)); // form parameter + } + if (dateTime != null) + { + localVarRequestOptions.FormParameters.Add("dateTime", Org.OpenAPITools.Client.ClientUtils.ParameterToString(dateTime)); // form parameter + } + if (password != null) + { + localVarRequestOptions.FormParameters.Add("password", Org.OpenAPITools.Client.ClientUtils.ParameterToString(password)); // form parameter + } + if (callback != null) + { + localVarRequestOptions.FormParameters.Add("callback", Org.OpenAPITools.Client.ClientUtils.ParameterToString(callback)); // form parameter + } + + // authentication (http_basic_test) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// + public void TestEnumParameters(List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + { + TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestEnumParametersWithHttpInfo(List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (enumQueryStringArray != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "enum_query_string_array", enumQueryStringArray)); + } + if (enumQueryString != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)); + } + if (enumQueryInteger != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)); + } + if (enumQueryDouble != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)); + } + if (enumHeaderStringArray != null) + { + localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter + } + if (enumHeaderString != null) + { + localVarRequestOptions.HeaderParameters.Add("enum_header_string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderString)); // header parameter + } + if (enumFormStringArray != null) + { + localVarRequestOptions.FormParameters.Add("enum_form_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumFormStringArray)); // form parameter + } + if (enumFormString != null) + { + localVarRequestOptions.FormParameters.Add("enum_form_string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumFormString)); // form parameter + } + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestEnumParametersAsync(List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestEnumParametersWithHttpInfoAsync(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// To test enum parameters To test enum parameters + /// + /// Thrown when fails to make API call + /// Header parameter enum test (string array) (optional) + /// Header parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (string array) (optional) + /// Query parameter enum test (string) (optional, default to -efg) + /// Query parameter enum test (double) (optional) + /// Query parameter enum test (double) (optional) + /// Form parameter enum test (string array) (optional, default to $) + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestEnumParametersWithHttpInfoAsync(List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (enumQueryStringArray != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "enum_query_string_array", enumQueryStringArray)); + } + if (enumQueryString != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)); + } + if (enumQueryInteger != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)); + } + if (enumQueryDouble != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)); + } + if (enumHeaderStringArray != null) + { + localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter + } + if (enumHeaderString != null) + { + localVarRequestOptions.HeaderParameters.Add("enum_header_string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderString)); // header parameter + } + if (enumFormStringArray != null) + { + localVarRequestOptions.FormParameters.Add("enum_form_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumFormStringArray)); // form parameter + } + if (enumFormString != null) + { + localVarRequestOptions.FormParameters.Add("enum_form_string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumFormString)); // form parameter + } + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// + public void TestGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + { + TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestGroupParametersWithHttpInfo(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); + if (stringGroup != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)); + } + if (int64Group != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)); + } + localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter + if (booleanGroup != null) + { + localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter + } + + // authentication (bearer_test) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/fake", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestGroupParametersWithHttpInfoAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestGroupParametersWithHttpInfoAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); + if (stringGroup != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)); + } + if (int64Group != null) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)); + } + localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter + if (booleanGroup != null) + { + localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter + } + + // authentication (bearer_test) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var task = this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// + public void TestInlineAdditionalProperties(Dictionary requestBody) + { + TestInlineAdditionalPropertiesWithHttpInfo(requestBody); + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertiesWithHttpInfo(Dictionary requestBody) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = requestBody; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestInlineAdditionalPropertiesWithHttpInfoAsync(requestBody, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// test inline additionalProperties + /// + /// Thrown when fails to make API call + /// request body + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesWithHttpInfoAsync(Dictionary requestBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requestBody' is set + if (requestBody == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = requestBody; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// + public void TestJsonFormData(string param, string param2) + { + TestJsonFormDataWithHttpInfo(param, param2); + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo(string param, string param2) + { + // verify the required parameter 'param' is set + if (param == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + + // verify the required parameter 'param2' is set + if (param2 == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter + localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter + + + // make the HTTP request + var localVarResponse = this.Client.Get("/fake/jsonFormData", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestJsonFormDataAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestJsonFormDataWithHttpInfoAsync(param, param2, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// test json serialization of form data + /// + /// Thrown when fails to make API call + /// field1 + /// field2 + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestJsonFormDataWithHttpInfoAsync(string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'param' is set + if (param == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + + // verify the required parameter 'param2' is set + if (param2 == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter + localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// 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 localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)); + + + // make the HTTP request + var localVarResponse = this.Client.Put("/fake/test-query-parameters", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync(List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // 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 localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)); + + + // make the HTTP request + + var task = this.AsynchronousClient.PutAsync("/fake/test-query-parameters", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..b575ceab22a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,365 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123ApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClassname(ModelClient modelClient); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClassnameWithHttpInfo(ModelClient modelClient); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123ApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ModelClient + System.Threading.Tasks.Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// To test class name in snake case + /// + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123Api : IFakeClassnameTags123ApiSync, IFakeClassnameTags123ApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeClassnameTags123Api : IDisposable, IFakeClassnameTags123Api + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public FakeClassnameTags123Api() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public FakeClassnameTags123Api(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public FakeClassnameTags123Api(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + /// + public FakeClassnameTags123Api(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public Org.OpenAPITools.Client.ApiClient ApiClient { get; set; } = null; + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClassname(ModelClient modelClient) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = TestClassnameWithHttpInfo(modelClient); + return localVarResponse.Data; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInfo(ModelClient modelClient) + { + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = modelClient; + + // authentication (api_key_query) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); + } + + // make the HTTP request + var localVarResponse = this.Client.Patch("/fake_classname_test", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = TestClassnameWithHttpInfoAsync(modelClient, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// To test class name in snake case To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'modelClient' is set + if (modelClient == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = modelClient; + + // authentication (api_key_query) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) + { + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); + } + + // make the HTTP request + + var task = this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/PetApi.cs new file mode 100644 index 00000000000..4e9580620b4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/PetApi.cs @@ -0,0 +1,2013 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + void AddPet(Pet pet); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + ApiResponse AddPetWithHttpInfo(Pet pet); + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// + void DeletePet(long petId, string apiKey = default(string)); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// ApiResponse of Object(void) + ApiResponse DeletePetWithHttpInfo(long petId, string apiKey = default(string)); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// List<Pet> + List FindPetsByStatus(List status); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// ApiResponse of List<Pet> + ApiResponse> FindPetsByStatusWithHttpInfo(List status); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// List<Pet> + [Obsolete] + List FindPetsByTags(List tags); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// ApiResponse of List<Pet> + [Obsolete] + ApiResponse> FindPetsByTagsWithHttpInfo(List tags); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Pet + Pet GetPetById(long petId); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// ApiResponse of Pet + ApiResponse GetPetByIdWithHttpInfo(long petId); + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + void UpdatePet(Pet pet); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithHttpInfo(Pet pet); + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + void UpdatePetWithForm(long petId, string name = default(string), string status = default(string)); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// ApiResponse of Object(void) + ApiResponse UpdatePetWithFormWithHttpInfo(long petId, string name = default(string), string status = default(string)); + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + ApiResponse UploadFile(long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithHttpInfo(long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse + ApiResponse UploadFileWithRequiredFile(long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithRequiredFileWithHttpInfo(long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeletePetAsync(long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeletePetWithHttpInfoAsync(long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// Task of List<Pet> + System.Threading.Tasks.Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Pet>) + System.Threading.Tasks.Task>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task of List<Pet> + [Obsolete] + System.Threading.Tasks.Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Pet>) + [Obsolete] + System.Threading.Tasks.Task>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task of Pet + System.Threading.Tasks.Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Pet) + System.Threading.Tasks.Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update an existing pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdatePetWithFormAsync(long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileAsync(long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileWithHttpInfoAsync(long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IPetApi : IPetApiSync, IPetApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class PetApi : IDisposable, IPetApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public PetApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public PetApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public PetApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + /// + public PetApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public Org.OpenAPITools.Client.ApiClient ApiClient { get; set; } = null; + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + public void AddPet(Pet pet) + { + AddPetWithHttpInfo(pet); + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) + { + // verify the required parameter 'pet' is set + if (pet == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = pet; + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "POST", "/pet", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task AddPetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = AddPetWithHttpInfoAsync(pet, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Add a new pet to the store + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AddPetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'pet' is set + if (pet == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = pet; + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "POST", "/pet", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// + public void DeletePet(long petId, string apiKey = default(string)) + { + DeletePetWithHttpInfo(petId, apiKey); + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse DeletePetWithHttpInfo(long petId, string apiKey = default(string)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (apiKey != null) + { + localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter + } + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/pet/{petId}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeletePetAsync(long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = DeletePetWithHttpInfoAsync(petId, apiKey, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Deletes a pet + /// + /// Thrown when fails to make API call + /// Pet id to delete + /// (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeletePetWithHttpInfoAsync(long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (apiKey != null) + { + localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter + } + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var task = this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// List<Pet> + public List FindPetsByStatus(List status) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = FindPetsByStatusWithHttpInfo(status); + return localVarResponse.Data; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// ApiResponse of List<Pet> + public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpInfo(List status) + { + // verify the required parameter 'status' is set + if (status == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByStatus", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// Task of List<Pet> + public async System.Threading.Tasks.Task> FindPetsByStatusAsync(List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = FindPetsByStatusWithHttpInfoAsync(status, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Finds Pets by status Multiple status values can be provided with comma separated strings + /// + /// Thrown when fails to make API call + /// Status values that need to be considered for filter (deprecated) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Pet>) + public async System.Threading.Tasks.Task>> FindPetsByStatusWithHttpInfoAsync(List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'status' is set + if (status == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByStatus", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// List<Pet> + [Obsolete] + public List FindPetsByTags(List tags) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = FindPetsByTagsWithHttpInfo(tags); + return localVarResponse.Data; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// ApiResponse of List<Pet> + [Obsolete] + public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo(List tags) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByTags", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task of List<Pet> + [Obsolete] + public async System.Threading.Tasks.Task> FindPetsByTagsAsync(List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = FindPetsByTagsWithHttpInfoAsync(tags, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Thrown when fails to make API call + /// Tags to filter by + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Pet>) + [Obsolete] + public async System.Threading.Tasks.Task>> FindPetsByTagsWithHttpInfoAsync(List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'tags' is set + if (tags == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "GET", "/pet/findByTags", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Pet + public Pet GetPetById(long petId) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); + return localVarResponse.Data; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// ApiResponse of Pet + public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petId) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task of Pet + public async System.Threading.Tasks.Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = GetPetByIdWithHttpInfoAsync(petId, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Find pet by ID Returns a single pet + /// + /// Thrown when fails to make API call + /// ID of pet to return + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Pet) + public async System.Threading.Tasks.Task> GetPetByIdWithHttpInfoAsync(long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// + public void UpdatePet(Pet pet) + { + UpdatePetWithHttpInfo(pet); + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) + { + // verify the required parameter 'pet' is set + if (pet == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = pet; + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "PUT", "/pet", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdatePetAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = UpdatePetWithHttpInfoAsync(pet, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Update an existing pet + /// + /// Thrown when fails to make API call + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetWithHttpInfoAsync(Pet pet, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'pet' is set + if (pet == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json", + "application/xml" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = pet; + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + // authentication (http_signature_test) required + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "PUT", "/pet", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + + // make the HTTP request + + var task = this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// + public void UpdatePetWithForm(long petId, string name = default(string), string status = default(string)) + { + UpdatePetWithFormWithHttpInfo(petId, name, status); + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse UpdatePetWithFormWithHttpInfo(long petId, string name = default(string), string status = default(string)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (name != null) + { + localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter + } + if (status != null) + { + localVarRequestOptions.FormParameters.Add("status", Org.OpenAPITools.Client.ClientUtils.ParameterToString(status)); // form parameter + } + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/pet/{petId}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdatePetWithFormAsync(long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = UpdatePetWithFormWithHttpInfoAsync(petId, name, status, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Updates a pet in the store with form data + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be updated + /// Updated name of the pet (optional) + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdatePetWithFormWithHttpInfoAsync(long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/x-www-form-urlencoded" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (name != null) + { + localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter + } + if (status != null) + { + localVarRequestOptions.FormParameters.Add("status", Org.OpenAPITools.Client.ClientUtils.ParameterToString(status)); // form parameter + } + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse + public ApiResponse UploadFile(long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); + return localVarResponse.Data; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// ApiResponse of ApiResponse + public Org.OpenAPITools.Client.ApiResponse UploadFileWithHttpInfo(long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) + { + localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter + } + if (file != null) + { + } + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileAsync(long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = UploadFileWithHttpInfoAsync(petId, additionalMetadata, file, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileWithHttpInfoAsync(long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) + { + localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter + } + if (file != null) + { + } + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse + public ApiResponse UploadFileWithRequiredFile(long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + return localVarResponse.Data; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse of ApiResponse + public Org.OpenAPITools.Client.ApiResponse UploadFileWithRequiredFileWithHttpInfo(long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + { + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) + { + localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter + } + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = UploadFileWithRequiredFileWithHttpInfoAsync(petId, requiredFile, additionalMetadata, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileWithHttpInfoAsync(long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "multipart/form-data" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) + { + localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter + } + + // authentication (petstore_auth) required + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/StoreApi.cs new file mode 100644 index 00000000000..812ad3827e7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/StoreApi.cs @@ -0,0 +1,846 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// + void DeleteOrder(string orderId); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteOrderWithHttpInfo(string orderId); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Dictionary<string, int> + Dictionary GetInventory(); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo(); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Order + Order GetOrderById(long orderId); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// ApiResponse of Order + ApiResponse GetOrderByIdWithHttpInfo(long orderId); + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Order + Order PlaceOrder(Order order); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// ApiResponse of Order + ApiResponse PlaceOrderWithHttpInfo(Order order); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of Dictionary<string, int> + System.Threading.Tasks.Task> GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Dictionary<string, int>) + System.Threading.Tasks.Task>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task of Order + System.Threading.Tasks.Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task of Order + System.Threading.Tasks.Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Place an order for a pet + /// + /// + /// + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Order) + System.Threading.Tasks.Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IStoreApi : IStoreApiSync, IStoreApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class StoreApi : IDisposable, IStoreApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public StoreApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public StoreApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public StoreApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + /// + public StoreApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public Org.OpenAPITools.Client.ApiClient ApiClient { get; set; } = null; + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// + public void DeleteOrder(string orderId) + { + DeleteOrderWithHttpInfo(orderId); + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(string orderId) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + var localVarResponse = this.Client.Delete("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteOrderAsync(string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = DeleteOrderWithHttpInfoAsync(orderId, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Thrown when fails to make API call + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'orderId' is set + if (orderId == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + + var task = this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Dictionary<string, int> + public Dictionary GetInventory() + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// ApiResponse of Dictionary<string, int> + public Org.OpenAPITools.Client.ApiResponse> GetInventoryWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } + + // make the HTTP request + var localVarResponse = this.Client.Get>("/store/inventory", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of Dictionary<string, int> + public async System.Threading.Tasks.Task> GetInventoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = GetInventoryWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Returns pet inventories by status Returns a map of status codes to quantities + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Dictionary<string, int>) + public async System.Threading.Tasks.Task>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (api_key) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) + { + localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key")); + } + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Order + public Order GetOrderById(long orderId) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); + return localVarResponse.Data; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// ApiResponse of Order + public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long orderId) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + var localVarResponse = this.Client.Get("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task of Order + public async System.Threading.Tasks.Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Thrown when fails to make API call + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Order + public Order PlaceOrder(Order order) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = PlaceOrderWithHttpInfo(order); + return localVarResponse.Data; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// ApiResponse of Order + public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order order) + { + // verify the required parameter 'order' is set + if (order == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = order; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/store/order", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task of Order + public async System.Threading.Tasks.Task PlaceOrderAsync(Order order, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = PlaceOrderWithHttpInfoAsync(order, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Place an order for a pet + /// + /// Thrown when fails to make API call + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Order) + public async System.Threading.Tasks.Task> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'order' is set + if (order == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = order; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/UserApi.cs new file mode 100644 index 00000000000..c425058e2ee --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/UserApi.cs @@ -0,0 +1,1534 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// + void CreateUser(User user); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// ApiResponse of Object(void) + ApiResponse CreateUserWithHttpInfo(User user); + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + void CreateUsersWithArrayInput(List user); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithArrayInputWithHttpInfo(List user); + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + void CreateUsersWithListInput(List user); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + ApiResponse CreateUsersWithListInputWithHttpInfo(List user); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// + void DeleteUser(string username); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// ApiResponse of Object(void) + ApiResponse DeleteUserWithHttpInfo(string username); + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// User + User GetUserByName(string username); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + ApiResponse GetUserByNameWithHttpInfo(string username); + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// string + string LoginUser(string username, string password); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + ApiResponse LoginUserWithHttpInfo(string username, string password); + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// + void LogoutUser(); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + ApiResponse LogoutUserWithHttpInfo(); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// + void UpdateUser(string username, User user); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + ApiResponse UpdateUserWithHttpInfo(string username, User user); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task of User + System.Threading.Tasks.Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get user by user name + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (User) + System.Threading.Tasks.Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task of string + System.Threading.Tasks.Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Logs user into the system + /// + /// + /// + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Logs out current logged in user session + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task UpdateUserAsync(string username, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> UpdateUserWithHttpInfoAsync(string username, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IUserApi : IUserApiSync, IUserApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class UserApi : IDisposable, IUserApi + { + private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public UserApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public UserApi(string basePath) + { + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + new Org.OpenAPITools.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public UserApi(Org.OpenAPITools.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations( + Org.OpenAPITools.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + this.AsynchronousClient = this.ApiClient; + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + /// + public UserApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public Org.OpenAPITools.Client.ApiClient ApiClient { get; set; } = null; + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// + public void CreateUser(User user) + { + CreateUserWithHttpInfo(user); + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User user) + { + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = user; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateUserAsync(User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = CreateUserWithHttpInfoAsync(user, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Create user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// Created user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = user; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + public void CreateUsersWithArrayInput(List user) + { + CreateUsersWithArrayInputWithHttpInfo(user); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWithHttpInfo(List user) + { + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = user; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(List user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputWithHttpInfoAsync(List user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = user; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// + public void CreateUsersWithListInput(List user) + { + CreateUsersWithListInputWithHttpInfo(user); + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithHttpInfo(List user) + { + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = user; + + + // make the HTTP request + var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync(List user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Creates list of users with given input array + /// + /// Thrown when fails to make API call + /// List of user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateUsersWithListInputWithHttpInfoAsync(List user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = user; + + + // make the HTTP request + + var task = this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// + public void DeleteUser(string username) + { + DeleteUserWithHttpInfo(username); + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + + + // make the HTTP request + var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = DeleteUserWithHttpInfoAsync(username, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Delete user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'username' is set + if (username == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + + + // make the HTTP request + + var task = this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// User + public User GetUserByName(string username) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = GetUserByNameWithHttpInfo(username); + return localVarResponse.Data; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// ApiResponse of User + public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(string username) + { + // verify the required parameter 'username' is set + if (username == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + + + // make the HTTP request + var localVarResponse = this.Client.Get("/user/{username}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task of User + public async System.Threading.Tasks.Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = GetUserByNameWithHttpInfoAsync(username, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Get user by user name + /// + /// Thrown when fails to make API call + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (User) + public async System.Threading.Tasks.Task> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'username' is set + if (username == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// string + public string LoginUser(string username, string password) + { + Org.OpenAPITools.Client.ApiResponse localVarResponse = LoginUserWithHttpInfo(username, password); + return localVarResponse.Data; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// ApiResponse of string + public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string username, string password) + { + // verify the required parameter 'username' is set + if (username == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + + // verify the required parameter 'password' is set + if (password == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); + + + // make the HTTP request + var localVarResponse = this.Client.Get("/user/login", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task of string + public async System.Threading.Tasks.Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = LoginUserWithHttpInfoAsync(username, password, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Logs user into the system + /// + /// Thrown when fails to make API call + /// The user name for login + /// The password for login in clear text + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'username' is set + if (username == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + + // verify the required parameter 'password' is set + if (password == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/xml", + "application/json" + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// + public void LogoutUser() + { + LogoutUserWithHttpInfo(); + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = LogoutUserWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Logs out current logged in user session + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = 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) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// + public void UpdateUser(string username, User user) + { + UpdateUserWithHttpInfo(username, user); + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string username, User user) + { + // verify the required parameter 'username' is set + if (username == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + localVarRequestOptions.Data = user; + + + // make the HTTP request + var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task UpdateUserAsync(string username, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = UpdateUserWithHttpInfoAsync(username, user, cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + } + + /// + /// Updated user This can only be done by the logged in user. + /// + /// Thrown when fails to make API call + /// name that need to be deleted + /// Updated user object + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> UpdateUserWithHttpInfoAsync(string username, User user, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'username' is set + if (username == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + + // verify the required parameter 'user' is set + if (user == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter + localVarRequestOptions.Data = user; + + + // make the HTTP request + + var task = this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiClient.cs new file mode 100644 index 00000000000..7502e7fb9ac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiClient.cs @@ -0,0 +1,645 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +using UnityEngine.Networking; +using UnityEngine; + +namespace Org.OpenAPITools.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(UnityWebRequest request) + { + var result = (T) Deserialize(request, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The UnityWebRequest after it has a response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(UnityWebRequest request, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return request.downloadHandler.data; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + // NOTE: Ignoring Content-Disposition filename support, since not all platforms + // have a location on disk to write arbitrary data (tvOS, consoles). + return new MemoryStream(request.downloadHandler.data); + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(request.downloadHandler.text, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(request.downloadHandler.text, type); + } + + var contentType = request.GetResponseHeader("Content-Type"); + + if (!string.IsNullOrEmpty(contentType) && contentType.Contains("application/json")) + { + var text = request.downloadHandler?.text; + + // Generated APIs that don't expect a return value provide System.Object as the type + if (type == typeof(System.Object) && (string.IsNullOrEmpty(text) || text.Trim() == "null")) + { + return null; + } + + if (request.responseCode >= 200 && request.responseCode < 300) + { + try + { + // Deserialize as a model + return JsonConvert.DeserializeObject(text, type, _serializerSettings); + } + catch (Exception e) + { + throw new UnexpectedResponseException(request, type, e.ToString()); + } + } + else + { + throw new ApiException((int)request.responseCode, request.error, text); + } + } + + if (type != typeof(System.Object) && request.responseCode >= 200 && request.responseCode < 300) + { + throw new UnexpectedResponseException(request, type); + } + + return null; + + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + public partial class ApiClient : IDisposable, ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() : + this(Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + } + + /// + /// Provides all logic for constructing a new UnityWebRequest. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the UnityWebRequest. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new UnityWebRequest instance. + /// + private UnityWebRequest NewRequest( + string method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + var uri = builder.GetFullUri(); + UnityWebRequest request = null; + + if (contentType == "multipart/form-data") + { + var formData = new List(); + foreach (var formParameter in options.FormParameters) + { + formData.Add(new MultipartFormDataSection(formParameter.Key, formParameter.Value)); + } + + request = UnityWebRequest.Post(uri, formData); + request.method = method; + } + else if (contentType == "application/x-www-form-urlencoded") + { + var form = new WWWForm(); + foreach (var kvp in options.FormParameters) + { + form.AddField(kvp.Key, kvp.Value); + } + + request = UnityWebRequest.Post(uri, form); + request.method = method; + } + else if (options.Data != null) + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + var jsonData = serializer.Serialize(options.Data); + + // Making a post body application/json encoded is whack with UnityWebRequest. + // See: https://stackoverflow.com/questions/68156230/unitywebrequest-post-not-sending-body + request = UnityWebRequest.Put(uri, jsonData); + request.method = method; + request.SetRequestHeader("Content-Type", "application/json"); + } + else + { + request = new UnityWebRequest(builder.GetFullUri(), method); + } + + if (request.downloadHandler == null && typeof(T) != typeof(System.Object)) + { + request.downloadHandler = new DownloadHandlerBuffer(); + } + +#if UNITY_EDITOR || !UNITY_WEBGL + if (configuration.UserAgent != null) + { + request.SetRequestHeader("User-Agent", configuration.UserAgent); + } +#endif + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.SetRequestHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.SetRequestHeader(headerParam.Key, value); + } + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + #if UNITY_WEBGL + throw new System.InvalidOperationException("UnityWebRequest does not support setting cookies in WebGL"); + #else + if (options.Cookies.Count != 1) + { + UnityEngine.Debug.LogError("Only one cookie supported, ignoring others"); + } + + request.SetRequestHeader("Cookie", options.Cookies[0].ToString()); + #endif + } + + return request; + + } + + partial void InterceptRequest(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration); + partial void InterceptResponse(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration, ref object responseData); + + private ApiResponse ToApiResponse(UnityWebRequest request, object responseData) + { + T result = (T) responseData; + + var transformed = new ApiResponse((HttpStatusCode)request.responseCode, new Multimap(), result, request.downloadHandler?.text ?? "") + { + ErrorText = request.error, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + var responseHeaders = request.GetResponseHeaders(); + if (responseHeaders != null) + { + foreach (var responseHeader in request.GetResponseHeaders()) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + return transformed; + } + + private async Task> ExecAsync( + UnityWebRequest request, + string path, + RequestOptions options, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + + using (request) + { + if (configuration.Timeout > 0) + { + request.timeout = (int)Math.Ceiling(configuration.Timeout / 1000.0f); + } + + if (configuration.Proxy != null) + { + throw new InvalidOperationException("Configuration `Proxy` not supported by UnityWebRequest"); + } + + if (configuration.ClientCertificates != null) + { + // Only Android/iOS/tvOS/Standalone players can support certificates, and this + // implementation is intended to work on all platforms. + // + // TODO: Could optionally allow support for this on these platforms. + // + // See: https://docs.unity3d.com/ScriptReference/Networking.CertificateHandler.html + throw new InvalidOperationException("Configuration `ClientCertificates` not supported by UnityWebRequest on all platforms"); + } + + InterceptRequest(request, path, options, configuration); + + var asyncOp = request.SendWebRequest(); + + TaskCompletionSource tsc = new TaskCompletionSource(); + asyncOp.completed += (_) => tsc.TrySetResult(request.result); + + using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) + { + await tsc.Task; + } + + if (request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.DataProcessingError) + { + throw new ConnectionException(request); + } + + object responseData = deserializer.Deserialize(request); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { new ByteArrayContent(request.downloadHandler.data) }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) new MemoryStream(request.downloadHandler.data); + } + + InterceptResponse(request, path, options, configuration, ref responseData); + + return ToApiResponse(request, responseData); + } + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("GET", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("POST", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PUT", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("DELETE", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("HEAD", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("OPTIONS", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PATCH", path, options, config), path, options, config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + #endregion ISynchronousClient + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 00000000000..67d9888d6a3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiResponse.cs new file mode 100644 index 00000000000..ca2de833a5a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 00000000000..362905a2e52 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,247 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, ".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + if (value is ICollection collection && collectionFormat == "multi") + { + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } + } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); + + return Convert.ToString(obj, CultureInfo.InvariantCulture); + } + + /// + /// Serializes the given object when not null. Otherwise return null. + /// + /// The object to serialize. + /// Serialized string. + public static string Serialize(object obj) + { + return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// Is the Enum decorated with EnumMember Attribute + /// + /// + /// true if found + private static bool HasEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) return true; + return false; + } + + /// + /// Get the EnumMember value + /// + /// + /// EnumMember value as string otherwise null + private static string GetEnumMemberAttrValue(object enumVal) + { + if (enumVal == null) + throw new ArgumentNullException(nameof(enumVal)); + var enumType = enumVal.GetType(); + var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException()); + var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType().FirstOrDefault(); + if (attr != null) + { + return attr.Value; + } + return null; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/Configuration.cs new file mode 100644 index 00000000000..5c018577557 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/Configuration.cs @@ -0,0 +1,697 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + + /// + /// HttpSigning configuration + /// + private HttpSigningConfiguration _HttpSigningConfiguration = null; + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); + BasePath = "http://petstore.swagger.io:80/v2"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", "http://{server}.swagger.io:{port}/v2"}, + {"description", "petstore server"}, + { + "variables", new Dictionary { + { + "server", new Dictionary { + {"description", "No description provided"}, + {"default_value", "petstore"}, + { + "enum_values", new List() { + "petstore", + "qa-petstore", + "dev-petstore" + } + } + } + }, + { + "port", new Dictionary { + {"description", "No description provided"}, + {"default_value", "80"}, + { + "enum_values", new List() { + "80", + "8080" + } + } + } + } + } + } + } + }, + { + new Dictionary { + {"url", "https://localhost:8080/{version}"}, + {"description", "The local server"}, + { + "variables", new Dictionary { + { + "version", new Dictionary { + {"description", "No description provided"}, + {"default_value", "v2"}, + { + "enum_values", new List() { + "v1", + "v2" + } + } + } + } + } + } + } + }, + { + new Dictionary { + {"url", "https://127.0.0.1/no_variable"}, + {"description", "The local server without variables"}, + } + } + }; + OperationServers = new Dictionary>>() + { + { + "PetApi.AddPet", new List> + { + { + new Dictionary + { + {"url", "http://petstore.swagger.io/v2"}, + {"description", "No description provided"} + } + }, + { + new Dictionary + { + {"url", "http://path-server-test.petstore.local/v2"}, + {"description", "No description provided"} + } + }, + } + }, + { + "PetApi.UpdatePet", new List> + { + { + new Dictionary + { + {"url", "http://petstore.swagger.io/v2"}, + {"description", "No description provided"} + } + }, + { + new Dictionary + { + {"url", "http://path-server-test.petstore.local/v2"}, + {"description", "No description provided"} + } + }, + } + }, + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://petstore.swagger.io:80/v2") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + + /// + /// Gets and Sets the HttpSigningConfiguration + /// + public HttpSigningConfiguration HttpSigningConfiguration + { + get { return _HttpSigningConfiguration; } + set { _HttpSigningConfiguration = value; } + } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 1.0.0\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + }; + return config; + } + #endregion Static Members + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ConnectionException.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ConnectionException.cs new file mode 100644 index 00000000000..568790e1b12 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ConnectionException.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using UnityEngine.Networking; + +namespace Org.OpenAPITools.Client +{ + public class ConnectionException : Exception + { + public UnityWebRequest.Result Result { get; private set; } + public string Error { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public ConnectionException(UnityWebRequest request) + : base($"result={request.result} error={request.error}") + { + Result = request.result; + Error = request.error ?? ""; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ExceptionFactory.cs new file mode 100644 index 00000000000..43624dd7c86 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/GlobalConfiguration.cs new file mode 100644 index 00000000000..cbee70bca37 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs new file mode 100644 index 00000000000..0b3e867d0f4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -0,0 +1,774 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace Org.OpenAPITools.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + #region + /// + /// Initialize the HashAlgorithm and SigningAlgorithm to default value + /// + public HttpSigningConfiguration() + { + HashAlgorithm = HashAlgorithmName.SHA256; + SigningAlgorithm = "PKCS1-v15"; + } + #endregion + + #region Properties + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validity period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + #endregion + + #region enum + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + #endregion + + #region Methods + /// + /// Gets the Headers for HttpSigning + /// + /// Base path + /// HTTP method + /// Path + /// Request options + /// Http signed headers + internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + { + const string HEADER_REQUEST_TARGET = "(request-target)"; + //The time when the HTTP signature expires. The API server should reject HTTP requests + //that have expired. + const string HEADER_EXPIRES = "(expires)"; + //The 'Date' header. + const string HEADER_DATE = "Date"; + //The 'Host' header. + const string HEADER_HOST = "Host"; + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + var HttpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + { + HttpSigningHeader.Add("(created)"); + } + + if (requestOptions.PathParameters != null) + { + foreach (var pathParam in requestOptions.PathParameters) + { + var tempPath = path.Replace(pathParam.Key, "0"); + path = string.Format(tempPath, pathParam.Value); + } + } + + var httpValues = HttpUtility.ParseQueryString(string.Empty); + foreach (var parameter in requestOptions.QueryParameters) + { +#if (NETCOREAPP) + if (parameter.Value.Count > 1) + { // array + foreach (var value in parameter.Value) + { + httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + } + } + else + { + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + } +#else + if (parameter.Value.Count > 1) + { // array + foreach (var value in parameter.Value) + { + httpValues.Add(parameter.Key + "[]", value); + } + } + else + { + httpValues.Add(parameter.Key, parameter.Value[0]); + } +#endif + } + var uriBuilder = new UriBuilder(string.Concat(basePath, path)); + uriBuilder.Query = httpValues.ToString().Replace("+", "%20"); + + var dateTime = DateTime.Now; + string Digest = string.Empty; + + //get the body + string requestBody = string.Empty; + if (requestOptions.Data != null) + { + var serializerSettings = new JsonSerializerSettings(); + requestBody = JsonConvert.SerializeObject(requestOptions.Data, serializerSettings); + } + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + Digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + Digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + { + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + } + + foreach (var header in HttpSigningHeader) + { + if (header.Equals(HEADER_REQUEST_TARGET)) + { + var targetUrl = string.Format("{0} {1}{2}", method.ToLower(), uriBuilder.Path, uriBuilder.Query); + HttpSignatureHeader.Add(header.ToLower(), targetUrl); + } + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + HttpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToUniversalTime().ToString("r"); + HttpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + HttpSignatureHeader.Add(header.ToLower(), uriBuilder.Host); + HttpSignedRequestHeader.Add(HEADER_HOST, uriBuilder.Host); + } + else if (header.Equals(HEADER_CREATED)) + { + HttpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + } + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, Digest); + HttpSignatureHeader.Add(header.ToLower(), Digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in requestOptions.HeaderParameters) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + HttpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + if (!isHeaderFound) + { + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + } + + } + var headersKeysString = string.Join(" ", HttpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in HttpSignatureHeader) + { + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + } + //Concatenate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + { + headerSignatureStr = GetRSASignature(signatureStringHash); + } + else if (keyType == PrivateKeyType.ECDSA) + { + headerSignatureStr = GetECDSASignature(signatureStringHash); + } + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (HttpSignatureHeader.ContainsKey(HEADER_CREATED)) + { + authorizationHeaderValue += string.Format(",created={0}", HttpSignatureHeader[HEADER_CREATED]); + } + + if (HttpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + { + authorizationHeaderValue += string.Format(",expires={0}", HttpSignatureHeader[HEADER_EXPIRES]); + } + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", + headersKeysString, headerSignatureStr); + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(string hashName, string stringToBeHashed) + { + var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); + var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + var stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + else + { + return string.Empty; + } + } + + /// + /// Gets the ECDSA signature + /// + /// + /// ECDSA signature + private string GetECDSASignature(byte[] dataToSign) + { + string keyStr = string.Empty; + if (File.Exists(KeyFilePath)) + { + keyStr = File.ReadAllText(KeyFilePath); + } + else + { + keyStr = KeyFilePath; + } + + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; + var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); + var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); + var ecdsa = ECDsa.Create(); + +#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; + if (KeyPassPhrase != null) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + // convert secure string to byte array + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); + ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(Marshal.PtrToStringUni(unmanagedString)), keyBytes, out byteCount); + } + finally + { + if (unmanagedString != IntPtr.Zero) + { + Marshal.ZeroFreeBSTR(unmanagedString); + } + } + } + else + { + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); + } + var signedBytes = ecdsa.SignHash(dataToSign); + var derBytes = ConvertToECDSAANS1Format(signedBytes); + var signedString = System.Convert.ToBase64String(derBytes); + + return signedString; +#else + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); +#endif + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default length for ECDSA code signing bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + { + rBytes.Add(signedBytes[i]); + } + for (int i = 32; i < 64; i++) + { + sBytes.Add(signedBytes[i]); + } + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r length, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(string pemfile, SecureString keyPassPhrase = null) + { + const string pempubheader = "-----BEGIN PUBLIC KEY-----"; + const string pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + + string pemstr = string.Empty; + if (File.Exists(pemfile)) + { + pemstr = File.ReadAllText(pemfile).Trim(); + } + else + { + pemstr = pemfile; + } + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + { + isPrivateKeyFile = false; + } + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); + if (pemkey == null) + { + return null; + } + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase = null) + { + const string pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const string pemprivfooter = "-----END RSA PRIVATE KEY-----"; + string pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + { + return null; + } + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + string pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) + { + return null; + } + string saltline = str.ReadLine(); + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + { + return null; + } + string saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + if (str.ReadLine() != "") + { + return null; + } + + //------ remaining b64 data is encrypted RSA key ---- + string encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 format + return null; + } + + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + { + return null; + } + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + { + binr.ReadByte(); //advance 1 byte + } + else if (twobytes == 0x8230) + { + binr.ReadInt16(); //advance 2 bytes + } + else + { + return null; + } + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + { + return null; + } + bt = binr.ReadByte(); + if (bt != 0x00) + { + return null; + } + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + bytesModulus = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesE = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesD = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesDP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesDQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + bytesIQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + { + return 0; + } + bt = binr.ReadByte(); + + if (bt == 0x81) + { + count = binr.ReadByte(); // data size in next byte + } + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + { + count = bt; // we already have the data size + } + while (binr.ReadByte() == 0x00) + { + //remove high order zeros in data + count -= 1; + } + binr.BaseStream.Seek(-1, SeekOrigin.Current); + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + const int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = new MD5CryptoServiceProvider(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + { + result = data00; //initialize + } + else + { + Array.Copy(result, hashtarget, result.Length); + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + { + result = md5.ComputeHash(result); + } + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// Private Key Type + private PrivateKeyType GetKeyType(string keyFilePath) + { + string[] key = null; + + if (File.Exists(keyFilePath)) + { + key = File.ReadAllLines(keyFilePath); + } + else + { + // The ApiKeyFilePath is passed as string + key = new string[] { keyFilePath }; + } + + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + PrivateKeyType keyType; + + if (key[0].Contains(rsaPrivateKeyHeader) && + key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + { + keyType = PrivateKeyType.RSA; + } + else if (key[0].Contains(ecPrivateKeyHeader) && + key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + keyType = PrivateKeyType.ECDSA; + } + else + { + throw new Exception("The key file path does not exist or key is invalid or key is not supported"); + } + return keyType; + } + #endregion + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IApiAccessor.cs new file mode 100644 index 00000000000..2bd76416004 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IAsynchronousClient.cs new file mode 100644 index 00000000000..601e86d561c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IReadableConfiguration.cs new file mode 100644 index 00000000000..b99a151e5bb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -0,0 +1,134 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Security.Cryptography.X509Certificates; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + + /// + /// Gets the HttpSigning configuration + /// + HttpSigningConfiguration HttpSigningConfiguration { get; } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ISynchronousClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ISynchronousClient.cs new file mode 100644 index 00000000000..0e0a7fedacf --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/Multimap.cs new file mode 100644 index 00000000000..738a64c570b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + 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 => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// 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(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// 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(TKey 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(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// 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(TKey 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[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.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(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs new file mode 100644 index 00000000000..a5253e58201 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/RequestOptions.cs new file mode 100644 index 00000000000..1b85b77bf93 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -0,0 +1,68 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/UnexpectedResponseException.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/UnexpectedResponseException.cs new file mode 100644 index 00000000000..326549d06b3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/UnexpectedResponseException.cs @@ -0,0 +1,34 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using UnityEngine.Networking; + +namespace Org.OpenAPITools.Client +{ + // Thrown when a backend doesn't return an expected response based on the expected type + // of the response data. + public class UnexpectedResponseException : Exception + { + public int ErrorCode { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public UnexpectedResponseException(UnityWebRequest request, System.Type type, string extra = "") + : base(CreateMessage(request, type, extra)) + { + ErrorCode = (int)request.responseCode; + } + + private static string CreateMessage(UnityWebRequest request, System.Type type, string extra) + { + return $"httpcode={request.responseCode}, expected {type.Name} but got data: {extra}"; + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/WebRequestPathBuilder.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/WebRequestPathBuilder.cs new file mode 100644 index 00000000000..e4af746d7d6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Client/WebRequestPathBuilder.cs @@ -0,0 +1,53 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A URI builder + /// + class WebRequestPathBuilder + { + private string _baseUrl; + private string _path; + private string _query = "?"; + public WebRequestPathBuilder(string baseUrl, string path) + { + _baseUrl = baseUrl; + _path = path; + } + + public void AddPathParameters(Dictionary parameters) + { + foreach (var parameter in parameters) + { + _path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value)); + } + } + + public void AddQueryParameters(Multimap parameters) + { + foreach (var parameter in parameters) + { + foreach (var value in parameter.Value) + { + _query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&"; + } + } + } + + public string GetFullUri() + { + return _baseUrl + _path + _query.Substring(0, _query.Length - 1); + } + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs new file mode 100644 index 00000000000..b3fc4c3c7a3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Org.OpenAPITools.Model +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..d232b084eca --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Activity.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// test map of maps + /// + [DataContract(Name = "Activity")] + public partial class Activity : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs. + public Activity(Dictionary> activityOutputs = default(Dictionary>)) + { + this.ActivityOutputs = activityOutputs; + } + + /// + /// Gets or Sets ActivityOutputs + /// + [DataMember(Name = "activity_outputs", EmitDefaultValue = false)] + public Dictionary> ActivityOutputs { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Activity); + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity input) + { + if (input == null) + { + return false; + } + return + ( + this.ActivityOutputs == input.ActivityOutputs || + this.ActivityOutputs != null && + input.ActivityOutputs != null && + this.ActivityOutputs.SequenceEqual(input.ActivityOutputs) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs new file mode 100644 index 00000000000..25d907b0530 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,136 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ActivityOutputElementRepresentation + /// + [DataContract(Name = "ActivityOutputElementRepresentation")] + public partial class ActivityOutputElementRepresentation : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// prop1. + /// prop2. + public ActivityOutputElementRepresentation(string prop1 = default(string), Object prop2 = default(Object)) + { + this.Prop1 = prop1; + this.Prop2 = prop2; + } + + /// + /// Gets or Sets Prop1 + /// + [DataMember(Name = "prop1", EmitDefaultValue = false)] + public string Prop1 { get; set; } + + /// + /// Gets or Sets Prop2 + /// + [DataMember(Name = "prop2", EmitDefaultValue = false)] + public Object Prop2 { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ActivityOutputElementRepresentation); + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation input) + { + if (input == null) + { + return false; + } + return + ( + this.Prop1 == input.Prop1 || + (this.Prop1 != null && + this.Prop1.Equals(input.Prop1)) + ) && + ( + this.Prop2 == input.Prop2 || + (this.Prop2 != null && + this.Prop2.Equals(input.Prop2)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs new file mode 100644 index 00000000000..1e8c482df26 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -0,0 +1,249 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesClass + /// + [DataContract(Name = "AdditionalPropertiesClass")] + public partial class AdditionalPropertiesClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// mapProperty. + /// mapOfMapProperty. + /// anytype1. + /// mapWithUndeclaredPropertiesAnytype1. + /// mapWithUndeclaredPropertiesAnytype2. + /// mapWithUndeclaredPropertiesAnytype3. + /// an object with no declared properties and no undeclared properties, hence it's an empty map.. + /// mapWithUndeclaredPropertiesString. + public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>), Object anytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype1 = default(Object), Object mapWithUndeclaredPropertiesAnytype2 = default(Object), Dictionary mapWithUndeclaredPropertiesAnytype3 = default(Dictionary), Object emptyMap = default(Object), Dictionary mapWithUndeclaredPropertiesString = default(Dictionary)) + { + this.MapProperty = mapProperty; + this.MapOfMapProperty = mapOfMapProperty; + this.Anytype1 = anytype1; + this.MapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + this.MapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + this.MapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + this.EmptyMap = emptyMap; + this.MapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + } + + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name = "map_property", EmitDefaultValue = false)] + public Dictionary MapProperty { get; set; } + + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name = "map_of_map_property", EmitDefaultValue = false)] + public Dictionary> MapOfMapProperty { get; set; } + + /// + /// Gets or Sets Anytype1 + /// + [DataMember(Name = "anytype_1", EmitDefaultValue = true)] + public Object Anytype1 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype1 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_1", EmitDefaultValue = false)] + public Object MapWithUndeclaredPropertiesAnytype1 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype2 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_2", EmitDefaultValue = false)] + public Object MapWithUndeclaredPropertiesAnytype2 { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesAnytype3 + /// + [DataMember(Name = "map_with_undeclared_properties_anytype_3", EmitDefaultValue = false)] + public Dictionary MapWithUndeclaredPropertiesAnytype3 { get; set; } + + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + /// + /// an object with no declared properties and no undeclared properties, hence it's an empty map. + [DataMember(Name = "empty_map", EmitDefaultValue = false)] + public Object EmptyMap { get; set; } + + /// + /// Gets or Sets MapWithUndeclaredPropertiesString + /// + [DataMember(Name = "map_with_undeclared_properties_string", EmitDefaultValue = false)] + public Dictionary MapWithUndeclaredPropertiesString { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype1: ").Append(MapWithUndeclaredPropertiesAnytype1).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype2: ").Append(MapWithUndeclaredPropertiesAnytype2).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesAnytype3: ").Append(MapWithUndeclaredPropertiesAnytype3).Append("\n"); + sb.Append(" EmptyMap: ").Append(EmptyMap).Append("\n"); + sb.Append(" MapWithUndeclaredPropertiesString: ").Append(MapWithUndeclaredPropertiesString).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesClass); + } + + /// + /// Returns true if AdditionalPropertiesClass instances are equal + /// + /// Instance of AdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(AdditionalPropertiesClass input) + { + if (input == null) + { + return false; + } + return + ( + this.MapProperty == input.MapProperty || + this.MapProperty != null && + input.MapProperty != null && + this.MapProperty.SequenceEqual(input.MapProperty) + ) && + ( + this.MapOfMapProperty == input.MapOfMapProperty || + this.MapOfMapProperty != null && + input.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) + ) && + ( + this.Anytype1 == input.Anytype1 || + (this.Anytype1 != null && + this.Anytype1.Equals(input.Anytype1)) + ) && + ( + this.MapWithUndeclaredPropertiesAnytype1 == input.MapWithUndeclaredPropertiesAnytype1 || + (this.MapWithUndeclaredPropertiesAnytype1 != null && + this.MapWithUndeclaredPropertiesAnytype1.Equals(input.MapWithUndeclaredPropertiesAnytype1)) + ) && + ( + this.MapWithUndeclaredPropertiesAnytype2 == input.MapWithUndeclaredPropertiesAnytype2 || + (this.MapWithUndeclaredPropertiesAnytype2 != null && + this.MapWithUndeclaredPropertiesAnytype2.Equals(input.MapWithUndeclaredPropertiesAnytype2)) + ) && + ( + this.MapWithUndeclaredPropertiesAnytype3 == input.MapWithUndeclaredPropertiesAnytype3 || + this.MapWithUndeclaredPropertiesAnytype3 != null && + input.MapWithUndeclaredPropertiesAnytype3 != null && + this.MapWithUndeclaredPropertiesAnytype3.SequenceEqual(input.MapWithUndeclaredPropertiesAnytype3) + ) && + ( + this.EmptyMap == input.EmptyMap || + (this.EmptyMap != null && + this.EmptyMap.Equals(input.EmptyMap)) + ) && + ( + this.MapWithUndeclaredPropertiesString == input.MapWithUndeclaredPropertiesString || + this.MapWithUndeclaredPropertiesString != null && + input.MapWithUndeclaredPropertiesString != null && + this.MapWithUndeclaredPropertiesString.SequenceEqual(input.MapWithUndeclaredPropertiesString) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapProperty != null) + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } + if (this.MapOfMapProperty != null) + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } + if (this.Anytype1 != null) + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype1 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype2 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesAnytype3 != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } + if (this.EmptyMap != null) + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } + if (this.MapWithUndeclaredPropertiesString != null) + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Animal.cs new file mode 100644 index 00000000000..0073454f667 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Animal.cs @@ -0,0 +1,147 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Animal + /// + [DataContract(Name = "Animal")] + public partial class Animal : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Animal() { } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + /// color (default to "red"). + public Animal(string className = default(string), string color = @"red") + { + // to ensure "className" is required (not null) + if (className == null) + { + throw new ArgumentNullException("className is a required property for Animal and cannot be null"); + } + this.ClassName = className; + // use default value if no "color" provided + this.Color = color ?? @"red"; + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = true)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Animal); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal input) + { + if (input == null) + { + return false; + } + return + ( + this.ClassName == input.ClassName || + (this.ClassName != null && + this.ClassName.Equals(input.ClassName)) + ) && + ( + this.Color == input.Color || + (this.Color != null && + this.Color.Equals(input.Color)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ApiResponse.cs new file mode 100644 index 00000000000..4d83d2d347b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -0,0 +1,150 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ApiResponse + /// + [DataContract(Name = "ApiResponse")] + public partial class ApiResponse : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) + { + this.Code = code; + this.Type = type; + this.Message = message; + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name = "code", EmitDefaultValue = false)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ApiResponse); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.Code == input.Code || + this.Code.Equals(input.Code) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Code.GetHashCode(); + if (this.Type != null) + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Apple.cs new file mode 100644 index 00000000000..2d5c1d394cd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Apple.cs @@ -0,0 +1,136 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Apple + /// + [DataContract(Name = "apple")] + public partial class Apple : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// cultivar. + /// origin. + public Apple(string cultivar = default(string), string origin = default(string)) + { + this.Cultivar = cultivar; + this.Origin = origin; + } + + /// + /// Gets or Sets Cultivar + /// + [DataMember(Name = "cultivar", EmitDefaultValue = false)] + public string Cultivar { get; set; } + + /// + /// Gets or Sets Origin + /// + [DataMember(Name = "origin", EmitDefaultValue = false)] + public string Origin { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Apple {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Origin: ").Append(Origin).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Apple); + } + + /// + /// Returns true if Apple instances are equal + /// + /// Instance of Apple to be compared + /// Boolean + public bool Equals(Apple input) + { + if (input == null) + { + return false; + } + return + ( + this.Cultivar == input.Cultivar || + (this.Cultivar != null && + this.Cultivar.Equals(input.Cultivar)) + ) && + ( + this.Origin == input.Origin || + (this.Origin != null && + this.Origin.Equals(input.Origin)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cultivar != null) + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + if (this.Origin != null) + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AppleReq.cs new file mode 100644 index 00000000000..4b7a3084bd0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/AppleReq.cs @@ -0,0 +1,142 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AppleReq + /// + [DataContract(Name = "appleReq")] + public partial class AppleReq : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected AppleReq() { } + /// + /// Initializes a new instance of the class. + /// + /// cultivar (required). + /// mealy. + public AppleReq(string cultivar = default(string), bool mealy = default(bool)) + { + // to ensure "cultivar" is required (not null) + if (cultivar == null) + { + throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null"); + } + this.Cultivar = cultivar; + this.Mealy = mealy; + } + + /// + /// Gets or Sets Cultivar + /// + [DataMember(Name = "cultivar", IsRequired = true, EmitDefaultValue = true)] + public string Cultivar { get; set; } + + /// + /// Gets or Sets Mealy + /// + [DataMember(Name = "mealy", EmitDefaultValue = true)] + public bool Mealy { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class AppleReq {\n"); + sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); + sb.Append(" Mealy: ").Append(Mealy).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AppleReq); + } + + /// + /// Returns true if AppleReq instances are equal + /// + /// Instance of AppleReq to be compared + /// Boolean + public bool Equals(AppleReq input) + { + if (input == null) + { + return false; + } + return + ( + this.Cultivar == input.Cultivar || + (this.Cultivar != null && + this.Cultivar.Equals(input.Cultivar)) + ) && + ( + this.Mealy == input.Mealy || + this.Mealy.Equals(input.Mealy) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Cultivar != null) + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs new file mode 100644 index 00000000000..b6f5ac66d2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayOfArrayOfNumberOnly + /// + [DataContract(Name = "ArrayOfArrayOfNumberOnly")] + public partial class ArrayOfArrayOfNumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayArrayNumber. + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + { + this.ArrayArrayNumber = arrayArrayNumber; + } + + /// + /// Gets or Sets ArrayArrayNumber + /// + [DataMember(Name = "ArrayArrayNumber", EmitDefaultValue = false)] + public List> ArrayArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayOfArrayOfNumberOnly {\n"); + sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayOfArrayOfNumberOnly); + } + + /// + /// Returns true if ArrayOfArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfArrayOfNumberOnly input) + { + if (input == null) + { + return false; + } + return + ( + this.ArrayArrayNumber == input.ArrayArrayNumber || + this.ArrayArrayNumber != null && + input.ArrayArrayNumber != null && + this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayArrayNumber != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs new file mode 100644 index 00000000000..78d77d41a43 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayOfNumberOnly + /// + [DataContract(Name = "ArrayOfNumberOnly")] + public partial class ArrayOfNumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayNumber. + public ArrayOfNumberOnly(List arrayNumber = default(List)) + { + this.ArrayNumber = arrayNumber; + } + + /// + /// Gets or Sets ArrayNumber + /// + [DataMember(Name = "ArrayNumber", EmitDefaultValue = false)] + public List ArrayNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayOfNumberOnly {\n"); + sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayOfNumberOnly); + } + + /// + /// Returns true if ArrayOfNumberOnly instances are equal + /// + /// Instance of ArrayOfNumberOnly to be compared + /// Boolean + public bool Equals(ArrayOfNumberOnly input) + { + if (input == null) + { + return false; + } + return + ( + this.ArrayNumber == input.ArrayNumber || + this.ArrayNumber != null && + input.ArrayNumber != null && + this.ArrayNumber.SequenceEqual(input.ArrayNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayNumber != null) + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayTest.cs new file mode 100644 index 00000000000..652ab86bd19 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -0,0 +1,157 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ArrayTest + /// + [DataContract(Name = "ArrayTest")] + public partial class ArrayTest : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// arrayOfString. + /// arrayArrayOfInteger. + /// arrayArrayOfModel. + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + { + this.ArrayOfString = arrayOfString; + this.ArrayArrayOfInteger = arrayArrayOfInteger; + this.ArrayArrayOfModel = arrayArrayOfModel; + } + + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name = "array_of_string", EmitDefaultValue = false)] + public List ArrayOfString { get; set; } + + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name = "array_array_of_integer", EmitDefaultValue = false)] + public List> ArrayArrayOfInteger { get; set; } + + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name = "array_array_of_model", EmitDefaultValue = false)] + public List> ArrayArrayOfModel { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ArrayTest); + } + + /// + /// Returns true if ArrayTest instances are equal + /// + /// Instance of ArrayTest to be compared + /// Boolean + public bool Equals(ArrayTest input) + { + if (input == null) + { + return false; + } + return + ( + this.ArrayOfString == input.ArrayOfString || + this.ArrayOfString != null && + input.ArrayOfString != null && + this.ArrayOfString.SequenceEqual(input.ArrayOfString) + ) && + ( + this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || + this.ArrayArrayOfInteger != null && + input.ArrayArrayOfInteger != null && + this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) + ) && + ( + this.ArrayArrayOfModel == input.ArrayArrayOfModel || + this.ArrayArrayOfModel != null && + input.ArrayArrayOfModel != null && + this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ArrayOfString != null) + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } + if (this.ArrayArrayOfInteger != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } + if (this.ArrayArrayOfModel != null) + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Banana.cs new file mode 100644 index 00000000000..b31a453f9e8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Banana.cs @@ -0,0 +1,114 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Banana + /// + [DataContract(Name = "banana")] + public partial class Banana : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// lengthCm. + public Banana(decimal lengthCm = default(decimal)) + { + this.LengthCm = lengthCm; + } + + /// + /// Gets or Sets LengthCm + /// + [DataMember(Name = "lengthCm", EmitDefaultValue = false)] + public decimal LengthCm { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Banana {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Banana); + } + + /// + /// Returns true if Banana instances are equal + /// + /// Instance of Banana to be compared + /// Boolean + public bool Equals(Banana input) + { + if (input == null) + { + return false; + } + return + ( + this.LengthCm == input.LengthCm || + this.LengthCm.Equals(input.LengthCm) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/BananaReq.cs new file mode 100644 index 00000000000..2f73ada806c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/BananaReq.cs @@ -0,0 +1,133 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BananaReq + /// + [DataContract(Name = "bananaReq")] + public partial class BananaReq : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BananaReq() { } + /// + /// Initializes a new instance of the class. + /// + /// lengthCm (required). + /// sweet. + public BananaReq(decimal lengthCm = default(decimal), bool sweet = default(bool)) + { + this.LengthCm = lengthCm; + this.Sweet = sweet; + } + + /// + /// Gets or Sets LengthCm + /// + [DataMember(Name = "lengthCm", IsRequired = true, EmitDefaultValue = true)] + public decimal LengthCm { get; set; } + + /// + /// Gets or Sets Sweet + /// + [DataMember(Name = "sweet", EmitDefaultValue = true)] + public bool Sweet { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BananaReq {\n"); + sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); + sb.Append(" Sweet: ").Append(Sweet).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BananaReq); + } + + /// + /// Returns true if BananaReq instances are equal + /// + /// Instance of BananaReq to be compared + /// Boolean + public bool Equals(BananaReq input) + { + if (input == null) + { + return false; + } + return + ( + this.LengthCm == input.LengthCm || + this.LengthCm.Equals(input.LengthCm) + ) && + ( + this.Sweet == input.Sweet || + this.Sweet.Equals(input.Sweet) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/BasquePig.cs new file mode 100644 index 00000000000..2a9aa95af51 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/BasquePig.cs @@ -0,0 +1,128 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BasquePig + /// + [DataContract(Name = "BasquePig")] + public partial class BasquePig : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BasquePig() { } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + public BasquePig(string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) + { + throw new ArgumentNullException("className is a required property for BasquePig and cannot be null"); + } + this.ClassName = className; + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = true)] + public string ClassName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class BasquePig {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BasquePig); + } + + /// + /// Returns true if BasquePig instances are equal + /// + /// Instance of BasquePig to be compared + /// Boolean + public bool Equals(BasquePig input) + { + if (input == null) + { + return false; + } + return + ( + this.ClassName == input.ClassName || + (this.ClassName != null && + this.ClassName.Equals(input.ClassName)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Capitalization.cs new file mode 100644 index 00000000000..20dd579a914 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Capitalization.cs @@ -0,0 +1,209 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Capitalization + /// + [DataContract(Name = "Capitalization")] + public partial class Capitalization : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// smallCamel. + /// capitalCamel. + /// smallSnake. + /// capitalSnake. + /// sCAETHFlowPoints. + /// Name of the pet . + public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string)) + { + this.SmallCamel = smallCamel; + this.CapitalCamel = capitalCamel; + this.SmallSnake = smallSnake; + this.CapitalSnake = capitalSnake; + this.SCAETHFlowPoints = sCAETHFlowPoints; + this.ATT_NAME = aTTNAME; + } + + /// + /// Gets or Sets SmallCamel + /// + [DataMember(Name = "smallCamel", EmitDefaultValue = false)] + public string SmallCamel { get; set; } + + /// + /// Gets or Sets CapitalCamel + /// + [DataMember(Name = "CapitalCamel", EmitDefaultValue = false)] + public string CapitalCamel { get; set; } + + /// + /// Gets or Sets SmallSnake + /// + [DataMember(Name = "small_Snake", EmitDefaultValue = false)] + public string SmallSnake { get; set; } + + /// + /// Gets or Sets CapitalSnake + /// + [DataMember(Name = "Capital_Snake", EmitDefaultValue = false)] + public string CapitalSnake { get; set; } + + /// + /// Gets or Sets SCAETHFlowPoints + /// + [DataMember(Name = "SCA_ETH_Flow_Points", EmitDefaultValue = false)] + public string SCAETHFlowPoints { get; set; } + + /// + /// Name of the pet + /// + /// Name of the pet + [DataMember(Name = "ATT_NAME", EmitDefaultValue = false)] + public string ATT_NAME { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Capitalization {\n"); + sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); + sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); + sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n"); + sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n"); + sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n"); + sb.Append(" ATT_NAME: ").Append(ATT_NAME).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Capitalization); + } + + /// + /// Returns true if Capitalization instances are equal + /// + /// Instance of Capitalization to be compared + /// Boolean + public bool Equals(Capitalization input) + { + if (input == null) + { + return false; + } + return + ( + this.SmallCamel == input.SmallCamel || + (this.SmallCamel != null && + this.SmallCamel.Equals(input.SmallCamel)) + ) && + ( + this.CapitalCamel == input.CapitalCamel || + (this.CapitalCamel != null && + this.CapitalCamel.Equals(input.CapitalCamel)) + ) && + ( + this.SmallSnake == input.SmallSnake || + (this.SmallSnake != null && + this.SmallSnake.Equals(input.SmallSnake)) + ) && + ( + this.CapitalSnake == input.CapitalSnake || + (this.CapitalSnake != null && + this.CapitalSnake.Equals(input.CapitalSnake)) + ) && + ( + this.SCAETHFlowPoints == input.SCAETHFlowPoints || + (this.SCAETHFlowPoints != null && + this.SCAETHFlowPoints.Equals(input.SCAETHFlowPoints)) + ) && + ( + this.ATT_NAME == input.ATT_NAME || + (this.ATT_NAME != null && + this.ATT_NAME.Equals(input.ATT_NAME)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SmallCamel != null) + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } + if (this.CapitalCamel != null) + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } + if (this.SmallSnake != null) + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } + if (this.CapitalSnake != null) + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } + if (this.SCAETHFlowPoints != null) + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } + if (this.ATT_NAME != null) + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Cat.cs new file mode 100644 index 00000000000..2d02542a517 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Cat.cs @@ -0,0 +1,122 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Cat + /// + [DataContract(Name = "Cat")] + public partial class Cat : Animal, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Cat() { } + /// + /// Initializes a new instance of the class. + /// + /// declawed. + /// className (required) (default to "Cat"). + /// color (default to "red"). + public Cat(bool declawed = default(bool), string className = @"Cat", string color = @"red") : base(className, color) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Cat); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.Declawed == input.Declawed || + this.Declawed.Equals(input.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 00000000000..b93f50ff231 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -0,0 +1,114 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract(Name = "Cat_allOf")] + public partial class CatAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool declawed = default(bool)) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name = "declawed", EmitDefaultValue = true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CatAllOf); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.Declawed == input.Declawed || + this.Declawed.Equals(input.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Category.cs new file mode 100644 index 00000000000..52680d66e36 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Category.cs @@ -0,0 +1,142 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Category + /// + [DataContract(Name = "Category")] + public partial class Category : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Category() { } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name (required) (default to "default-name"). + public Category(long id = default(long), string name = @"default-name") + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Category and cannot be null"); + } + this.Name = name; + this.Id = id; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Category); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ChildCat.cs new file mode 100644 index 00000000000..df508441ee6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ChildCat.cs @@ -0,0 +1,147 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCat + /// + [DataContract(Name = "ChildCat")] + public partial class ChildCat : ParentPet, IEquatable + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", EmitDefaultValue = false)] + public PetTypeEnum? PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (default to PetTypeEnum.ChildCat). + public ChildCat(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) : base() + { + this.Name = name; + this.PetType = petType; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ChildCat); + } + + /// + /// Returns true if ChildCat instances are equal + /// + /// Instance of ChildCat to be compared + /// Boolean + public bool Equals(ChildCat input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && base.Equals(input) && + ( + this.PetType == input.PetType || + this.PetType.Equals(input.PetType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ChildCatAllOf.cs new file mode 100644 index 00000000000..0a23f149b03 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -0,0 +1,146 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ChildCatAllOf + /// + [DataContract(Name = "ChildCat_allOf")] + public partial class ChildCatAllOf : IEquatable + { + /// + /// Defines PetType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetTypeEnum + { + /// + /// Enum ChildCat for value: ChildCat + /// + [EnumMember(Value = "ChildCat")] + ChildCat = 1 + + } + + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", EmitDefaultValue = false)] + public PetTypeEnum? PetType { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// name. + /// petType (default to PetTypeEnum.ChildCat). + public ChildCatAllOf(string name = default(string), PetTypeEnum? petType = PetTypeEnum.ChildCat) + { + this.Name = name; + this.PetType = petType; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ChildCatAllOf {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ChildCatAllOf); + } + + /// + /// Returns true if ChildCatAllOf instances are equal + /// + /// Instance of ChildCatAllOf to be compared + /// Boolean + public bool Equals(ChildCatAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PetType == input.PetType || + this.PetType.Equals(input.PetType) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ClassModel.cs new file mode 100644 index 00000000000..2f97843fe7d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ClassModel.cs @@ -0,0 +1,118 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model with \"_class\" property + /// + [DataContract(Name = "ClassModel")] + public partial class ClassModel : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _class. + public ClassModel(string _class = default(string)) + { + this.Class = _class; + } + + /// + /// Gets or Sets Class + /// + [DataMember(Name = "_class", EmitDefaultValue = false)] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ClassModel {\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ClassModel); + } + + /// + /// Returns true if ClassModel instances are equal + /// + /// Instance of ClassModel to be compared + /// Boolean + public bool Equals(ClassModel input) + { + if (input == null) + { + return false; + } + return + ( + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Class != null) + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs new file mode 100644 index 00000000000..3dad8a4a0ba --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -0,0 +1,151 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ComplexQuadrilateral + /// + [DataContract(Name = "ComplexQuadrilateral")] + public partial class ComplexQuadrilateral : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ComplexQuadrilateral() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// quadrilateralType (required). + public ComplexQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) + { + throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) + { + throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = true)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = true)] + public string QuadrilateralType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ComplexQuadrilateral {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ComplexQuadrilateral); + } + + /// + /// Returns true if ComplexQuadrilateral instances are equal + /// + /// Instance of ComplexQuadrilateral to be compared + /// Boolean + public bool Equals(ComplexQuadrilateral input) + { + if (input == null) + { + return false; + } + return + ( + this.ShapeType == input.ShapeType || + (this.ShapeType != null && + this.ShapeType.Equals(input.ShapeType)) + ) && + ( + this.QuadrilateralType == input.QuadrilateralType || + (this.QuadrilateralType != null && + this.QuadrilateralType.Equals(input.QuadrilateralType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DanishPig.cs new file mode 100644 index 00000000000..23e9e1f7ffb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DanishPig.cs @@ -0,0 +1,128 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// DanishPig + /// + [DataContract(Name = "DanishPig")] + public partial class DanishPig : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected DanishPig() { } + /// + /// Initializes a new instance of the class. + /// + /// className (required). + public DanishPig(string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) + { + throw new ArgumentNullException("className is a required property for DanishPig and cannot be null"); + } + this.ClassName = className; + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = true)] + public string ClassName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DanishPig {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DanishPig); + } + + /// + /// Returns true if DanishPig instances are equal + /// + /// Instance of DanishPig to be compared + /// Boolean + public bool Equals(DanishPig input) + { + if (input == null) + { + return false; + } + return + ( + this.ClassName == input.ClassName || + (this.ClassName != null && + this.ClassName.Equals(input.ClassName)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DateOnlyClass.cs new file mode 100644 index 00000000000..e3376af94fd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -0,0 +1,120 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// DateOnlyClass + /// + [DataContract(Name = "DateOnlyClass")] + public partial class DateOnlyClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// dateOnlyProperty. + public DateOnlyClass(DateTime dateOnlyProperty = default(DateTime)) + { + this.DateOnlyProperty = dateOnlyProperty; + } + + /// + /// Gets or Sets DateOnlyProperty + /// + /// "Fri Jul 21 00:00:00 UTC 2017" + [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime DateOnlyProperty { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DateOnlyClass {\n"); + sb.Append(" DateOnlyProperty: ").Append(DateOnlyProperty).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DateOnlyClass); + } + + /// + /// Returns true if DateOnlyClass instances are equal + /// + /// Instance of DateOnlyClass to be compared + /// Boolean + public bool Equals(DateOnlyClass input) + { + if (input == null) + { + return false; + } + return + ( + this.DateOnlyProperty == input.DateOnlyProperty || + (this.DateOnlyProperty != null && + this.DateOnlyProperty.Equals(input.DateOnlyProperty)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.DateOnlyProperty != null) + { + hashCode = (hashCode * 59) + this.DateOnlyProperty.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DeprecatedObject.cs new file mode 100644 index 00000000000..3d7c5fdbb49 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -0,0 +1,118 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// DeprecatedObject + /// + [DataContract(Name = "DeprecatedObject")] + public partial class DeprecatedObject : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public DeprecatedObject(string name = default(string)) + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DeprecatedObject {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DeprecatedObject); + } + + /// + /// Returns true if DeprecatedObject instances are equal + /// + /// Instance of DeprecatedObject to be compared + /// Boolean + public bool Equals(DeprecatedObject input) + { + if (input == null) + { + return false; + } + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Dog.cs new file mode 100644 index 00000000000..cda8e3ca41c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Dog.cs @@ -0,0 +1,126 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Dog + /// + [DataContract(Name = "Dog")] + public partial class Dog : Animal, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Dog() { } + /// + /// Initializes a new instance of the class. + /// + /// breed. + /// className (required) (default to "Dog"). + /// color (default to "red"). + public Dog(string breed = default(string), string className = @"Dog", string color = @"red") : base(className, color) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Dog); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 00000000000..16cd6946de9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,118 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract(Name = "Dog_allOf")] + public partial class DogAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name = "breed", EmitDefaultValue = false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DogAllOf); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Drawing.cs new file mode 100644 index 00000000000..7ceaa0ce3b1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Drawing.cs @@ -0,0 +1,174 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Drawing + /// + [DataContract(Name = "Drawing")] + public partial class Drawing : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// mainShape. + /// shapeOrNull. + /// nullableShape. + /// shapes. + public Drawing(Shape mainShape = default(Shape), ShapeOrNull shapeOrNull = default(ShapeOrNull), NullableShape nullableShape = default(NullableShape), List shapes = default(List)) : base() + { + this.MainShape = mainShape; + this.ShapeOrNull = shapeOrNull; + this.NullableShape = nullableShape; + this.Shapes = shapes; + } + + /// + /// Gets or Sets MainShape + /// + [DataMember(Name = "mainShape", EmitDefaultValue = false)] + public Shape MainShape { get; set; } + + /// + /// Gets or Sets ShapeOrNull + /// + [DataMember(Name = "shapeOrNull", EmitDefaultValue = false)] + public ShapeOrNull ShapeOrNull { get; set; } + + /// + /// Gets or Sets NullableShape + /// + [DataMember(Name = "nullableShape", EmitDefaultValue = true)] + public NullableShape NullableShape { get; set; } + + /// + /// Gets or Sets Shapes + /// + [DataMember(Name = "shapes", EmitDefaultValue = false)] + public List Shapes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Drawing {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" MainShape: ").Append(MainShape).Append("\n"); + sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n"); + sb.Append(" NullableShape: ").Append(NullableShape).Append("\n"); + sb.Append(" Shapes: ").Append(Shapes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Drawing); + } + + /// + /// Returns true if Drawing instances are equal + /// + /// Instance of Drawing to be compared + /// Boolean + public bool Equals(Drawing input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.MainShape == input.MainShape || + (this.MainShape != null && + this.MainShape.Equals(input.MainShape)) + ) && base.Equals(input) && + ( + this.ShapeOrNull == input.ShapeOrNull || + (this.ShapeOrNull != null && + this.ShapeOrNull.Equals(input.ShapeOrNull)) + ) && base.Equals(input) && + ( + this.NullableShape == input.NullableShape || + (this.NullableShape != null && + this.NullableShape.Equals(input.NullableShape)) + ) && base.Equals(input) && + ( + this.Shapes == input.Shapes || + this.Shapes != null && + input.Shapes != null && + this.Shapes.SequenceEqual(input.Shapes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.MainShape != null) + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } + if (this.ShapeOrNull != null) + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } + if (this.NullableShape != null) + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } + if (this.Shapes != null) + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumArrays.cs new file mode 100644 index 00000000000..bbd3ce4e78b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -0,0 +1,173 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// EnumArrays + /// + [DataContract(Name = "EnumArrays")] + public partial class EnumArrays : IEquatable + { + /// + /// Defines JustSymbol + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JustSymbolEnum + { + /// + /// Enum GreaterThanOrEqualTo for value: >= + /// + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo = 1, + + /// + /// Enum Dollar for value: $ + /// + [EnumMember(Value = "$")] + Dollar = 2 + + } + + + /// + /// Gets or Sets JustSymbol + /// + [DataMember(Name = "just_symbol", EmitDefaultValue = false)] + public JustSymbolEnum? JustSymbol { get; set; } + /// + /// Defines ArrayEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ArrayEnumEnum + { + /// + /// Enum Fish for value: fish + /// + [EnumMember(Value = "fish")] + Fish = 1, + + /// + /// Enum Crab for value: crab + /// + [EnumMember(Value = "crab")] + Crab = 2 + + } + + /// + /// Initializes a new instance of the class. + /// + /// justSymbol. + /// arrayEnum. + public EnumArrays(JustSymbolEnum? justSymbol = default(JustSymbolEnum?), List arrayEnum = default(List)) + { + this.JustSymbol = justSymbol; + this.ArrayEnum = arrayEnum; + } + + /// + /// Gets or Sets ArrayEnum + /// + [DataMember(Name = "array_enum", EmitDefaultValue = false)] + public List ArrayEnum { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnumArrays {\n"); + sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); + sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EnumArrays); + } + + /// + /// Returns true if EnumArrays instances are equal + /// + /// Instance of EnumArrays to be compared + /// Boolean + public bool Equals(EnumArrays input) + { + if (input == null) + { + return false; + } + return + ( + this.JustSymbol == input.JustSymbol || + this.JustSymbol.Equals(input.JustSymbol) + ) && + ( + this.ArrayEnum == input.ArrayEnum || + this.ArrayEnum != null && + input.ArrayEnum != null && + this.ArrayEnum.SequenceEqual(input.ArrayEnum) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + if (this.ArrayEnum != null) + { + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumClass.cs new file mode 100644 index 00000000000..d7ba7e311d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumClass.cs @@ -0,0 +1,53 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines EnumClass + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumClass + { + /// + /// Enum Abc for value: _abc + /// + [EnumMember(Value = "_abc")] + Abc = 1, + + /// + /// Enum Efg for value: -efg + /// + [EnumMember(Value = "-efg")] + Efg = 2, + + /// + /// Enum Xyz for value: (xyz) + /// + [EnumMember(Value = "(xyz)")] + Xyz = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumTest.cs new file mode 100644 index 00000000000..2543fc92056 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EnumTest.cs @@ -0,0 +1,337 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// EnumTest + /// + [DataContract(Name = "Enum_Test")] + public partial class EnumTest : IEquatable + { + /// + /// Defines EnumString + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + + } + + + /// + /// Gets or Sets EnumString + /// + [DataMember(Name = "enum_string", EmitDefaultValue = false)] + public EnumStringEnum? EnumString { get; set; } + /// + /// Defines EnumStringRequired + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumStringRequiredEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2, + + /// + /// Enum Empty for value: + /// + [EnumMember(Value = "")] + Empty = 3 + + } + + + /// + /// Gets or Sets EnumStringRequired + /// + [DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = true)] + public EnumStringRequiredEnum EnumStringRequired { get; set; } + /// + /// Defines EnumInteger + /// + public enum EnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + + } + + + /// + /// Gets or Sets EnumInteger + /// + [DataMember(Name = "enum_integer", EmitDefaultValue = false)] + public EnumIntegerEnum? EnumInteger { get; set; } + /// + /// Defines EnumIntegerOnly + /// + public enum EnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + + } + + + /// + /// Gets or Sets EnumIntegerOnly + /// + [DataMember(Name = "enum_integer_only", EmitDefaultValue = false)] + public EnumIntegerOnlyEnum? EnumIntegerOnly { get; set; } + /// + /// Defines EnumNumber + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EnumNumberEnum + { + /// + /// Enum NUMBER_1_DOT_1 for value: 1.1 + /// + [EnumMember(Value = "1.1")] + NUMBER_1_DOT_1 = 1, + + /// + /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 + /// + [EnumMember(Value = "-1.2")] + NUMBER_MINUS_1_DOT_2 = 2 + + } + + + /// + /// Gets or Sets EnumNumber + /// + [DataMember(Name = "enum_number", EmitDefaultValue = false)] + public EnumNumberEnum? EnumNumber { get; set; } + + /// + /// Gets or Sets OuterEnum + /// + [DataMember(Name = "outerEnum", EmitDefaultValue = true)] + public OuterEnum? OuterEnum { get; set; } + + /// + /// Gets or Sets OuterEnumInteger + /// + [DataMember(Name = "outerEnumInteger", EmitDefaultValue = false)] + public OuterEnumInteger? OuterEnumInteger { get; set; } + + /// + /// Gets or Sets OuterEnumDefaultValue + /// + [DataMember(Name = "outerEnumDefaultValue", EmitDefaultValue = false)] + public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; } + + /// + /// Gets or Sets OuterEnumIntegerDefaultValue + /// + [DataMember(Name = "outerEnumIntegerDefaultValue", EmitDefaultValue = false)] + public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EnumTest() { } + /// + /// Initializes a new instance of the class. + /// + /// enumString. + /// enumStringRequired (required). + /// enumInteger. + /// enumIntegerOnly. + /// enumNumber. + /// outerEnum. + /// outerEnumInteger. + /// outerEnumDefaultValue. + /// outerEnumIntegerDefaultValue. + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumIntegerOnlyEnum? enumIntegerOnly = default(EnumIntegerOnlyEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?), OuterEnumInteger? outerEnumInteger = default(OuterEnumInteger?), OuterEnumDefaultValue? outerEnumDefaultValue = default(OuterEnumDefaultValue?), OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default(OuterEnumIntegerDefaultValue?)) + { + this.EnumStringRequired = enumStringRequired; + this.EnumString = enumString; + this.EnumInteger = enumInteger; + this.EnumIntegerOnly = enumIntegerOnly; + this.EnumNumber = enumNumber; + this.OuterEnum = outerEnum; + this.OuterEnumInteger = outerEnumInteger; + this.OuterEnumDefaultValue = outerEnumDefaultValue; + this.OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EnumTest {\n"); + sb.Append(" EnumString: ").Append(EnumString).Append("\n"); + sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); + sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); + sb.Append(" EnumIntegerOnly: ").Append(EnumIntegerOnly).Append("\n"); + sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); + sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n"); + sb.Append(" OuterEnumInteger: ").Append(OuterEnumInteger).Append("\n"); + sb.Append(" OuterEnumDefaultValue: ").Append(OuterEnumDefaultValue).Append("\n"); + sb.Append(" OuterEnumIntegerDefaultValue: ").Append(OuterEnumIntegerDefaultValue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EnumTest); + } + + /// + /// Returns true if EnumTest instances are equal + /// + /// Instance of EnumTest to be compared + /// Boolean + public bool Equals(EnumTest input) + { + if (input == null) + { + return false; + } + return + ( + this.EnumString == input.EnumString || + this.EnumString.Equals(input.EnumString) + ) && + ( + this.EnumStringRequired == input.EnumStringRequired || + this.EnumStringRequired.Equals(input.EnumStringRequired) + ) && + ( + this.EnumInteger == input.EnumInteger || + this.EnumInteger.Equals(input.EnumInteger) + ) && + ( + this.EnumIntegerOnly == input.EnumIntegerOnly || + this.EnumIntegerOnly.Equals(input.EnumIntegerOnly) + ) && + ( + this.EnumNumber == input.EnumNumber || + this.EnumNumber.Equals(input.EnumNumber) + ) && + ( + this.OuterEnum == input.OuterEnum || + this.OuterEnum.Equals(input.OuterEnum) + ) && + ( + this.OuterEnumInteger == input.OuterEnumInteger || + this.OuterEnumInteger.Equals(input.OuterEnumInteger) + ) && + ( + this.OuterEnumDefaultValue == input.OuterEnumDefaultValue || + this.OuterEnumDefaultValue.Equals(input.OuterEnumDefaultValue) + ) && + ( + this.OuterEnumIntegerDefaultValue == input.OuterEnumIntegerDefaultValue || + this.OuterEnumIntegerDefaultValue.Equals(input.OuterEnumIntegerDefaultValue) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EquilateralTriangle.cs new file mode 100644 index 00000000000..cf030583c11 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -0,0 +1,151 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// EquilateralTriangle + /// + [DataContract(Name = "EquilateralTriangle")] + public partial class EquilateralTriangle : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected EquilateralTriangle() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public EquilateralTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) + { + throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) + { + throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null"); + } + this.TriangleType = triangleType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = true)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = true)] + public string TriangleType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EquilateralTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as EquilateralTriangle); + } + + /// + /// Returns true if EquilateralTriangle instances are equal + /// + /// Instance of EquilateralTriangle to be compared + /// Boolean + public bool Equals(EquilateralTriangle input) + { + if (input == null) + { + return false; + } + return + ( + this.ShapeType == input.ShapeType || + (this.ShapeType != null && + this.ShapeType.Equals(input.ShapeType)) + ) && + ( + this.TriangleType == input.TriangleType || + (this.TriangleType != null && + this.TriangleType.Equals(input.TriangleType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 00000000000..0df50ba9b2f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/File.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Must be named `File` for test. + /// + [DataContract(Name = "File")] + public partial class File : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization. + public File(string sourceURI = default(string)) + { + this.SourceURI = sourceURI; + } + + /// + /// Test capitalization + /// + /// Test capitalization + [DataMember(Name = "sourceURI", EmitDefaultValue = false)] + public string SourceURI { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as File); + } + + /// + /// Returns true if File instances are equal + /// + /// Instance of File to be compared + /// Boolean + public bool Equals(File input) + { + if (input == null) + { + return false; + } + return + ( + this.SourceURI == input.SourceURI || + (this.SourceURI != null && + this.SourceURI.Equals(input.SourceURI)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SourceURI != null) + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 00000000000..388add47e63 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,137 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// FileSchemaTestClass + /// + [DataContract(Name = "FileSchemaTestClass")] + public partial class FileSchemaTestClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// file. + /// files. + public FileSchemaTestClass(File file = default(File), List files = default(List)) + { + this.File = file; + this.Files = files; + } + + /// + /// Gets or Sets File + /// + [DataMember(Name = "file", EmitDefaultValue = false)] + public File File { get; set; } + + /// + /// Gets or Sets Files + /// + [DataMember(Name = "files", EmitDefaultValue = false)] + public List Files { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FileSchemaTestClass); + } + + /// + /// Returns true if FileSchemaTestClass instances are equal + /// + /// Instance of FileSchemaTestClass to be compared + /// Boolean + public bool Equals(FileSchemaTestClass input) + { + if (input == null) + { + return false; + } + return + ( + this.File == input.File || + (this.File != null && + this.File.Equals(input.File)) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.File != null) + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Foo.cs new file mode 100644 index 00000000000..704abb10128 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Foo.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Foo + /// + [DataContract(Name = "Foo")] + public partial class Foo : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// bar (default to "bar"). + public Foo(string bar = @"bar") + { + // use default value if no "bar" provided + this.Bar = bar ?? @"bar"; + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Foo {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Foo); + } + + /// + /// Returns true if Foo instances are equal + /// + /// Instance of Foo to be compared + /// Boolean + public bool Equals(Foo input) + { + if (input == null) + { + return false; + } + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs new file mode 100644 index 00000000000..31a7f3e21ff --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -0,0 +1,118 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// FooGetDefaultResponse + /// + [DataContract(Name = "_foo_get_default_response")] + public partial class FooGetDefaultResponse : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _string. + public FooGetDefaultResponse(Foo _string = default(Foo)) + { + this.String = _string; + } + + /// + /// Gets or Sets String + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public Foo String { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FooGetDefaultResponse {\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FooGetDefaultResponse); + } + + /// + /// Returns true if FooGetDefaultResponse instances are equal + /// + /// Instance of FooGetDefaultResponse to be compared + /// Boolean + public bool Equals(FooGetDefaultResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.String != null) + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FormatTest.cs new file mode 100644 index 00000000000..2883d3eb966 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FormatTest.cs @@ -0,0 +1,409 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// FormatTest + /// + [DataContract(Name = "format_test")] + public partial class FormatTest : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FormatTest() { } + /// + /// Initializes a new instance of the class. + /// + /// integer. + /// int32. + /// unsignedInteger. + /// int64. + /// unsignedLong. + /// number (required). + /// _float. + /// _double. + /// _decimal. + /// _string. + /// _byte (required). + /// binary. + /// date (required). + /// dateTime. + /// uuid. + /// password (required). + /// A string that is a 10 digit number. Can have leading zeros.. + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. + public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + { + this.Number = number; + // to ensure "_byte" is required (not null) + if (_byte == null) + { + throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null"); + } + this.Byte = _byte; + this.Date = date; + // to ensure "password" is required (not null) + if (password == null) + { + throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); + } + this.Password = password; + this.Integer = integer; + this.Int32 = int32; + this.UnsignedInteger = unsignedInteger; + this.Int64 = int64; + this.UnsignedLong = unsignedLong; + this.Float = _float; + this.Double = _double; + this.Decimal = _decimal; + this.String = _string; + this.Binary = binary; + this.DateTime = dateTime; + this.Uuid = uuid; + this.PatternWithDigits = patternWithDigits; + this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + /// + /// Gets or Sets Integer + /// + [DataMember(Name = "integer", EmitDefaultValue = false)] + public int Integer { get; set; } + + /// + /// Gets or Sets Int32 + /// + [DataMember(Name = "int32", EmitDefaultValue = false)] + public int Int32 { get; set; } + + /// + /// Gets or Sets UnsignedInteger + /// + [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] + public uint UnsignedInteger { get; set; } + + /// + /// Gets or Sets Int64 + /// + [DataMember(Name = "int64", EmitDefaultValue = false)] + public long Int64 { get; set; } + + /// + /// Gets or Sets UnsignedLong + /// + [DataMember(Name = "unsigned_long", EmitDefaultValue = false)] + public ulong UnsignedLong { get; set; } + + /// + /// Gets or Sets Number + /// + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] + public decimal Number { get; set; } + + /// + /// Gets or Sets Float + /// + [DataMember(Name = "float", EmitDefaultValue = false)] + public float Float { get; set; } + + /// + /// Gets or Sets Double + /// + [DataMember(Name = "double", EmitDefaultValue = false)] + public double Double { get; set; } + + /// + /// Gets or Sets Decimal + /// + [DataMember(Name = "decimal", EmitDefaultValue = false)] + public decimal Decimal { get; set; } + + /// + /// Gets or Sets String + /// + [DataMember(Name = "string", EmitDefaultValue = false)] + public string String { get; set; } + + /// + /// Gets or Sets Byte + /// + [DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = true)] + public byte[] Byte { get; set; } + + /// + /// Gets or Sets Binary + /// + [DataMember(Name = "binary", EmitDefaultValue = false)] + public System.IO.Stream Binary { get; set; } + + /// + /// Gets or Sets Date + /// + /// "Sun Feb 02 00:00:00 UTC 2020" + [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime Date { get; set; } + + /// + /// Gets or Sets DateTime + /// + /// "2007-12-03T10:15:30+01:00" + [DataMember(Name = "dateTime", EmitDefaultValue = false)] + public DateTime DateTime { get; set; } + + /// + /// Gets or Sets Uuid + /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", IsRequired = true, EmitDefaultValue = true)] + public string Password { get; set; } + + /// + /// A string that is a 10 digit number. Can have leading zeros. + /// + /// A string that is a 10 digit number. Can have leading zeros. + [DataMember(Name = "pattern_with_digits", EmitDefaultValue = false)] + public string PatternWithDigits { get; set; } + + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + /// + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + [DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)] + public string PatternWithDigitsAndDelimiter { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FormatTest {\n"); + sb.Append(" Integer: ").Append(Integer).Append("\n"); + sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); + sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" Decimal: ").Append(Decimal).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); + sb.Append(" Binary: ").Append(Binary).Append("\n"); + sb.Append(" Date: ").Append(Date).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); + sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FormatTest); + } + + /// + /// Returns true if FormatTest instances are equal + /// + /// Instance of FormatTest to be compared + /// Boolean + public bool Equals(FormatTest input) + { + if (input == null) + { + return false; + } + return + ( + this.Integer == input.Integer || + this.Integer.Equals(input.Integer) + ) && + ( + this.Int32 == input.Int32 || + this.Int32.Equals(input.Int32) + ) && + ( + this.UnsignedInteger == input.UnsignedInteger || + this.UnsignedInteger.Equals(input.UnsignedInteger) + ) && + ( + this.Int64 == input.Int64 || + this.Int64.Equals(input.Int64) + ) && + ( + this.UnsignedLong == input.UnsignedLong || + this.UnsignedLong.Equals(input.UnsignedLong) + ) && + ( + this.Number == input.Number || + this.Number.Equals(input.Number) + ) && + ( + this.Float == input.Float || + this.Float.Equals(input.Float) + ) && + ( + this.Double == input.Double || + this.Double.Equals(input.Double) + ) && + ( + this.Decimal == input.Decimal || + this.Decimal.Equals(input.Decimal) + ) && + ( + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) + ) && + ( + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) + ) && + ( + this.Binary == input.Binary || + (this.Binary != null && + this.Binary.Equals(input.Binary)) + ) && + ( + this.Date == input.Date || + (this.Date != null && + this.Date.Equals(input.Date)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.PatternWithDigits == input.PatternWithDigits || + (this.PatternWithDigits != null && + this.PatternWithDigits.Equals(input.PatternWithDigits)) + ) && + ( + this.PatternWithDigitsAndDelimiter == input.PatternWithDigitsAndDelimiter || + (this.PatternWithDigitsAndDelimiter != null && + this.PatternWithDigitsAndDelimiter.Equals(input.PatternWithDigitsAndDelimiter)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); + if (this.String != null) + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } + if (this.Byte != null) + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } + if (this.Binary != null) + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } + if (this.Date != null) + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } + if (this.DateTime != null) + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.PatternWithDigits != null) + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } + if (this.PatternWithDigitsAndDelimiter != null) + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Fruit.cs new file mode 100644 index 00000000000..f117d123d06 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Fruit.cs @@ -0,0 +1,283 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Fruit + /// + [JsonConverter(typeof(FruitJsonConverter))] + [DataContract(Name = "fruit")] + public partial class Fruit : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Apple. + public Fruit(Apple actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Banana. + public Fruit(Banana actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Apple)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Banana)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana"); + } + } + } + + /// + /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, + /// the InvalidClassException will be thrown + /// + /// An instance of Apple + public Apple GetApple() + { + return (Apple)this.ActualInstance; + } + + /// + /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, + /// the InvalidClassException will be thrown + /// + /// An instance of Banana + public Banana GetBanana() + { + return (Banana)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Fruit {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Fruit.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Fruit + /// + /// JSON string + /// An instance of Fruit + public static Fruit FromJson(string jsonString) + { + Fruit newFruit = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFruit; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Apple).GetProperty("AdditionalProperties") == null) + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.SerializerSettings)); + } + else + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Apple"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Banana).GetProperty("AdditionalProperties") == null) + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.SerializerSettings)); + } + else + { + newFruit = new Fruit(JsonConvert.DeserializeObject(jsonString, Fruit.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Banana"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newFruit; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Fruit); + } + + /// + /// Returns true if Fruit instances are equal + /// + /// Instance of Fruit to be compared + /// Boolean + public bool Equals(Fruit input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for Fruit + /// + public class FruitJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Fruit.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FruitReq.cs new file mode 100644 index 00000000000..3fdaa210c2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/FruitReq.cs @@ -0,0 +1,292 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// FruitReq + /// + [JsonConverter(typeof(FruitReqJsonConverter))] + [DataContract(Name = "fruitReq")] + public partial class FruitReq : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + public FruitReq() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of AppleReq. + public FruitReq(AppleReq actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of BananaReq. + public FruitReq(BananaReq actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(AppleReq)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(BananaReq)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: AppleReq, BananaReq"); + } + } + } + + /// + /// Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, + /// the InvalidClassException will be thrown + /// + /// An instance of AppleReq + public AppleReq GetAppleReq() + { + return (AppleReq)this.ActualInstance; + } + + /// + /// Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, + /// the InvalidClassException will be thrown + /// + /// An instance of BananaReq + public BananaReq GetBananaReq() + { + return (BananaReq)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FruitReq {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, FruitReq.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of FruitReq + /// + /// JSON string + /// An instance of FruitReq + public static FruitReq FromJson(string jsonString) + { + FruitReq newFruitReq = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newFruitReq; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(AppleReq).GetProperty("AdditionalProperties") == null) + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.SerializerSettings)); + } + else + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("AppleReq"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AppleReq: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(BananaReq).GetProperty("AdditionalProperties") == null) + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.SerializerSettings)); + } + else + { + newFruitReq = new FruitReq(JsonConvert.DeserializeObject(jsonString, FruitReq.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("BananaReq"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BananaReq: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newFruitReq; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FruitReq); + } + + /// + /// Returns true if FruitReq instances are equal + /// + /// Instance of FruitReq to be compared + /// Boolean + public bool Equals(FruitReq input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for FruitReq + /// + public class FruitReqJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return FruitReq.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/GmFruit.cs new file mode 100644 index 00000000000..1f9ed867e0a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/GmFruit.cs @@ -0,0 +1,256 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// GmFruit + /// + [JsonConverter(typeof(GmFruitJsonConverter))] + [DataContract(Name = "gmFruit")] + public partial class GmFruit : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Apple. + public GmFruit(Apple actualInstance) + { + this.IsNullable = false; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Banana. + public GmFruit(Banana actualInstance) + { + this.IsNullable = false; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Apple)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Banana)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana"); + } + } + } + + /// + /// Get the actual instance of `Apple`. If the actual instance is not `Apple`, + /// the InvalidClassException will be thrown + /// + /// An instance of Apple + public Apple GetApple() + { + return (Apple)this.ActualInstance; + } + + /// + /// Get the actual instance of `Banana`. If the actual instance is not `Banana`, + /// the InvalidClassException will be thrown + /// + /// An instance of Banana + public Banana GetBanana() + { + return (Banana)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class GmFruit {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of GmFruit + /// + /// JSON string + /// An instance of GmFruit + public static GmFruit FromJson(string jsonString) + { + GmFruit newGmFruit = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newGmFruit; + } + + try + { + newGmFruit = new GmFruit(JsonConvert.DeserializeObject(jsonString, GmFruit.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newGmFruit; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString())); + } + + try + { + newGmFruit = new GmFruit(JsonConvert.DeserializeObject(jsonString, GmFruit.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return newGmFruit; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString())); + } + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as GmFruit); + } + + /// + /// Returns true if GmFruit instances are equal + /// + /// Instance of GmFruit to be compared + /// Boolean + public bool Equals(GmFruit input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for GmFruit + /// + public class GmFruitJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return GmFruit.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/GrandparentAnimal.cs new file mode 100644 index 00000000000..0d7469e833e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -0,0 +1,128 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// GrandparentAnimal + /// + [DataContract(Name = "GrandparentAnimal")] + public partial class GrandparentAnimal : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected GrandparentAnimal() { } + /// + /// Initializes a new instance of the class. + /// + /// petType (required). + public GrandparentAnimal(string petType = default(string)) + { + // to ensure "petType" is required (not null) + if (petType == null) + { + throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null"); + } + this.PetType = petType; + } + + /// + /// Gets or Sets PetType + /// + [DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = true)] + public string PetType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GrandparentAnimal {\n"); + sb.Append(" PetType: ").Append(PetType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as GrandparentAnimal); + } + + /// + /// Returns true if GrandparentAnimal instances are equal + /// + /// Instance of GrandparentAnimal to be compared + /// Boolean + public bool Equals(GrandparentAnimal input) + { + if (input == null) + { + return false; + } + return + ( + this.PetType == input.PetType || + (this.PetType != null && + this.PetType.Equals(input.PetType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PetType != null) + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs new file mode 100644 index 00000000000..a154d4ab7b5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -0,0 +1,149 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// HasOnlyReadOnly + /// + [DataContract(Name = "hasOnlyReadOnly")] + public partial class HasOnlyReadOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public HasOnlyReadOnly() + { + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; private set; } + + /// + /// Returns false as Bar should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBar() + { + return false; + } + /// + /// Gets or Sets Foo + /// + [DataMember(Name = "foo", EmitDefaultValue = false)] + public string Foo { get; private set; } + + /// + /// Returns false as Foo should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeFoo() + { + return false; + } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HasOnlyReadOnly {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Foo: ").Append(Foo).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as HasOnlyReadOnly); + } + + /// + /// Returns true if HasOnlyReadOnly instances are equal + /// + /// Instance of HasOnlyReadOnly to be compared + /// Boolean + public bool Equals(HasOnlyReadOnly input) + { + if (input == null) + { + return false; + } + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ) && + ( + this.Foo == input.Foo || + (this.Foo != null && + this.Foo.Equals(input.Foo)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.Foo != null) + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/HealthCheckResult.cs new file mode 100644 index 00000000000..ddd6e7c6d5c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -0,0 +1,118 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + /// + [DataContract(Name = "HealthCheckResult")] + public partial class HealthCheckResult : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// nullableMessage. + public HealthCheckResult(string nullableMessage = default(string)) + { + this.NullableMessage = nullableMessage; + } + + /// + /// Gets or Sets NullableMessage + /// + [DataMember(Name = "NullableMessage", EmitDefaultValue = true)] + public string NullableMessage { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class HealthCheckResult {\n"); + sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as HealthCheckResult); + } + + /// + /// Returns true if HealthCheckResult instances are equal + /// + /// Instance of HealthCheckResult to be compared + /// Boolean + public bool Equals(HealthCheckResult input) + { + if (input == null) + { + return false; + } + return + ( + this.NullableMessage == input.NullableMessage || + (this.NullableMessage != null && + this.NullableMessage.Equals(input.NullableMessage)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.NullableMessage != null) + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs new file mode 100644 index 00000000000..0fa5290263f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -0,0 +1,151 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// IsoscelesTriangle + /// + [DataContract(Name = "IsoscelesTriangle")] + public partial class IsoscelesTriangle : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected IsoscelesTriangle() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public IsoscelesTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) + { + throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) + { + throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null"); + } + this.TriangleType = triangleType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = true)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = true)] + public string TriangleType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class IsoscelesTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as IsoscelesTriangle); + } + + /// + /// Returns true if IsoscelesTriangle instances are equal + /// + /// Instance of IsoscelesTriangle to be compared + /// Boolean + public bool Equals(IsoscelesTriangle input) + { + if (input == null) + { + return false; + } + return + ( + this.ShapeType == input.ShapeType || + (this.ShapeType != null && + this.ShapeType.Equals(input.ShapeType)) + ) && + ( + this.TriangleType == input.TriangleType || + (this.TriangleType != null && + this.TriangleType.Equals(input.TriangleType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/List.cs new file mode 100644 index 00000000000..f658a74fe2a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/List.cs @@ -0,0 +1,118 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// List + /// + [DataContract(Name = "List")] + public partial class List : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _123list. + public List(string _123list = default(string)) + { + this._123List = _123list; + } + + /// + /// Gets or Sets _123List + /// + [DataMember(Name = "123-list", EmitDefaultValue = false)] + public string _123List { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class List {\n"); + sb.Append(" _123List: ").Append(_123List).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as List); + } + + /// + /// Returns true if List instances are equal + /// + /// Instance of List to be compared + /// Boolean + public bool Equals(List input) + { + if (input == null) + { + return false; + } + return + ( + this._123List == input._123List || + (this._123List != null && + this._123List.Equals(input._123List)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._123List != null) + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..fdca36d43a8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,138 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + [DataContract(Name = "LiteralStringClass")] + public partial class LiteralStringClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username"). + /// unescapedLiteralString (default to "C:\Users\username"). + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + // use default value if no "escapedLiteralString" provided + this.EscapedLiteralString = escapedLiteralString ?? @"C:\\Users\\username"; + // use default value if no "unescapedLiteralString" provided + this.UnescapedLiteralString = unescapedLiteralString ?? @"C:\Users\username"; + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [DataMember(Name = "escapedLiteralString", EmitDefaultValue = false)] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [DataMember(Name = "unescapedLiteralString", EmitDefaultValue = false)] + public string UnescapedLiteralString { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as LiteralStringClass); + } + + /// + /// Returns true if LiteralStringClass instances are equal + /// + /// Instance of LiteralStringClass to be compared + /// Boolean + public bool Equals(LiteralStringClass input) + { + if (input == null) + { + return false; + } + return + ( + this.EscapedLiteralString == input.EscapedLiteralString || + (this.EscapedLiteralString != null && + this.EscapedLiteralString.Equals(input.EscapedLiteralString)) + ) && + ( + this.UnescapedLiteralString == input.UnescapedLiteralString || + (this.UnescapedLiteralString != null && + this.UnescapedLiteralString.Equals(input.UnescapedLiteralString)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EscapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.EscapedLiteralString.GetHashCode(); + } + if (this.UnescapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.UnescapedLiteralString.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Mammal.cs new file mode 100644 index 00000000000..07489337fb2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Mammal.cs @@ -0,0 +1,329 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Mammal + /// + [JsonConverter(typeof(MammalJsonConverter))] + [DataContract(Name = "mammal")] + public partial class Mammal : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Whale. + public Mammal(Whale actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Zebra. + public Mammal(Zebra actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Pig. + public Mammal(Pig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Pig)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Whale)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Zebra)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Pig, Whale, Zebra"); + } + } + } + + /// + /// Get the actual instance of `Whale`. If the actual instance is not `Whale`, + /// the InvalidClassException will be thrown + /// + /// An instance of Whale + public Whale GetWhale() + { + return (Whale)this.ActualInstance; + } + + /// + /// Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + /// the InvalidClassException will be thrown + /// + /// An instance of Zebra + public Zebra GetZebra() + { + return (Zebra)this.ActualInstance; + } + + /// + /// Get the actual instance of `Pig`. If the actual instance is not `Pig`, + /// the InvalidClassException will be thrown + /// + /// An instance of Pig + public Pig GetPig() + { + return (Pig)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Mammal {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Mammal.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Mammal + /// + /// JSON string + /// An instance of Mammal + public static Mammal FromJson(string jsonString) + { + Mammal newMammal = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newMammal; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Pig).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Pig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Pig: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Whale).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Whale"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Whale: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Zebra).GetProperty("AdditionalProperties") == null) + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.SerializerSettings)); + } + else + { + newMammal = new Mammal(JsonConvert.DeserializeObject(jsonString, Mammal.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Zebra"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Zebra: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newMammal; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Mammal); + } + + /// + /// Returns true if Mammal instances are equal + /// + /// Instance of Mammal to be compared + /// Boolean + public bool Equals(Mammal input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for Mammal + /// + public class MammalJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Mammal.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/MapTest.cs new file mode 100644 index 00000000000..4154423f34d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/MapTest.cs @@ -0,0 +1,196 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// MapTest + /// + [DataContract(Name = "MapTest")] + public partial class MapTest : IEquatable + { + /// + /// Defines Inner + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum InnerEnum + { + /// + /// Enum UPPER for value: UPPER + /// + [EnumMember(Value = "UPPER")] + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + [EnumMember(Value = "lower")] + Lower = 2 + + } + + /// + /// Initializes a new instance of the class. + /// + /// mapMapOfString. + /// mapOfEnumString. + /// directMap. + /// indirectMap. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + { + this.MapMapOfString = mapMapOfString; + this.MapOfEnumString = mapOfEnumString; + this.DirectMap = directMap; + this.IndirectMap = indirectMap; + } + + /// + /// Gets or Sets MapMapOfString + /// + [DataMember(Name = "map_map_of_string", EmitDefaultValue = false)] + public Dictionary> MapMapOfString { get; set; } + + /// + /// Gets or Sets MapOfEnumString + /// + [DataMember(Name = "map_of_enum_string", EmitDefaultValue = false)] + public Dictionary MapOfEnumString { get; set; } + + /// + /// Gets or Sets DirectMap + /// + [DataMember(Name = "direct_map", EmitDefaultValue = false)] + public Dictionary DirectMap { get; set; } + + /// + /// Gets or Sets IndirectMap + /// + [DataMember(Name = "indirect_map", EmitDefaultValue = false)] + public Dictionary IndirectMap { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MapTest {\n"); + sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); + sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MapTest); + } + + /// + /// Returns true if MapTest instances are equal + /// + /// Instance of MapTest to be compared + /// Boolean + public bool Equals(MapTest input) + { + if (input == null) + { + return false; + } + return + ( + this.MapMapOfString == input.MapMapOfString || + this.MapMapOfString != null && + input.MapMapOfString != null && + this.MapMapOfString.SequenceEqual(input.MapMapOfString) + ) && + ( + this.MapOfEnumString == input.MapOfEnumString || + this.MapOfEnumString != null && + input.MapOfEnumString != null && + this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) + ) && + ( + this.DirectMap == input.DirectMap || + this.DirectMap != null && + input.DirectMap != null && + this.DirectMap.SequenceEqual(input.DirectMap) + ) && + ( + this.IndirectMap == input.IndirectMap || + this.IndirectMap != null && + input.IndirectMap != null && + this.IndirectMap.SequenceEqual(input.IndirectMap) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MapMapOfString != null) + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + if (this.MapOfEnumString != null) + { + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); + } + if (this.DirectMap != null) + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } + if (this.IndirectMap != null) + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs new file mode 100644 index 00000000000..521d350a9ce --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -0,0 +1,173 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixedPropertiesAndAdditionalPropertiesClass + /// + [DataContract(Name = "MixedPropertiesAndAdditionalPropertiesClass")] + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// uuidWithPattern. + /// uuid. + /// dateTime. + /// map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + { + this.UuidWithPattern = uuidWithPattern; + this.Uuid = uuid; + this.DateTime = dateTime; + this.Map = map; + } + + /// + /// Gets or Sets UuidWithPattern + /// + [DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)] + public Guid UuidWithPattern { get; set; } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public Guid Uuid { get; set; } + + /// + /// Gets or Sets DateTime + /// + [DataMember(Name = "dateTime", EmitDefaultValue = false)] + public DateTime DateTime { get; set; } + + /// + /// Gets or Sets Map + /// + [DataMember(Name = "map", EmitDefaultValue = false)] + public Dictionary Map { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MixedPropertiesAndAdditionalPropertiesClass); + } + + /// + /// Returns true if MixedPropertiesAndAdditionalPropertiesClass instances are equal + /// + /// Instance of MixedPropertiesAndAdditionalPropertiesClass to be compared + /// Boolean + public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) + { + if (input == null) + { + return false; + } + return + ( + this.UuidWithPattern == input.UuidWithPattern || + (this.UuidWithPattern != null && + this.UuidWithPattern.Equals(input.UuidWithPattern)) + ) && + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.DateTime == input.DateTime || + (this.DateTime != null && + this.DateTime.Equals(input.DateTime)) + ) && + ( + this.Map == input.Map || + this.Map != null && + input.Map != null && + this.Map.SequenceEqual(input.Map) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.UuidWithPattern != null) + { + hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode(); + } + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + if (this.DateTime != null) + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } + if (this.Map != null) + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Model200Response.cs new file mode 100644 index 00000000000..004448f603b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Model200Response.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model name starting with number + /// + [DataContract(Name = "200_response")] + public partial class Model200Response : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// _class. + public Model200Response(int name = default(int), string _class = default(string)) + { + this.Name = name; + this.Class = _class; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public int Name { get; set; } + + /// + /// Gets or Sets Class + /// + [DataMember(Name = "class", EmitDefaultValue = false)] + public string Class { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Model200Response {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Model200Response); + } + + /// + /// Returns true if Model200Response instances are equal + /// + /// Instance of Model200Response to be compared + /// Boolean + public bool Equals(Model200Response input) + { + if (input == null) + { + return false; + } + return + ( + this.Name == input.Name || + this.Name.Equals(input.Name) + ) && + ( + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + if (this.Class != null) + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ModelClient.cs new file mode 100644 index 00000000000..440c0f8b21f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ModelClient.cs @@ -0,0 +1,118 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ModelClient + /// + [DataContract(Name = "_Client")] + public partial class ModelClient : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _client. + public ModelClient(string _client = default(string)) + { + this._Client = _client; + } + + /// + /// Gets or Sets _Client + /// + [DataMember(Name = "client", EmitDefaultValue = false)] + public string _Client { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ModelClient {\n"); + sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ModelClient); + } + + /// + /// Returns true if ModelClient instances are equal + /// + /// Instance of ModelClient to be compared + /// Boolean + public bool Equals(ModelClient input) + { + if (input == null) + { + return false; + } + return + ( + this._Client == input._Client || + (this._Client != null && + this._Client.Equals(input._Client)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Client != null) + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Name.cs new file mode 100644 index 00000000000..a271f1d233d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Name.cs @@ -0,0 +1,177 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing model name same as property name + /// + [DataContract(Name = "Name")] + public partial class Name : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Name() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// property. + public Name(int name = default(int), string property = default(string)) + { + this._Name = name; + this.Property = property; + } + + /// + /// Gets or Sets _Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public int _Name { get; set; } + + /// + /// Gets or Sets SnakeCase + /// + [DataMember(Name = "snake_case", EmitDefaultValue = false)] + public int SnakeCase { get; private set; } + + /// + /// Returns false as SnakeCase should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeSnakeCase() + { + return false; + } + /// + /// Gets or Sets Property + /// + [DataMember(Name = "property", EmitDefaultValue = false)] + public string Property { get; set; } + + /// + /// Gets or Sets _123Number + /// + [DataMember(Name = "123Number", EmitDefaultValue = false)] + public int _123Number { get; private set; } + + /// + /// Returns false as _123Number should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize_123Number() + { + return false; + } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Name {\n"); + sb.Append(" _Name: ").Append(_Name).Append("\n"); + sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); + sb.Append(" Property: ").Append(Property).Append("\n"); + sb.Append(" _123Number: ").Append(_123Number).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Name); + } + + /// + /// Returns true if Name instances are equal + /// + /// Instance of Name to be compared + /// Boolean + public bool Equals(Name input) + { + if (input == null) + { + return false; + } + return + ( + this._Name == input._Name || + this._Name.Equals(input._Name) + ) && + ( + this.SnakeCase == input.SnakeCase || + this.SnakeCase.Equals(input.SnakeCase) + ) && + ( + this.Property == input.Property || + (this.Property != null && + this.Property.Equals(input.Property)) + ) && + ( + this._123Number == input._123Number || + this._123Number.Equals(input._123Number) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); + if (this.Property != null) + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableClass.cs new file mode 100644 index 00000000000..a6c79e5460a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableClass.cs @@ -0,0 +1,324 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// NullableClass + /// + [DataContract(Name = "NullableClass")] + public partial class NullableClass : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// integerProp. + /// numberProp. + /// booleanProp. + /// stringProp. + /// dateProp. + /// datetimeProp. + /// arrayNullableProp. + /// arrayAndItemsNullableProp. + /// arrayItemsNullable. + /// objectNullableProp. + /// objectAndItemsNullableProp. + /// objectItemsNullable. + public NullableClass(int? integerProp = default(int?), decimal? numberProp = default(decimal?), bool? booleanProp = default(bool?), string stringProp = default(string), DateTime? dateProp = default(DateTime?), DateTime? datetimeProp = default(DateTime?), List arrayNullableProp = default(List), List arrayAndItemsNullableProp = default(List), List arrayItemsNullable = default(List), Dictionary objectNullableProp = default(Dictionary), Dictionary objectAndItemsNullableProp = default(Dictionary), Dictionary objectItemsNullable = default(Dictionary)) : base() + { + this.IntegerProp = integerProp; + this.NumberProp = numberProp; + this.BooleanProp = booleanProp; + this.StringProp = stringProp; + this.DateProp = dateProp; + this.DatetimeProp = datetimeProp; + this.ArrayNullableProp = arrayNullableProp; + this.ArrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.ArrayItemsNullable = arrayItemsNullable; + this.ObjectNullableProp = objectNullableProp; + this.ObjectAndItemsNullableProp = objectAndItemsNullableProp; + this.ObjectItemsNullable = objectItemsNullable; + } + + /// + /// Gets or Sets IntegerProp + /// + [DataMember(Name = "integer_prop", EmitDefaultValue = true)] + public int? IntegerProp { get; set; } + + /// + /// Gets or Sets NumberProp + /// + [DataMember(Name = "number_prop", EmitDefaultValue = true)] + public decimal? NumberProp { get; set; } + + /// + /// Gets or Sets BooleanProp + /// + [DataMember(Name = "boolean_prop", EmitDefaultValue = true)] + public bool? BooleanProp { get; set; } + + /// + /// Gets or Sets StringProp + /// + [DataMember(Name = "string_prop", EmitDefaultValue = true)] + public string StringProp { get; set; } + + /// + /// Gets or Sets DateProp + /// + [DataMember(Name = "date_prop", EmitDefaultValue = true)] + [JsonConverter(typeof(OpenAPIDateConverter))] + public DateTime? DateProp { get; set; } + + /// + /// Gets or Sets DatetimeProp + /// + [DataMember(Name = "datetime_prop", EmitDefaultValue = true)] + public DateTime? DatetimeProp { get; set; } + + /// + /// Gets or Sets ArrayNullableProp + /// + [DataMember(Name = "array_nullable_prop", EmitDefaultValue = true)] + public List ArrayNullableProp { get; set; } + + /// + /// Gets or Sets ArrayAndItemsNullableProp + /// + [DataMember(Name = "array_and_items_nullable_prop", EmitDefaultValue = true)] + public List ArrayAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ArrayItemsNullable + /// + [DataMember(Name = "array_items_nullable", EmitDefaultValue = false)] + public List ArrayItemsNullable { get; set; } + + /// + /// Gets or Sets ObjectNullableProp + /// + [DataMember(Name = "object_nullable_prop", EmitDefaultValue = true)] + public Dictionary ObjectNullableProp { get; set; } + + /// + /// Gets or Sets ObjectAndItemsNullableProp + /// + [DataMember(Name = "object_and_items_nullable_prop", EmitDefaultValue = true)] + public Dictionary ObjectAndItemsNullableProp { get; set; } + + /// + /// Gets or Sets ObjectItemsNullable + /// + [DataMember(Name = "object_items_nullable", EmitDefaultValue = false)] + public Dictionary ObjectItemsNullable { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NullableClass {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); + sb.Append(" NumberProp: ").Append(NumberProp).Append("\n"); + sb.Append(" BooleanProp: ").Append(BooleanProp).Append("\n"); + sb.Append(" StringProp: ").Append(StringProp).Append("\n"); + sb.Append(" DateProp: ").Append(DateProp).Append("\n"); + sb.Append(" DatetimeProp: ").Append(DatetimeProp).Append("\n"); + sb.Append(" ArrayNullableProp: ").Append(ArrayNullableProp).Append("\n"); + sb.Append(" ArrayAndItemsNullableProp: ").Append(ArrayAndItemsNullableProp).Append("\n"); + sb.Append(" ArrayItemsNullable: ").Append(ArrayItemsNullable).Append("\n"); + sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n"); + sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n"); + sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NullableClass); + } + + /// + /// Returns true if NullableClass instances are equal + /// + /// Instance of NullableClass to be compared + /// Boolean + public bool Equals(NullableClass input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.IntegerProp == input.IntegerProp || + (this.IntegerProp != null && + this.IntegerProp.Equals(input.IntegerProp)) + ) && base.Equals(input) && + ( + this.NumberProp == input.NumberProp || + (this.NumberProp != null && + this.NumberProp.Equals(input.NumberProp)) + ) && base.Equals(input) && + ( + this.BooleanProp == input.BooleanProp || + (this.BooleanProp != null && + this.BooleanProp.Equals(input.BooleanProp)) + ) && base.Equals(input) && + ( + this.StringProp == input.StringProp || + (this.StringProp != null && + this.StringProp.Equals(input.StringProp)) + ) && base.Equals(input) && + ( + this.DateProp == input.DateProp || + (this.DateProp != null && + this.DateProp.Equals(input.DateProp)) + ) && base.Equals(input) && + ( + this.DatetimeProp == input.DatetimeProp || + (this.DatetimeProp != null && + this.DatetimeProp.Equals(input.DatetimeProp)) + ) && base.Equals(input) && + ( + this.ArrayNullableProp == input.ArrayNullableProp || + this.ArrayNullableProp != null && + input.ArrayNullableProp != null && + this.ArrayNullableProp.SequenceEqual(input.ArrayNullableProp) + ) && base.Equals(input) && + ( + this.ArrayAndItemsNullableProp == input.ArrayAndItemsNullableProp || + this.ArrayAndItemsNullableProp != null && + input.ArrayAndItemsNullableProp != null && + this.ArrayAndItemsNullableProp.SequenceEqual(input.ArrayAndItemsNullableProp) + ) && base.Equals(input) && + ( + this.ArrayItemsNullable == input.ArrayItemsNullable || + this.ArrayItemsNullable != null && + input.ArrayItemsNullable != null && + this.ArrayItemsNullable.SequenceEqual(input.ArrayItemsNullable) + ) && base.Equals(input) && + ( + this.ObjectNullableProp == input.ObjectNullableProp || + this.ObjectNullableProp != null && + input.ObjectNullableProp != null && + this.ObjectNullableProp.SequenceEqual(input.ObjectNullableProp) + ) && base.Equals(input) && + ( + this.ObjectAndItemsNullableProp == input.ObjectAndItemsNullableProp || + this.ObjectAndItemsNullableProp != null && + input.ObjectAndItemsNullableProp != null && + this.ObjectAndItemsNullableProp.SequenceEqual(input.ObjectAndItemsNullableProp) + ) && base.Equals(input) && + ( + this.ObjectItemsNullable == input.ObjectItemsNullable || + this.ObjectItemsNullable != null && + input.ObjectItemsNullable != null && + this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.IntegerProp != null) + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } + if (this.NumberProp != null) + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } + if (this.BooleanProp != null) + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } + if (this.StringProp != null) + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } + if (this.DateProp != null) + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } + if (this.DatetimeProp != null) + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } + if (this.ArrayNullableProp != null) + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } + if (this.ArrayAndItemsNullableProp != null) + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } + if (this.ArrayItemsNullable != null) + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } + if (this.ObjectNullableProp != null) + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } + if (this.ObjectAndItemsNullableProp != null) + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } + if (this.ObjectItemsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableGuidClass.cs new file mode 100644 index 00000000000..2c66ada9a4f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// NullableGuidClass + /// + [DataContract(Name = "NullableGuidClass")] + public partial class NullableGuidClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + public NullableGuidClass(Guid? uuid = default(Guid?)) + { + this.Uuid = uuid; + } + + /// + /// Gets or Sets Uuid + /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" + [DataMember(Name = "uuid", EmitDefaultValue = true)] + public Guid? Uuid { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NullableGuidClass {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NullableGuidClass); + } + + /// + /// Returns true if NullableGuidClass instances are equal + /// + /// Instance of NullableGuidClass to be compared + /// Boolean + public bool Equals(NullableGuidClass input) + { + if (input == null) + { + return false; + } + return + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableShape.cs new file mode 100644 index 00000000000..5a83dcdc26d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NullableShape.cs @@ -0,0 +1,292 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + /// + [JsonConverter(typeof(NullableShapeJsonConverter))] + [DataContract(Name = "NullableShape")] + public partial class NullableShape : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + public NullableShape() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public NullableShape(Triangle actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public NullableShape(Quadrilateral actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class NullableShape {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, NullableShape.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of NullableShape + /// + /// JSON string + /// An instance of NullableShape + public static NullableShape FromJson(string jsonString) + { + NullableShape newNullableShape = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newNullableShape; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.SerializerSettings)); + } + else + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.SerializerSettings)); + } + else + { + newNullableShape = new NullableShape(JsonConvert.DeserializeObject(jsonString, NullableShape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newNullableShape; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NullableShape); + } + + /// + /// Returns true if NullableShape instances are equal + /// + /// Instance of NullableShape to be compared + /// Boolean + public bool Equals(NullableShape input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for NullableShape + /// + public class NullableShapeJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(NullableShape).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return NullableShape.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NumberOnly.cs new file mode 100644 index 00000000000..3230dcc9193 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -0,0 +1,117 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.InteropServices; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// NumberOnly + /// + [CLSCompliant(true)] + [ComVisible(true)] + [DataContract(Name = "NumberOnly")] + public partial class NumberOnly : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// justNumber. + public NumberOnly(decimal justNumber = default(decimal)) + { + this.JustNumber = justNumber; + } + + /// + /// Gets or Sets JustNumber + /// + [DataMember(Name = "JustNumber", EmitDefaultValue = false)] + public decimal JustNumber { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NumberOnly {\n"); + sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NumberOnly); + } + + /// + /// Returns true if NumberOnly instances are equal + /// + /// Instance of NumberOnly to be compared + /// Boolean + public bool Equals(NumberOnly input) + { + if (input == null) + { + return false; + } + return + ( + this.JustNumber == input.JustNumber || + this.JustNumber.Equals(input.JustNumber) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs new file mode 100644 index 00000000000..05bb2ca8de6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -0,0 +1,172 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ObjectWithDeprecatedFields + /// + [DataContract(Name = "ObjectWithDeprecatedFields")] + public partial class ObjectWithDeprecatedFields : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// uuid. + /// id. + /// deprecatedRef. + /// bars. + public ObjectWithDeprecatedFields(string uuid = default(string), decimal id = default(decimal), DeprecatedObject deprecatedRef = default(DeprecatedObject), List bars = default(List)) + { + this.Uuid = uuid; + this.Id = id; + this.DeprecatedRef = deprecatedRef; + this.Bars = bars; + } + + /// + /// Gets or Sets Uuid + /// + [DataMember(Name = "uuid", EmitDefaultValue = false)] + public string Uuid { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + [Obsolete] + public decimal Id { get; set; } + + /// + /// Gets or Sets DeprecatedRef + /// + [DataMember(Name = "deprecatedRef", EmitDefaultValue = false)] + [Obsolete] + public DeprecatedObject DeprecatedRef { get; set; } + + /// + /// Gets or Sets Bars + /// + [DataMember(Name = "bars", EmitDefaultValue = false)] + [Obsolete] + public List Bars { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ObjectWithDeprecatedFields {\n"); + sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" DeprecatedRef: ").Append(DeprecatedRef).Append("\n"); + sb.Append(" Bars: ").Append(Bars).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ObjectWithDeprecatedFields); + } + + /// + /// Returns true if ObjectWithDeprecatedFields instances are equal + /// + /// Instance of ObjectWithDeprecatedFields to be compared + /// Boolean + public bool Equals(ObjectWithDeprecatedFields input) + { + if (input == null) + { + return false; + } + return + ( + this.Uuid == input.Uuid || + (this.Uuid != null && + this.Uuid.Equals(input.Uuid)) + ) && + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.DeprecatedRef == input.DeprecatedRef || + (this.DeprecatedRef != null && + this.DeprecatedRef.Equals(input.DeprecatedRef)) + ) && + ( + this.Bars == input.Bars || + this.Bars != null && + input.Bars != null && + this.Bars.SequenceEqual(input.Bars) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Uuid != null) + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.DeprecatedRef != null) + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } + if (this.Bars != null) + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Order.cs new file mode 100644 index 00000000000..d7c71132724 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Order.cs @@ -0,0 +1,217 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Order + /// + [DataContract(Name = "Order")] + public partial class Order : IEquatable + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + this.Complete = complete; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name = "petId", EmitDefaultValue = false)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name = "quantity", EmitDefaultValue = false)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + /// "2020-02-02T20:20:20.000222Z" + [DataMember(Name = "shipDate", EmitDefaultValue = false)] + public DateTime ShipDate { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name = "complete", EmitDefaultValue = true)] + public bool Complete { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Order); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.PetId == input.PetId || + this.PetId.Equals(input.PetId) + ) && + ( + this.Quantity == input.Quantity || + this.Quantity.Equals(input.Quantity) + ) && + ( + this.ShipDate == input.ShipDate || + (this.ShipDate != null && + this.ShipDate.Equals(input.ShipDate)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ) && + ( + this.Complete == input.Complete || + this.Complete.Equals(input.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterComposite.cs new file mode 100644 index 00000000000..56abf796947 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -0,0 +1,146 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// OuterComposite + /// + [DataContract(Name = "OuterComposite")] + public partial class OuterComposite : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// myNumber. + /// myString. + /// myBoolean. + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) + { + this.MyNumber = myNumber; + this.MyString = myString; + this.MyBoolean = myBoolean; + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name = "my_number", EmitDefaultValue = false)] + public decimal MyNumber { get; set; } + + /// + /// Gets or Sets MyString + /// + [DataMember(Name = "my_string", EmitDefaultValue = false)] + public string MyString { get; set; } + + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name = "my_boolean", EmitDefaultValue = true)] + public bool MyBoolean { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as OuterComposite); + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite input) + { + if (input == null) + { + return false; + } + return + ( + this.MyNumber == input.MyNumber || + this.MyNumber.Equals(input.MyNumber) + ) && + ( + this.MyString == input.MyString || + (this.MyString != null && + this.MyString.Equals(input.MyString)) + ) && + ( + this.MyBoolean == input.MyBoolean || + this.MyBoolean.Equals(input.MyBoolean) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); + if (this.MyString != null) + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnum.cs new file mode 100644 index 00000000000..d7a78655975 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -0,0 +1,53 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OuterEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs new file mode 100644 index 00000000000..85ed3c06c28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumDefaultValue.cs @@ -0,0 +1,53 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumDefaultValue + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OuterEnumDefaultValue + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumInteger.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumInteger.cs new file mode 100644 index 00000000000..992a3ee78ec --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumInteger.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumInteger + /// + public enum OuterEnumInteger + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs new file mode 100644 index 00000000000..9d2e0c2c255 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/OuterEnumIntegerDefaultValue.cs @@ -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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Defines OuterEnumIntegerDefaultValue + /// + public enum OuterEnumIntegerDefaultValue + { + /// + /// Enum NUMBER_0 for value: 0 + /// + NUMBER_0 = 0, + + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ParentPet.cs new file mode 100644 index 00000000000..3ab62d6dbff --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ParentPet.cs @@ -0,0 +1,107 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ParentPet + /// + [DataContract(Name = "ParentPet")] + public partial class ParentPet : GrandparentAnimal, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ParentPet() { } + /// + /// Initializes a new instance of the class. + /// + /// petType (required) (default to "ParentPet"). + public ParentPet(string petType = @"ParentPet") : base(petType) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ParentPet {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ParentPet); + } + + /// + /// Returns true if ParentPet instances are equal + /// + /// Instance of ParentPet to be compared + /// Boolean + public bool Equals(ParentPet input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Pet.cs new file mode 100644 index 00000000000..ad73736202c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Pet.cs @@ -0,0 +1,246 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pet + /// + [DataContract(Name = "Pet")] + public partial class Pet : IEquatable + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + + } + + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() { } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + } + this.Name = name; + // to ensure "photoUrls" is required (not null) + if (photoUrls == null) + { + throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + } + this.PhotoUrls = photoUrls; + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + /// "doggie" + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = true)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Pet); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.Category == input.Category || + (this.Category != null && + this.Category.Equals(input.Category)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PhotoUrls == input.PhotoUrls || + this.PhotoUrls != null && + input.PhotoUrls != null && + this.PhotoUrls.SequenceEqual(input.PhotoUrls) + ) && + ( + this.Tags == input.Tags || + this.Tags != null && + input.Tags != null && + this.Tags.SequenceEqual(input.Tags) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Category != null) + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + if (this.PhotoUrls != null) + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } + if (this.Tags != null) + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Pig.cs new file mode 100644 index 00000000000..8cbe04cce1c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Pig.cs @@ -0,0 +1,283 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Pig + /// + [JsonConverter(typeof(PigJsonConverter))] + [DataContract(Name = "Pig")] + public partial class Pig : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of BasquePig. + public Pig(BasquePig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of DanishPig. + public Pig(DanishPig actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(BasquePig)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(DanishPig)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: BasquePig, DanishPig"); + } + } + } + + /// + /// Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, + /// the InvalidClassException will be thrown + /// + /// An instance of BasquePig + public BasquePig GetBasquePig() + { + return (BasquePig)this.ActualInstance; + } + + /// + /// Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, + /// the InvalidClassException will be thrown + /// + /// An instance of DanishPig + public DanishPig GetDanishPig() + { + return (DanishPig)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pig {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Pig.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Pig + /// + /// JSON string + /// An instance of Pig + public static Pig FromJson(string jsonString) + { + Pig newPig = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newPig; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(BasquePig).GetProperty("AdditionalProperties") == null) + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.SerializerSettings)); + } + else + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("BasquePig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BasquePig: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(DanishPig).GetProperty("AdditionalProperties") == null) + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.SerializerSettings)); + } + else + { + newPig = new Pig(JsonConvert.DeserializeObject(jsonString, Pig.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("DanishPig"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into DanishPig: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newPig; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Pig); + } + + /// + /// Returns true if Pig instances are equal + /// + /// Instance of Pig to be compared + /// Boolean + public bool Equals(Pig input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for Pig + /// + public class PigJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Pig).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Pig.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/PolymorphicProperty.cs new file mode 100644 index 00000000000..4797a5bec81 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -0,0 +1,375 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// PolymorphicProperty + /// + [JsonConverter(typeof(PolymorphicPropertyJsonConverter))] + [DataContract(Name = "PolymorphicProperty")] + public partial class PolymorphicProperty : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of bool. + public PolymorphicProperty(bool actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of string. + public PolymorphicProperty(string actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Object. + public PolymorphicProperty(Object actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of List<string>. + public PolymorphicProperty(List actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(List)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Object)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(bool)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(string)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: List, Object, bool, string"); + } + } + } + + /// + /// Get the actual instance of `bool`. If the actual instance is not `bool`, + /// the InvalidClassException will be thrown + /// + /// An instance of bool + public bool GetBool() + { + return (bool)this.ActualInstance; + } + + /// + /// Get the actual instance of `string`. If the actual instance is not `string`, + /// the InvalidClassException will be thrown + /// + /// An instance of string + public string GetString() + { + return (string)this.ActualInstance; + } + + /// + /// Get the actual instance of `Object`. If the actual instance is not `Object`, + /// the InvalidClassException will be thrown + /// + /// An instance of Object + public Object GetObject() + { + return (Object)this.ActualInstance; + } + + /// + /// Get the actual instance of `List<string>`. If the actual instance is not `List<string>`, + /// the InvalidClassException will be thrown + /// + /// An instance of List<string> + public List GetListString() + { + return (List)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PolymorphicProperty {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, PolymorphicProperty.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of PolymorphicProperty + /// + /// JSON string + /// An instance of PolymorphicProperty + public static PolymorphicProperty FromJson(string jsonString) + { + PolymorphicProperty newPolymorphicProperty = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newPolymorphicProperty; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(List).GetProperty("AdditionalProperties") == null) + { + newPolymorphicProperty = new PolymorphicProperty(JsonConvert.DeserializeObject>(jsonString, PolymorphicProperty.SerializerSettings)); + } + else + { + newPolymorphicProperty = new PolymorphicProperty(JsonConvert.DeserializeObject>(jsonString, PolymorphicProperty.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("List"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into List: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Object).GetProperty("AdditionalProperties") == null) + { + newPolymorphicProperty = new PolymorphicProperty(JsonConvert.DeserializeObject(jsonString, PolymorphicProperty.SerializerSettings)); + } + else + { + newPolymorphicProperty = new PolymorphicProperty(JsonConvert.DeserializeObject(jsonString, PolymorphicProperty.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Object"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Object: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(bool).GetProperty("AdditionalProperties") == null) + { + newPolymorphicProperty = new PolymorphicProperty(JsonConvert.DeserializeObject(jsonString, PolymorphicProperty.SerializerSettings)); + } + else + { + newPolymorphicProperty = new PolymorphicProperty(JsonConvert.DeserializeObject(jsonString, PolymorphicProperty.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("bool"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into bool: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(string).GetProperty("AdditionalProperties") == null) + { + newPolymorphicProperty = new PolymorphicProperty(JsonConvert.DeserializeObject(jsonString, PolymorphicProperty.SerializerSettings)); + } + else + { + newPolymorphicProperty = new PolymorphicProperty(JsonConvert.DeserializeObject(jsonString, PolymorphicProperty.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("string"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into string: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newPolymorphicProperty; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PolymorphicProperty); + } + + /// + /// Returns true if PolymorphicProperty instances are equal + /// + /// Instance of PolymorphicProperty to be compared + /// Boolean + public bool Equals(PolymorphicProperty input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for PolymorphicProperty + /// + public class PolymorphicPropertyJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(PolymorphicProperty).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return PolymorphicProperty.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Quadrilateral.cs new file mode 100644 index 00000000000..d4739223613 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -0,0 +1,283 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Quadrilateral + /// + [JsonConverter(typeof(QuadrilateralJsonConverter))] + [DataContract(Name = "Quadrilateral")] + public partial class Quadrilateral : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of SimpleQuadrilateral. + public Quadrilateral(SimpleQuadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ComplexQuadrilateral. + public Quadrilateral(ComplexQuadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(ComplexQuadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(SimpleQuadrilateral)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: ComplexQuadrilateral, SimpleQuadrilateral"); + } + } + } + + /// + /// Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of SimpleQuadrilateral + public SimpleQuadrilateral GetSimpleQuadrilateral() + { + return (SimpleQuadrilateral)this.ActualInstance; + } + + /// + /// Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of ComplexQuadrilateral + public ComplexQuadrilateral GetComplexQuadrilateral() + { + return (ComplexQuadrilateral)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Quadrilateral {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Quadrilateral.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Quadrilateral + /// + /// JSON string + /// An instance of Quadrilateral + public static Quadrilateral FromJson(string jsonString) + { + Quadrilateral newQuadrilateral = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newQuadrilateral; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ComplexQuadrilateral).GetProperty("AdditionalProperties") == null) + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.SerializerSettings)); + } + else + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("ComplexQuadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into ComplexQuadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(SimpleQuadrilateral).GetProperty("AdditionalProperties") == null) + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.SerializerSettings)); + } + else + { + newQuadrilateral = new Quadrilateral(JsonConvert.DeserializeObject(jsonString, Quadrilateral.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("SimpleQuadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into SimpleQuadrilateral: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newQuadrilateral; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Quadrilateral); + } + + /// + /// Returns true if Quadrilateral instances are equal + /// + /// Instance of Quadrilateral to be compared + /// Boolean + public bool Equals(Quadrilateral input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for Quadrilateral + /// + public class QuadrilateralJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Quadrilateral).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Quadrilateral.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs new file mode 100644 index 00000000000..d8019ea97f4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -0,0 +1,128 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// QuadrilateralInterface + /// + [DataContract(Name = "QuadrilateralInterface")] + public partial class QuadrilateralInterface : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected QuadrilateralInterface() { } + /// + /// Initializes a new instance of the class. + /// + /// quadrilateralType (required). + public QuadrilateralInterface(string quadrilateralType = default(string)) + { + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) + { + throw new ArgumentNullException("quadrilateralType is a required property for QuadrilateralInterface and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = true)] + public string QuadrilateralType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class QuadrilateralInterface {\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as QuadrilateralInterface); + } + + /// + /// Returns true if QuadrilateralInterface instances are equal + /// + /// Instance of QuadrilateralInterface to be compared + /// Boolean + public bool Equals(QuadrilateralInterface input) + { + if (input == null) + { + return false; + } + return + ( + this.QuadrilateralType == input.QuadrilateralType || + (this.QuadrilateralType != null && + this.QuadrilateralType.Equals(input.QuadrilateralType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs new file mode 100644 index 00000000000..b32dad8c6d0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -0,0 +1,142 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ReadOnlyFirst + /// + [DataContract(Name = "ReadOnlyFirst")] + public partial class ReadOnlyFirst : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// baz. + public ReadOnlyFirst(string baz = default(string)) + { + this.Baz = baz; + } + + /// + /// Gets or Sets Bar + /// + [DataMember(Name = "bar", EmitDefaultValue = false)] + public string Bar { get; private set; } + + /// + /// Returns false as Bar should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBar() + { + return false; + } + /// + /// Gets or Sets Baz + /// + [DataMember(Name = "baz", EmitDefaultValue = false)] + public string Baz { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ReadOnlyFirst {\n"); + sb.Append(" Bar: ").Append(Bar).Append("\n"); + sb.Append(" Baz: ").Append(Baz).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ReadOnlyFirst); + } + + /// + /// Returns true if ReadOnlyFirst instances are equal + /// + /// Instance of ReadOnlyFirst to be compared + /// Boolean + public bool Equals(ReadOnlyFirst input) + { + if (input == null) + { + return false; + } + return + ( + this.Bar == input.Bar || + (this.Bar != null && + this.Bar.Equals(input.Bar)) + ) && + ( + this.Baz == input.Baz || + (this.Baz != null && + this.Baz.Equals(input.Baz)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Bar != null) + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } + if (this.Baz != null) + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Return.cs new file mode 100644 index 00000000000..bf5eff2c4eb --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Return.cs @@ -0,0 +1,114 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract(Name = "Return")] + public partial class Return : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _return. + public Return(int _return = default(int)) + { + this._Return = _return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name = "return", EmitDefaultValue = false)] + public int _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + { + return false; + } + return + ( + this._Return == input._Return || + this._Return.Equals(input._Return) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this._Return.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ScaleneTriangle.cs new file mode 100644 index 00000000000..2af6ed02f49 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -0,0 +1,151 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ScaleneTriangle + /// + [DataContract(Name = "ScaleneTriangle")] + public partial class ScaleneTriangle : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ScaleneTriangle() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// triangleType (required). + public ScaleneTriangle(string shapeType = default(string), string triangleType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) + { + throw new ArgumentNullException("shapeType is a required property for ScaleneTriangle and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "triangleType" is required (not null) + if (triangleType == null) + { + throw new ArgumentNullException("triangleType is a required property for ScaleneTriangle and cannot be null"); + } + this.TriangleType = triangleType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = true)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = true)] + public string TriangleType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ScaleneTriangle {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ScaleneTriangle); + } + + /// + /// Returns true if ScaleneTriangle instances are equal + /// + /// Instance of ScaleneTriangle to be compared + /// Boolean + public bool Equals(ScaleneTriangle input) + { + if (input == null) + { + return false; + } + return + ( + this.ShapeType == input.ShapeType || + (this.ShapeType != null && + this.ShapeType.Equals(input.ShapeType)) + ) && + ( + this.TriangleType == input.TriangleType || + (this.TriangleType != null && + this.TriangleType.Equals(input.TriangleType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Shape.cs new file mode 100644 index 00000000000..41ddeffca3a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Shape.cs @@ -0,0 +1,283 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Shape + /// + [JsonConverter(typeof(ShapeJsonConverter))] + [DataContract(Name = "Shape")] + public partial class Shape : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public Shape(Triangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public Shape(Quadrilateral actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Shape {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Shape.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Shape + /// + /// JSON string + /// An instance of Shape + public static Shape FromJson(string jsonString) + { + Shape newShape = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newShape; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.SerializerSettings)); + } + else + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.SerializerSettings)); + } + else + { + newShape = new Shape(JsonConvert.DeserializeObject(jsonString, Shape.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newShape; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Shape); + } + + /// + /// Returns true if Shape instances are equal + /// + /// Instance of Shape to be compared + /// Boolean + public bool Equals(Shape input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for Shape + /// + public class ShapeJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Shape).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Shape.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ShapeInterface.cs new file mode 100644 index 00000000000..059b987eb0d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -0,0 +1,128 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// ShapeInterface + /// + [DataContract(Name = "ShapeInterface")] + public partial class ShapeInterface : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ShapeInterface() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + public ShapeInterface(string shapeType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) + { + throw new ArgumentNullException("shapeType is a required property for ShapeInterface and cannot be null"); + } + this.ShapeType = shapeType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = true)] + public string ShapeType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ShapeInterface {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ShapeInterface); + } + + /// + /// Returns true if ShapeInterface instances are equal + /// + /// Instance of ShapeInterface to be compared + /// Boolean + public bool Equals(ShapeInterface input) + { + if (input == null) + { + return false; + } + return + ( + this.ShapeType == input.ShapeType || + (this.ShapeType != null && + this.ShapeType.Equals(input.ShapeType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ShapeOrNull.cs new file mode 100644 index 00000000000..2f906a61f94 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -0,0 +1,292 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + /// + [JsonConverter(typeof(ShapeOrNullJsonConverter))] + [DataContract(Name = "ShapeOrNull")] + public partial class ShapeOrNull : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + public ShapeOrNull() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Triangle. + public ShapeOrNull(Triangle actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of Quadrilateral. + public ShapeOrNull(Quadrilateral actualInstance) + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance; + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(Quadrilateral)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(Triangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: Quadrilateral, Triangle"); + } + } + } + + /// + /// Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of Triangle + public Triangle GetTriangle() + { + return (Triangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + /// the InvalidClassException will be thrown + /// + /// An instance of Quadrilateral + public Quadrilateral GetQuadrilateral() + { + return (Quadrilateral)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ShapeOrNull {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, ShapeOrNull.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of ShapeOrNull + /// + /// JSON string + /// An instance of ShapeOrNull + public static ShapeOrNull FromJson(string jsonString) + { + ShapeOrNull newShapeOrNull = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newShapeOrNull; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Quadrilateral).GetProperty("AdditionalProperties") == null) + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.SerializerSettings)); + } + else + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Quadrilateral"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Quadrilateral: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(Triangle).GetProperty("AdditionalProperties") == null) + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.SerializerSettings)); + } + else + { + newShapeOrNull = new ShapeOrNull(JsonConvert.DeserializeObject(jsonString, ShapeOrNull.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("Triangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Triangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newShapeOrNull; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ShapeOrNull); + } + + /// + /// Returns true if ShapeOrNull instances are equal + /// + /// Instance of ShapeOrNull to be compared + /// Boolean + public bool Equals(ShapeOrNull input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for ShapeOrNull + /// + public class ShapeOrNullJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(ShapeOrNull).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return ShapeOrNull.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs new file mode 100644 index 00000000000..c502ce260dc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -0,0 +1,151 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// SimpleQuadrilateral + /// + [DataContract(Name = "SimpleQuadrilateral")] + public partial class SimpleQuadrilateral : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SimpleQuadrilateral() { } + /// + /// Initializes a new instance of the class. + /// + /// shapeType (required). + /// quadrilateralType (required). + public SimpleQuadrilateral(string shapeType = default(string), string quadrilateralType = default(string)) + { + // to ensure "shapeType" is required (not null) + if (shapeType == null) + { + throw new ArgumentNullException("shapeType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.ShapeType = shapeType; + // to ensure "quadrilateralType" is required (not null) + if (quadrilateralType == null) + { + throw new ArgumentNullException("quadrilateralType is a required property for SimpleQuadrilateral and cannot be null"); + } + this.QuadrilateralType = quadrilateralType; + } + + /// + /// Gets or Sets ShapeType + /// + [DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = true)] + public string ShapeType { get; set; } + + /// + /// Gets or Sets QuadrilateralType + /// + [DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = true)] + public string QuadrilateralType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SimpleQuadrilateral {\n"); + sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); + sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SimpleQuadrilateral); + } + + /// + /// Returns true if SimpleQuadrilateral instances are equal + /// + /// Instance of SimpleQuadrilateral to be compared + /// Boolean + public bool Equals(SimpleQuadrilateral input) + { + if (input == null) + { + return false; + } + return + ( + this.ShapeType == input.ShapeType || + (this.ShapeType != null && + this.ShapeType.Equals(input.ShapeType)) + ) && + ( + this.QuadrilateralType == input.QuadrilateralType || + (this.QuadrilateralType != null && + this.QuadrilateralType.Equals(input.QuadrilateralType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ShapeType != null) + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } + if (this.QuadrilateralType != null) + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/SpecialModelName.cs new file mode 100644 index 00000000000..9f12aefffd2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// SpecialModelName + /// + [DataContract(Name = "_special_model.name_")] + public partial class SpecialModelName : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// specialPropertyName. + /// specialModelName. + public SpecialModelName(long specialPropertyName = default(long), string specialModelName = default(string)) + { + this.SpecialPropertyName = specialPropertyName; + this._SpecialModelName = specialModelName; + } + + /// + /// Gets or Sets SpecialPropertyName + /// + [DataMember(Name = "$special[property.name]", EmitDefaultValue = false)] + public long SpecialPropertyName { get; set; } + + /// + /// Gets or Sets _SpecialModelName + /// + [DataMember(Name = "_special_model.name_", EmitDefaultValue = false)] + public string _SpecialModelName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SpecialModelName {\n"); + sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); + sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SpecialModelName); + } + + /// + /// Returns true if SpecialModelName instances are equal + /// + /// Instance of SpecialModelName to be compared + /// Boolean + public bool Equals(SpecialModelName input) + { + if (input == null) + { + return false; + } + return + ( + this.SpecialPropertyName == input.SpecialPropertyName || + this.SpecialPropertyName.Equals(input.SpecialPropertyName) + ) && + ( + this._SpecialModelName == input._SpecialModelName || + (this._SpecialModelName != null && + this._SpecialModelName.Equals(input._SpecialModelName)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); + if (this._SpecialModelName != null) + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Tag.cs new file mode 100644 index 00000000000..5699133e667 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Tag.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Tag + /// + [DataContract(Name = "Tag")] + public partial class Tag : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long id = default(long), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Tag); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..aa8b827e602 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,118 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + [DataContract(Name = "TestCollectionEndingWithWordList")] + public partial class TestCollectionEndingWithWordList : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public TestCollectionEndingWithWordList(string value = default(string)) + { + this.Value = value; + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TestCollectionEndingWithWordList); + } + + /// + /// Returns true if TestCollectionEndingWithWordList instances are equal + /// + /// Instance of TestCollectionEndingWithWordList to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordList input) + { + if (input == null) + { + return false; + } + return + ( + this.Value == input.Value || + (this.Value != null && + this.Value.Equals(input.Value)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..0a0740c31cc --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + [DataContract(Name = "TestCollectionEndingWithWordListObject")] + public partial class TestCollectionEndingWithWordListObject : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList. + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList = default(List)) + { + this.TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [DataMember(Name = "TestCollectionEndingWithWordList", EmitDefaultValue = false)] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TestCollectionEndingWithWordListObject); + } + + /// + /// Returns true if TestCollectionEndingWithWordListObject instances are equal + /// + /// Instance of TestCollectionEndingWithWordListObject to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordListObject input) + { + if (input == null) + { + return false; + } + return + ( + this.TestCollectionEndingWithWordList == input.TestCollectionEndingWithWordList || + this.TestCollectionEndingWithWordList != null && + input.TestCollectionEndingWithWordList != null && + this.TestCollectionEndingWithWordList.SequenceEqual(input.TestCollectionEndingWithWordList) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TestCollectionEndingWithWordList != null) + { + hashCode = (hashCode * 59) + this.TestCollectionEndingWithWordList.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Triangle.cs new file mode 100644 index 00000000000..b0c5afe68a0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Triangle.cs @@ -0,0 +1,329 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using System.Reflection; + +namespace Org.OpenAPITools.Model +{ + /// + /// Triangle + /// + [JsonConverter(typeof(TriangleJsonConverter))] + [DataContract(Name = "Triangle")] + public partial class Triangle : AbstractOpenAPISchema, IEquatable + { + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of EquilateralTriangle. + public Triangle(EquilateralTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of IsoscelesTriangle. + public Triangle(IsoscelesTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ScaleneTriangle. + public Triangle(ScaleneTriangle actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + if (value.GetType() == typeof(EquilateralTriangle)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(IsoscelesTriangle)) + { + this._actualInstance = value; + } + else if (value.GetType() == typeof(ScaleneTriangle)) + { + this._actualInstance = value; + } + else + { + throw new ArgumentException("Invalid instance found. Must be the following types: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + } + } + } + + /// + /// Get the actual instance of `EquilateralTriangle`. If the actual instance is not `EquilateralTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of EquilateralTriangle + public EquilateralTriangle GetEquilateralTriangle() + { + return (EquilateralTriangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `IsoscelesTriangle`. If the actual instance is not `IsoscelesTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of IsoscelesTriangle + public IsoscelesTriangle GetIsoscelesTriangle() + { + return (IsoscelesTriangle)this.ActualInstance; + } + + /// + /// Get the actual instance of `ScaleneTriangle`. If the actual instance is not `ScaleneTriangle`, + /// the InvalidClassException will be thrown + /// + /// An instance of ScaleneTriangle + public ScaleneTriangle GetScaleneTriangle() + { + return (ScaleneTriangle)this.ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Triangle {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, Triangle.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of Triangle + /// + /// JSON string + /// An instance of Triangle + public static Triangle FromJson(string jsonString) + { + Triangle newTriangle = null; + + if (string.IsNullOrEmpty(jsonString)) + { + return newTriangle; + } + int match = 0; + List matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(EquilateralTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("EquilateralTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into EquilateralTriangle: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(IsoscelesTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("IsoscelesTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into IsoscelesTriangle: {1}", jsonString, exception.ToString())); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ScaleneTriangle).GetProperty("AdditionalProperties") == null) + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.SerializerSettings)); + } + else + { + newTriangle = new Triangle(JsonConvert.DeserializeObject(jsonString, Triangle.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("ScaleneTriangle"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into ScaleneTriangle: {1}", jsonString, exception.ToString())); + } + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return newTriangle; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Triangle); + } + + /// + /// Returns true if Triangle instances are equal + /// + /// Instance of Triangle to be compared + /// Boolean + public bool Equals(Triangle input) + { + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + } + + /// + /// Custom JSON converter for Triangle + /// + public class TriangleJsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof(Triangle).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return Triangle.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TriangleInterface.cs new file mode 100644 index 00000000000..01e75d07962 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -0,0 +1,128 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// TriangleInterface + /// + [DataContract(Name = "TriangleInterface")] + public partial class TriangleInterface : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TriangleInterface() { } + /// + /// Initializes a new instance of the class. + /// + /// triangleType (required). + public TriangleInterface(string triangleType = default(string)) + { + // to ensure "triangleType" is required (not null) + if (triangleType == null) + { + throw new ArgumentNullException("triangleType is a required property for TriangleInterface and cannot be null"); + } + this.TriangleType = triangleType; + } + + /// + /// Gets or Sets TriangleType + /// + [DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = true)] + public string TriangleType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TriangleInterface {\n"); + sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TriangleInterface); + } + + /// + /// Returns true if TriangleInterface instances are equal + /// + /// Instance of TriangleInterface to be compared + /// Boolean + public bool Equals(TriangleInterface input) + { + if (input == null) + { + return false; + } + return + ( + this.TriangleType == input.TriangleType || + (this.TriangleType != null && + this.TriangleType.Equals(input.TriangleType)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TriangleType != null) + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/User.cs new file mode 100644 index 00000000000..03599102829 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/User.cs @@ -0,0 +1,313 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// User + /// + [DataContract(Name = "User")] + public partial class User : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.. + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.. + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389. + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.. + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int), Object objectWithNoDeclaredProps = default(Object), Object objectWithNoDeclaredPropsNullable = default(Object), Object anyTypeProp = default(Object), Object anyTypePropNullable = default(Object)) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + this.ObjectWithNoDeclaredProps = objectWithNoDeclaredProps; + this.ObjectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + this.AnyTypeProp = anyTypeProp; + this.AnyTypePropNullable = anyTypePropNullable; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", EmitDefaultValue = false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name = "firstName", EmitDefaultValue = false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name = "lastName", EmitDefaultValue = false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name = "email", EmitDefaultValue = false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name = "phone", EmitDefaultValue = false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name = "userStatus", EmitDefaultValue = false)] + public int UserStatus { get; set; } + + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + /// + /// test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + [DataMember(Name = "objectWithNoDeclaredProps", EmitDefaultValue = false)] + public Object ObjectWithNoDeclaredProps { get; set; } + + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + /// + /// test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + [DataMember(Name = "objectWithNoDeclaredPropsNullable", EmitDefaultValue = true)] + public Object ObjectWithNoDeclaredPropsNullable { get; set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + [DataMember(Name = "anyTypeProp", EmitDefaultValue = true)] + public Object AnyTypeProp { get; set; } + + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + /// + /// test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + [DataMember(Name = "anyTypePropNullable", EmitDefaultValue = true)] + public Object AnyTypePropNullable { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append(" ObjectWithNoDeclaredProps: ").Append(ObjectWithNoDeclaredProps).Append("\n"); + sb.Append(" ObjectWithNoDeclaredPropsNullable: ").Append(ObjectWithNoDeclaredPropsNullable).Append("\n"); + sb.Append(" AnyTypeProp: ").Append(AnyTypeProp).Append("\n"); + sb.Append(" AnyTypePropNullable: ").Append(AnyTypePropNullable).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as User); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.Username == input.Username || + (this.Username != null && + this.Username.Equals(input.Username)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.Email == input.Email || + (this.Email != null && + this.Email.Equals(input.Email)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.Phone == input.Phone || + (this.Phone != null && + this.Phone.Equals(input.Phone)) + ) && + ( + this.UserStatus == input.UserStatus || + this.UserStatus.Equals(input.UserStatus) + ) && + ( + this.ObjectWithNoDeclaredProps == input.ObjectWithNoDeclaredProps || + (this.ObjectWithNoDeclaredProps != null && + this.ObjectWithNoDeclaredProps.Equals(input.ObjectWithNoDeclaredProps)) + ) && + ( + this.ObjectWithNoDeclaredPropsNullable == input.ObjectWithNoDeclaredPropsNullable || + (this.ObjectWithNoDeclaredPropsNullable != null && + this.ObjectWithNoDeclaredPropsNullable.Equals(input.ObjectWithNoDeclaredPropsNullable)) + ) && + ( + this.AnyTypeProp == input.AnyTypeProp || + (this.AnyTypeProp != null && + this.AnyTypeProp.Equals(input.AnyTypeProp)) + ) && + ( + this.AnyTypePropNullable == input.AnyTypePropNullable || + (this.AnyTypePropNullable != null && + this.AnyTypePropNullable.Equals(input.AnyTypePropNullable)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + if (this.Username != null) + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } + if (this.FirstName != null) + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } + if (this.LastName != null) + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } + if (this.Email != null) + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } + if (this.Password != null) + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } + if (this.Phone != null) + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); + if (this.ObjectWithNoDeclaredProps != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } + if (this.ObjectWithNoDeclaredPropsNullable != null) + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } + if (this.AnyTypeProp != null) + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } + if (this.AnyTypePropNullable != null) + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Whale.cs new file mode 100644 index 00000000000..19775ac703b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Whale.cs @@ -0,0 +1,156 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Whale + /// + [DataContract(Name = "whale")] + public partial class Whale : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Whale() { } + /// + /// Initializes a new instance of the class. + /// + /// hasBaleen. + /// hasTeeth. + /// className (required). + public Whale(bool hasBaleen = default(bool), bool hasTeeth = default(bool), string className = default(string)) + { + // to ensure "className" is required (not null) + if (className == null) + { + throw new ArgumentNullException("className is a required property for Whale and cannot be null"); + } + this.ClassName = className; + this.HasBaleen = hasBaleen; + this.HasTeeth = hasTeeth; + } + + /// + /// Gets or Sets HasBaleen + /// + [DataMember(Name = "hasBaleen", EmitDefaultValue = true)] + public bool HasBaleen { get; set; } + + /// + /// Gets or Sets HasTeeth + /// + [DataMember(Name = "hasTeeth", EmitDefaultValue = true)] + public bool HasTeeth { get; set; } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = true)] + public string ClassName { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Whale {\n"); + sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); + sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Whale); + } + + /// + /// Returns true if Whale instances are equal + /// + /// Instance of Whale to be compared + /// Boolean + public bool Equals(Whale input) + { + if (input == null) + { + return false; + } + return + ( + this.HasBaleen == input.HasBaleen || + this.HasBaleen.Equals(input.HasBaleen) + ) && + ( + this.HasTeeth == input.HasTeeth || + this.HasTeeth.Equals(input.HasTeeth) + ) && + ( + this.ClassName == input.ClassName || + (this.ClassName != null && + this.ClassName.Equals(input.ClassName)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Zebra.cs new file mode 100644 index 00000000000..8dc3dacc572 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/Zebra.cs @@ -0,0 +1,185 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Zebra + /// + [DataContract(Name = "zebra")] + public partial class Zebra : Dictionary, IEquatable + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum Plains for value: plains + /// + [EnumMember(Value = "plains")] + Plains = 1, + + /// + /// Enum Mountain for value: mountain + /// + [EnumMember(Value = "mountain")] + Mountain = 2, + + /// + /// Enum Grevys for value: grevys + /// + [EnumMember(Value = "grevys")] + Grevys = 3 + + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum? Type { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Zebra() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// type. + /// className (required). + public Zebra(TypeEnum? type = default(TypeEnum?), string className = default(string)) : base() + { + // to ensure "className" is required (not null) + if (className == null) + { + throw new ArgumentNullException("className is a required property for Zebra and cannot be null"); + } + this.ClassName = className; + this.Type = type; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ClassName + /// + [DataMember(Name = "className", IsRequired = true, EmitDefaultValue = true)] + public string ClassName { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Zebra {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Zebra); + } + + /// + /// Returns true if Zebra instances are equal + /// + /// Instance of Zebra to be compared + /// Boolean + public bool Equals(Zebra input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && base.Equals(input) && + ( + this.ClassName == input.ClassName || + (this.ClassName != null && + this.ClassName.Equals(input.ClassName)) + ) + && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + if (this.ClassName != null) + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Org.OpenAPITools.asmdef b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Org.OpenAPITools.asmdef new file mode 100644 index 00000000000..030e83ecf59 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Org.OpenAPITools.asmdef @@ -0,0 +1,7 @@ +{ + "name": "Org.OpenAPITools", + "overrideReferences": true, + "precompiledReferences": [ + "Newtonsoft.Json.dll" + ] +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES index f465ea1d3ab..3f6001fe8dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/Activity.md docs/ActivityOutputElementRepresentation.md @@ -50,6 +51,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/List.md +docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -84,6 +86,8 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -163,6 +167,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -195,6 +200,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md index 46d61ab2f54..786ac93aab8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md @@ -106,6 +106,7 @@ 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 | *DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello *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 | @@ -192,6 +193,7 @@ Class | Method | HTTP request | Description - [Model.HealthCheckResult](docs/HealthCheckResult.md) - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Model.List](docs/List.md) + - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -224,6 +226,8 @@ Class | Method | HTTP request | Description - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClient/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/DefaultApi.md index 265fec1a6f9..72d1733f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/OpenAPIClient/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FormatTest.md index 39a70be7ad4..1664a9d7c72 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FormatTest.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/LiteralStringClass.md new file mode 100644 index 00000000000..6d3e0d50c1f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClient/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..0e5568637b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClient/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..7213b3ca8d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..74dc17b9f4a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -0,0 +1,77 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..4def0dcda9c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e9df66daf2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 1f62df0559f..d075b5d10ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -24,7 +24,9 @@ OpenAPI spec version: 1.0.0 - - + + runtime; build; native; contentfiles; analyzers; buildtransitive +all + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs index 0ae306612df..1b487bc9248 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -65,6 +65,27 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse GetCountryWithHttpInfo(string country, int operationIndex = 0); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + List Hello(int operationIndex = 0); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + ApiResponse> HelloWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -122,6 +143,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -510,5 +554,131 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + public List Hello(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = HelloWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + public Org.OpenAPITools.Client.ApiResponse> HelloWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/hello", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await HelloWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/hello", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index 8b0ba33499b..f64cfebe67d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); + var response = await client.PostAsync(request).ConfigureAwait(false); return $"{response.TokenType} {response.AccessToken}"; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs index 608bdbc195a..85ec4341271 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Activity.cs index 38f1573adb2..3c5a860dd89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Activity.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 59a301721b2..0640bc68500 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b3ddad35a07..ddec6a58568 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index 83397018b70..78077d2bed4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className = default(string), string color = @"red") { // to ensure "className" is required (not null) if (className == null) @@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Model } this.ClassName = className; // use default value if no "color" provided - this.Color = color ?? "red"; + this.Color = color ?? @"red"; this.AdditionalProperties = new Dictionary(); } @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs index 79873f4ddfe..6d70e97a51c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs index 8b1f87d1aa9..c8ffe52a70a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs @@ -136,17 +136,17 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs index 9e09e2da8ce..16df556db5d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 30bf57ef0f5..06e930e774c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8a215aad133..da8a65b26f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs index 1a879a1d9ca..3e823100067 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Banana.cs index 97939597ede..70aeea02471 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Banana.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BananaReq.cs index 3edb9a1b6dc..6a4edb3394d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs index f65f049cfd9..838f5741cf6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs index be68a50a116..bd317ad8747 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 86ceaeed1ab..49a0dc8ada3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// declawed. /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = @"Cat", string color = @"red") : base(className, color) { this.Declawed = declawed; this.AdditionalProperties = new Dictionary(); @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs index 3a960e9925e..8fcdcaf5342 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs index 94dea2b30bb..2313431e4d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + public Category(long id = default(long), string name = @"default-name") { // to ensure "name" is required (not null) if (name == null) @@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCat.cs index 2aa81264fad..8ba9f729c01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCat.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index a353ad7ffd7..efff1d70557 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs index 7177e9bf0b6..59c85f3e79b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 353ea1d081e..4c1b999c7f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs index d86ff21df9b..3c1138fe977 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 977c8ed7863..c30936b9684 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime DateOnlyProperty { get; set; } @@ -124,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 1928b236bf6..1a6841a713c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs index 786270d1c4d..32f2bbd7fa7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// breed. /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = @"Dog", string color = @"red") : base(className, color) { this.Breed = breed; this.AdditionalProperties = new Dictionary(); @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs index 7b026acbf1e..e82743a7151 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Drawing.cs index d8cd2a70ef6..0a759b37b3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Drawing.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs index 69568d6c87d..08214dd22b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs index 7386cffd37d..02e7580cdcf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -314,7 +314,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 773eba5b0a2..ab16133fe4b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs index e77d15e06bc..cf3b18a81c8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 6808978c49f..ae9d8e1c05a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs index e64aac7b631..570e3de7f65 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs @@ -36,10 +36,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// bar (default to "bar"). - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { // use default value if no "bar" provided - this.Bar = bar ?? "bar"; + this.Bar = bar ?? @"bar"; this.AdditionalProperties = new Dictionary(); } @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 259e5e626df..70554062020 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index 9d0979b6f71..c3fa57791cf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -45,7 +45,9 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// unsignedInteger. /// int64. + /// unsignedLong. /// number (required). /// _float. /// _double. @@ -59,7 +61,7 @@ namespace Org.OpenAPITools.Model /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { this.Number = number; // to ensure "_byte" is required (not null) @@ -77,7 +79,9 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.UnsignedInteger = unsignedInteger; this.Int64 = int64; + this.UnsignedLong = unsignedLong; this.Float = _float; this.Double = _double; this.Decimal = _decimal; @@ -102,12 +106,24 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] + public uint UnsignedInteger { get; set; } + /// /// Gets or Sets Int64 /// [DataMember(Name = "int64", EmitDefaultValue = false)] public long Int64 { get; set; } + /// + /// Gets or Sets UnsignedLong + /// + [DataMember(Name = "unsigned_long", EmitDefaultValue = false)] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Number /// @@ -153,6 +169,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime Date { get; set; } @@ -160,12 +177,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [DataMember(Name = "dateTime", EmitDefaultValue = false)] public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { get; set; } @@ -205,7 +224,9 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); @@ -264,7 +285,9 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); @@ -318,7 +341,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) @@ -344,6 +367,18 @@ namespace Org.OpenAPITools.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + // Number (decimal) maximum if (this.Number > (decimal)543.2) { @@ -381,7 +416,7 @@ namespace Org.OpenAPITools.Model } // String (string) pattern - Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); @@ -400,14 +435,14 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 28e7729a175..8ca8d20eb0e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 52099a7095e..2d4a1cd404f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs index e8cbb68e2e4..77ad8860aec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index ea18925f87e..3d5a1ff7ad8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs index 00814d11069..8933b19e210 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..3efdf123845 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,147 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + [DataContract(Name = "LiteralStringClass")] + public partial class LiteralStringClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username"). + /// unescapedLiteralString (default to "C:\Users\username"). + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + // use default value if no "escapedLiteralString" provided + this.EscapedLiteralString = escapedLiteralString ?? @"C:\\Users\\username"; + // use default value if no "unescapedLiteralString" provided + this.UnescapedLiteralString = unescapedLiteralString ?? @"C:\Users\username"; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [DataMember(Name = "escapedLiteralString", EmitDefaultValue = false)] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [DataMember(Name = "unescapedLiteralString", EmitDefaultValue = false)] + public string UnescapedLiteralString { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as LiteralStringClass).AreEqual; + } + + /// + /// Returns true if LiteralStringClass instances are equal + /// + /// Instance of LiteralStringClass to be compared + /// Boolean + public bool Equals(LiteralStringClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EscapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.EscapedLiteralString.GetHashCode(); + } + if (this.UnescapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.UnescapedLiteralString.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs index b2aeedc33ce..424a81efceb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 2a0e96d6bc0..01215c65971 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -162,10 +162,10 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs index 79a49ef91d2..72383f9de33 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs index 1995ec4b169..d9a94592395 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs index 1d4e7605066..515b498cb5b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs index 57555c37678..f2d06d7f2a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs @@ -256,7 +256,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 9184756cb73..b8bb2b7bcf3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = true)] public Guid? Uuid { get; set; } @@ -123,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs index 0331e1c8db8..d25f420362e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 86ea32998f8..14022ef06ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs index 5c52482e79b..3f5b1d5f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs @@ -107,6 +107,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [DataMember(Name = "shipDate", EmitDefaultValue = false)] public DateTime ShipDate { get; set; } @@ -201,7 +202,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs index 3209f6d6244..42ddbc5c56f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -143,7 +143,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ParentPet.cs index 49bed679864..769c3612f3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ParentPet.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// petType (required) (default to "ParentPet"). - public ParentPet(string petType = "ParentPet") : base(petType) + public ParentPet(string petType = @"ParentPet") : base(petType) { this.AdditionalProperties = new Dictionary(); } @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs index 0e6f950d7f9..9e624788f76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs @@ -119,6 +119,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } @@ -228,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index d5be5ea3c92..9f2f3d60b1f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index ad59ca83286..233a10492f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs index e702e015703..c6edbea2f71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs @@ -120,7 +120,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 236020031e6..f50d01492be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs index c9294b0b4e5..c03107d52ee 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 59397bf30fc..f589c821c40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7800467822e..fd741fa9e1a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs index 3df2c02e2ce..ec78b91f125 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs @@ -133,7 +133,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..b89ff43ced7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + [DataContract(Name = "TestCollectionEndingWithWordList")] + public partial class TestCollectionEndingWithWordList : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public TestCollectionEndingWithWordList(string value = default(string)) + { + this.Value = value; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordList).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordList instances are equal + /// + /// Instance of TestCollectionEndingWithWordList to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordList input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..54d4db6cf28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,132 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + [DataContract(Name = "TestCollectionEndingWithWordListObject")] + public partial class TestCollectionEndingWithWordListObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList. + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList = default(List)) + { + this.TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [DataMember(Name = "TestCollectionEndingWithWordList", EmitDefaultValue = false)] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordListObject).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordListObject instances are equal + /// + /// Instance of TestCollectionEndingWithWordListObject to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordListObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TestCollectionEndingWithWordList != null) + { + hashCode = (hashCode * 59) + this.TestCollectionEndingWithWordList.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs index cdf2bd1f0f9..1c85da68ec7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs index 5f2a3020c3d..8744ceac5ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs index 62ae66415f1..c4ae8981958 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs @@ -156,7 +156,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs index 8a3c713fe6b..2cd7c3f946d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 242934b6642..8d6a4b78ae0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES index f465ea1d3ab..3f6001fe8dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/Activity.md docs/ActivityOutputElementRepresentation.md @@ -50,6 +51,7 @@ docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/IsoscelesTriangle.md docs/List.md +docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -84,6 +86,8 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestCollectionEndingWithWordList.md +docs/TestCollectionEndingWithWordListObject.md docs/Triangle.md docs/TriangleInterface.md docs/User.md @@ -163,6 +167,7 @@ src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs src/Org.OpenAPITools/Model/HealthCheckResult.cs src/Org.OpenAPITools/Model/IsoscelesTriangle.cs src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -195,6 +200,8 @@ src/Org.OpenAPITools/Model/ShapeOrNull.cs src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs src/Org.OpenAPITools/Model/Triangle.cs src/Org.OpenAPITools/Model/TriangleInterface.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index 5dae7e02093..49208c7379d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -118,6 +118,7 @@ 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 | *DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country | +*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello *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 | @@ -204,6 +205,7 @@ Class | Method | HTTP request | Description - [Model.HealthCheckResult](docs/HealthCheckResult.md) - [Model.IsoscelesTriangle](docs/IsoscelesTriangle.md) - [Model.List](docs/List.md) + - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -236,6 +238,8 @@ Class | Method | HTTP request | Description - [Model.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TestCollectionEndingWithWordList](docs/TestCollectionEndingWithWordList.md) + - [Model.TestCollectionEndingWithWordListObject](docs/TestCollectionEndingWithWordListObject.md) - [Model.Triangle](docs/Triangle.md) - [Model.TriangleInterface](docs/TriangleInterface.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/api/openapi.yaml new file mode 100644 index 00000000000..7942c294dac --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/api/openapi.yaml @@ -0,0 +1,2404 @@ +openapi: 3.0.0 +info: + 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: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /hello: + get: + description: Hello + operationId: Hello + responses: + "200": + content: + application/json: + schema: + items: + format: uuid + type: string + type: array + description: UUIDs + summary: Hello + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + 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 + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + 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#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - description: Required UUID String + explode: true + in: query + name: required_string_uuid + required: true + schema: + format: uuid + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + /fake/test-query-parameters: + 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: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/getCountry_request' + responses: + "200": + description: OK +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + 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: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + 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: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + unsigned_integer: + format: int32 + maximum: 200 + minimum: 20 + type: integer + x-unsigned: true + int64: + format: int64 + type: integer + unsigned_long: + format: int64 + type: integer + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + 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 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + 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_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid_with_pattern: + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + type: string + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + x-cls-compliant: true + x-com-visible: true + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - items: + $ref: '#/components/schemas/StringArrayItem' + type: array + StringArrayItem: + format: string + type: string + Activity: + description: test map of maps + properties: + activity_outputs: + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + type: object + type: object + ActivityOutputRepresentation: + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + type: array + ActivityOutputElementRepresentation: + properties: + prop1: + type: string + prop2: + type: object + type: object + NullableGuidClass: + properties: + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + nullable: true + type: string + type: object + DateOnlyClass: + properties: + dateOnlyProperty: + example: 2017-07-21 + format: date + type: string + type: object + TestCollectionEndingWithWordListObject: + properties: + TestCollectionEndingWithWordList: + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + type: array + type: object + TestCollectionEndingWithWordList: + properties: + value: + type: string + type: object + LiteralStringClass: + properties: + escapedLiteralString: + default: C:\\Users\\username + type: string + unescapedLiteralString: + default: C:\Users\username + type: string + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + getCountry_request_allOf: + properties: + country: + type: string + required: + - country + type: object + getCountry_request: + allOf: + - $ref: '#/components/schemas/getCountry_request_allOf' + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + ChildCat_allOf: + properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/DefaultApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/DefaultApi.md index 265fec1a6f9..72d1733f4c6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/DefaultApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/DefaultApi.md @@ -6,6 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* |--------|--------------|-------------| | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | | | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | | +| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello | # **FooGet** @@ -172,3 +173,89 @@ 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) + +# **Hello** +> List<Guid> Hello () + +Hello + +Hello + +### 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 HelloExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new DefaultApi(config); + + try + { + // Hello + List result = apiInstance.Hello(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the HelloWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Hello + ApiResponse> response = apiInstance.HelloWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +**List** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | UUIDs | - | + +[[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/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FormatTest.md index 39a70be7ad4..1664a9d7c72 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FormatTest.md @@ -6,7 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] +**UnsignedLong** | **ulong** | | [optional] **Number** | **decimal** | | **Float** | **float** | | [optional] **Double** | **double** | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/LiteralStringClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/LiteralStringClass.md new file mode 100644 index 00000000000..6d3e0d50c1f --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/LiteralStringClass.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.LiteralStringClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"] +**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"] + +[[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/csharp-netcore/OpenAPIClientCore/docs/TestCollectionEndingWithWordList.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/TestCollectionEndingWithWordList.md new file mode 100644 index 00000000000..0e5568637b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/TestCollectionEndingWithWordList.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | **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/csharp-netcore/OpenAPIClientCore/docs/TestCollectionEndingWithWordListObject.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/TestCollectionEndingWithWordListObject.md new file mode 100644 index 00000000000..7213b3ca8d9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/TestCollectionEndingWithWordListObject.md @@ -0,0 +1,10 @@ +# Org.OpenAPITools.Model.TestCollectionEndingWithWordListObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TestCollectionEndingWithWordList** | [**List<TestCollectionEndingWithWordList>**](TestCollectionEndingWithWordList.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/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs new file mode 100644 index 00000000000..74dc17b9f4a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/LiteralStringClassTests.cs @@ -0,0 +1,77 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing LiteralStringClass + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class LiteralStringClassTests : IDisposable + { + // TODO uncomment below to declare an instance variable for LiteralStringClass + //private LiteralStringClass instance; + + public LiteralStringClassTests() + { + // TODO uncomment below to create an instance of LiteralStringClass + //instance = new LiteralStringClass(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of LiteralStringClass + /// + [Fact] + public void LiteralStringClassInstanceTest() + { + // TODO uncomment below to test "IsType" LiteralStringClass + //Assert.IsType(instance); + } + + + /// + /// Test the property 'EscapedLiteralString' + /// + [Fact] + public void EscapedLiteralStringTest() + { + // TODO unit test for the property 'EscapedLiteralString' + } + /// + /// Test the property 'UnescapedLiteralString' + /// + [Fact] + public void UnescapedLiteralStringTest() + { + // TODO unit test for the property 'UnescapedLiteralString' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs new file mode 100644 index 00000000000..4def0dcda9c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListObjectTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordListObject + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListObjectTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordListObject + //private TestCollectionEndingWithWordListObject instance; + + public TestCollectionEndingWithWordListObjectTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordListObject + //instance = new TestCollectionEndingWithWordListObject(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordListObject + /// + [Fact] + public void TestCollectionEndingWithWordListObjectInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordListObject + //Assert.IsType(instance); + } + + + /// + /// Test the property 'TestCollectionEndingWithWordList' + /// + [Fact] + public void TestCollectionEndingWithWordListTest() + { + // TODO unit test for the property 'TestCollectionEndingWithWordList' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs new file mode 100644 index 00000000000..e9df66daf2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/TestCollectionEndingWithWordListTests.cs @@ -0,0 +1,69 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing TestCollectionEndingWithWordList + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TestCollectionEndingWithWordListTests : IDisposable + { + // TODO uncomment below to declare an instance variable for TestCollectionEndingWithWordList + //private TestCollectionEndingWithWordList instance; + + public TestCollectionEndingWithWordListTests() + { + // TODO uncomment below to create an instance of TestCollectionEndingWithWordList + //instance = new TestCollectionEndingWithWordList(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of TestCollectionEndingWithWordList + /// + [Fact] + public void TestCollectionEndingWithWordListInstanceTest() + { + // TODO uncomment below to test "IsType" TestCollectionEndingWithWordList + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Value' + /// + [Fact] + public void ValueTest() + { + // TODO unit test for the property 'Value' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs index 0ae306612df..1b487bc9248 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -65,6 +65,27 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of Object(void) ApiResponse GetCountryWithHttpInfo(string country, int operationIndex = 0); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + List Hello(int operationIndex = 0); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + ApiResponse> HelloWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -122,6 +143,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse System.Threading.Tasks.Task> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Hello + /// + /// + /// Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -510,5 +554,131 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<Guid> + public List Hello(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = HelloWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<Guid> + public Org.OpenAPITools.Client.ApiResponse> HelloWithHttpInfo(int operationIndex = 0) + { + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = this.Client.Get>("/hello", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<Guid> + public async System.Threading.Tasks.Task> HelloAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await HelloWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Hello Hello + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<Guid>) + public async System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "DefaultApi.Hello"; + localVarRequestOptions.OperationIndex = operationIndex; + + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync>("/hello", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("Hello", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index 8b0ba33499b..f64cfebe67d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); + var response = await client.PostAsync(request).ConfigureAwait(false); return $"{response.TokenType} {response.AccessToken}"; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs index 608bdbc195a..85ec4341271 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Activity.cs index 625d71bfff7..8541bd1bcaa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Activity.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 677b79cc20d..ff72bd6fa13 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index d7f64e083d9..1c79d469e91 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -203,7 +203,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs index 86a7a429b22..c2d35120baa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// /// className (required). /// color (default to "red"). - public Animal(string className = default(string), string color = "red") + public Animal(string className = default(string), string color = @"red") { // to ensure "className" is required (not null) if (className == null) @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Model } this.ClassName = className; // use default value if no "color" provided - this.Color = color ?? "red"; + this.Color = color ?? @"red"; } /// @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ApiResponse.cs index b29884509c0..57b0b557c53 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs index 4706c3f55e8..d5b2f61f085 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs @@ -124,17 +124,17 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); + Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant); if (false == regexCultivar.Match(this.Cultivar).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); } // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexOrigin.Match(this.Origin).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs index 9e09e2da8ce..16df556db5d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 7bb75ee4dd7..5769a9d7ed1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 1ea6f5248b2..bf45340005d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayTest.cs index 9564cd48483..a6592af0db6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Banana.cs index d0053dbae2d..c9e64f85434 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Banana.cs @@ -108,7 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BananaReq.cs index 3edb9a1b6dc..6a4edb3394d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs index 2971e12965e..c8f4b3d1f30 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Capitalization.cs index 2f53c995da9..290a87a828c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs index c90dc4940de..40d854f191e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// declawed. /// className (required) (default to "Cat"). /// color (default to "red"). - public Cat(bool declawed = default(bool), string className = "Cat", string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = @"Cat", string color = @"red") : base(className, color) { this.Declawed = declawed; } @@ -118,7 +118,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/CatAllOf.cs index 607c2c650ed..edc61ef4f65 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -108,7 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs index 1abee7610c8..72048b10c7e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs @@ -42,7 +42,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long id = default(long), string name = "default-name") + public Category(long id = default(long), string name = @"default-name") { // to ensure "name" is required (not null) if (name == null) @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCat.cs index f665258c5c0..2919af9b738 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index 58d2cec42cc..4ced8d9f535 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -135,7 +135,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ClassModel.cs index 5ead2b7fbfa..1598cc3f2c1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 25aa6457216..c2b743d09c1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs index 2f877b7d389..6f9f7cf853c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 3ffbc9c2cf4..870008a73b0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -44,6 +44,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateOnlyProperty /// + /// "Fri Jul 21 00:00:00 UTC 2017" [DataMember(Name = "dateOnlyProperty", EmitDefaultValue = false)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime DateOnlyProperty { get; set; } @@ -112,7 +113,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 2c3722a6b4a..c112dd03a8b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs index 1d1dd51ee30..9a84f0354c3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// breed. /// className (required) (default to "Dog"). /// color (default to "red"). - public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color) + public Dog(string breed = default(string), string className = @"Dog", string color = @"red") : base(className, color) { this.Breed = breed; } @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DogAllOf.cs index 036f993e64a..e748e261c47 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Drawing.cs index d8cd2a70ef6..0a759b37b3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Drawing.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumArrays.cs index 59f55d253de..16ebb0059fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs index e6b89b9b560..eed464ffac0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -299,7 +299,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index f17be2330fd..8985aa619d4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/File.cs index 7010f9a6103..ea4c623b45b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/File.cs @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 077da6361a9..1ee36c96866 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Foo.cs index 3abdc1cb6a0..7d665273f1d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Foo.cs @@ -36,10 +36,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// bar (default to "bar"). - public Foo(string bar = "bar") + public Foo(string bar = @"bar") { // use default value if no "bar" provided - this.Bar = bar ?? "bar"; + this.Bar = bar ?? @"bar"; } /// @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 4766548c4a5..064f7071056 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs index 62203c68273..f70aacdccba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -42,7 +42,9 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// unsignedInteger. /// int64. + /// unsignedLong. /// number (required). /// _float. /// _double. @@ -56,7 +58,7 @@ namespace Org.OpenAPITools.Model /// password (required). /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. - public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string)) { this.Number = number; // to ensure "_byte" is required (not null) @@ -74,7 +76,9 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.UnsignedInteger = unsignedInteger; this.Int64 = int64; + this.UnsignedLong = unsignedLong; this.Float = _float; this.Double = _double; this.Decimal = _decimal; @@ -98,12 +102,24 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets UnsignedInteger + /// + [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] + public uint UnsignedInteger { get; set; } + /// /// Gets or Sets Int64 /// [DataMember(Name = "int64", EmitDefaultValue = false)] public long Int64 { get; set; } + /// + /// Gets or Sets UnsignedLong + /// + [DataMember(Name = "unsigned_long", EmitDefaultValue = false)] + public ulong UnsignedLong { get; set; } + /// /// Gets or Sets Number /// @@ -149,6 +165,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Date /// + /// "Sun Feb 02 00:00:00 UTC 2020" [DataMember(Name = "date", IsRequired = true, EmitDefaultValue = true)] [JsonConverter(typeof(OpenAPIDateConverter))] public DateTime Date { get; set; } @@ -156,12 +173,14 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets DateTime /// + /// "2007-12-03T10:15:30+01:00" [DataMember(Name = "dateTime", EmitDefaultValue = false)] public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = false)] public Guid Uuid { get; set; } @@ -195,7 +214,9 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); @@ -253,7 +274,9 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); hashCode = (hashCode * 59) + this.Number.GetHashCode(); hashCode = (hashCode * 59) + this.Float.GetHashCode(); hashCode = (hashCode * 59) + this.Double.GetHashCode(); @@ -303,7 +326,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Integer (int) maximum if (this.Integer > (int)100) @@ -329,6 +352,18 @@ namespace Org.OpenAPITools.Model yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // UnsignedInteger (uint) maximum + if (this.UnsignedInteger > (uint)200) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value less than or equal to 200.", new [] { "UnsignedInteger" }); + } + + // UnsignedInteger (uint) minimum + if (this.UnsignedInteger < (uint)20) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UnsignedInteger, must be a value greater than or equal to 20.", new [] { "UnsignedInteger" }); + } + // Number (decimal) maximum if (this.Number > (decimal)543.2) { @@ -366,7 +401,7 @@ namespace Org.OpenAPITools.Model } // String (string) pattern - Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexString.Match(this.String).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); @@ -385,14 +420,14 @@ namespace Org.OpenAPITools.Model } // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant); + Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant); if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); } // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 46de6e7e45e..eb781c032e4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -125,7 +125,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 498c8226fc1..952e3eac26e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -137,7 +137,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 520aa05bac4..c047628a77b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index ea18925f87e..3d5a1ff7ad8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/List.cs index 33b69997a74..091121dedc8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/List.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/LiteralStringClass.cs new file mode 100644 index 00000000000..eb7c8d83ab6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -0,0 +1,135 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// LiteralStringClass + /// + [DataContract(Name = "LiteralStringClass")] + public partial class LiteralStringClass : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// escapedLiteralString (default to "C:\\Users\\username"). + /// unescapedLiteralString (default to "C:\Users\username"). + public LiteralStringClass(string escapedLiteralString = @"C:\\Users\\username", string unescapedLiteralString = @"C:\Users\username") + { + // use default value if no "escapedLiteralString" provided + this.EscapedLiteralString = escapedLiteralString ?? @"C:\\Users\\username"; + // use default value if no "unescapedLiteralString" provided + this.UnescapedLiteralString = unescapedLiteralString ?? @"C:\Users\username"; + } + + /// + /// Gets or Sets EscapedLiteralString + /// + [DataMember(Name = "escapedLiteralString", EmitDefaultValue = false)] + public string EscapedLiteralString { get; set; } + + /// + /// Gets or Sets UnescapedLiteralString + /// + [DataMember(Name = "unescapedLiteralString", EmitDefaultValue = false)] + public string UnescapedLiteralString { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class LiteralStringClass {\n"); + sb.Append(" EscapedLiteralString: ").Append(EscapedLiteralString).Append("\n"); + sb.Append(" UnescapedLiteralString: ").Append(UnescapedLiteralString).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as LiteralStringClass).AreEqual; + } + + /// + /// Returns true if LiteralStringClass instances are equal + /// + /// Instance of LiteralStringClass to be compared + /// Boolean + public bool Equals(LiteralStringClass input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.EscapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.EscapedLiteralString.GetHashCode(); + } + if (this.UnescapedLiteralString != null) + { + hashCode = (hashCode * 59) + this.UnescapedLiteralString.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MapTest.cs index 3c07f00331a..191f5cca5dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MapTest.cs @@ -170,7 +170,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 9fd3973afb8..b656f39cb32 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -150,10 +150,10 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Model200Response.cs index 938ffce9d00..5bb6f1e6606 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ModelClient.cs index a6746a6136c..bb48bdd33fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs index a620425b08e..637460dc1bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableClass.cs index 57555c37678..f2d06d7f2a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -256,7 +256,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 2c14b4eb0aa..69d866f4ec4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -44,6 +44,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Uuid /// + /// "72f98069-206d-4f12-9f12-3d1e525a8e84" [DataMember(Name = "uuid", EmitDefaultValue = true)] public Guid? Uuid { get; set; } @@ -111,7 +112,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NumberOnly.cs index d7ad1d2e3e6..696be60a644 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -111,7 +111,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 308018f5d23..1b8f6f32e25 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs index 306417b4a86..c3f2e16950a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs @@ -106,6 +106,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets ShipDate /// + /// "2020-02-02T20:20:20.000222Z" [DataMember(Name = "shipDate", EmitDefaultValue = false)] public DateTime ShipDate { get; set; } @@ -189,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/OuterComposite.cs index 53d71534985..c09babfd818 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -131,7 +131,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ParentPet.cs index 06356f5a8f4..805eb998332 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -44,7 +44,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// petType (required) (default to "ParentPet"). - public ParentPet(string petType = "ParentPet") : base(petType) + public ParentPet(string petType = @"ParentPet") : base(petType) { } @@ -108,7 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs index a469a7bcc9f..972280675fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs @@ -115,6 +115,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } @@ -213,7 +214,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 842b87ce4b4..57d3ee6cb81 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 1bf6cf2fdf5..b37143a767b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Return.cs index 250852d067c..2a1b829259a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Return.cs @@ -108,7 +108,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 516766fc2d5..5b9c3e44188 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs index c2b7c540baa..964b8694dfa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 00db6ae40fb..33370c48f51 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -139,7 +139,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SpecialModelName.cs index 8c202780cc1..3dcf2168d5e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Tag.cs index a40a78f7267..c234b5281e5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Tag.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs new file mode 100644 index 00000000000..f0ef7c92d2e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -0,0 +1,120 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordList + /// + [DataContract(Name = "TestCollectionEndingWithWordList")] + public partial class TestCollectionEndingWithWordList : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// value. + public TestCollectionEndingWithWordList(string value = default(string)) + { + this.Value = value; + } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordList {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordList).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordList instances are equal + /// + /// Instance of TestCollectionEndingWithWordList to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordList input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Value != null) + { + hashCode = (hashCode * 59) + this.Value.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs new file mode 100644 index 00000000000..4a611063e1c --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -0,0 +1,120 @@ +/* + * 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 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// TestCollectionEndingWithWordListObject + /// + [DataContract(Name = "TestCollectionEndingWithWordListObject")] + public partial class TestCollectionEndingWithWordListObject : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// testCollectionEndingWithWordList. + public TestCollectionEndingWithWordListObject(List testCollectionEndingWithWordList = default(List)) + { + this.TestCollectionEndingWithWordList = testCollectionEndingWithWordList; + } + + /// + /// Gets or Sets TestCollectionEndingWithWordList + /// + [DataMember(Name = "TestCollectionEndingWithWordList", EmitDefaultValue = false)] + public List TestCollectionEndingWithWordList { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TestCollectionEndingWithWordListObject {\n"); + sb.Append(" TestCollectionEndingWithWordList: ").Append(TestCollectionEndingWithWordList).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as TestCollectionEndingWithWordListObject).AreEqual; + } + + /// + /// Returns true if TestCollectionEndingWithWordListObject instances are equal + /// + /// Instance of TestCollectionEndingWithWordListObject to be compared + /// Boolean + public bool Equals(TestCollectionEndingWithWordListObject input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TestCollectionEndingWithWordList != null) + { + hashCode = (hashCode * 59) + this.TestCollectionEndingWithWordList.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs index 0f384e7452c..c920365754d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/User.cs index 874421d4655..5d0ea337223 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/User.cs @@ -253,7 +253,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs index b050792c062..6658f0098dc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs @@ -141,7 +141,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs index 8a3c713fe6b..2cd7c3f946d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } 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 7625d897d8f..77236614dbe 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 @@ -21,9 +21,9 @@ - - - + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/FILES index 9f81e159fbb..f05700009ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore Org.OpenAPITools.sln README.md +api/openapi.yaml appveyor.yml docs/ApiResponse.md docs/Category.md diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/api/openapi.yaml b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/api/openapi.yaml new file mode 100644 index 00000000000..869c894b5dd --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/api/openapi.yaml @@ -0,0 +1,812 @@ +openapi: 3.0.0 +info: + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io +servers: +- url: http://petstore.swagger.io/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + description: "" + externalDocs: + description: API documentation for the updatePet operation + url: http://petstore.swagger.io/v2/doc/updatePet + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{orderId}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: orderId + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: orderId + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Create user + tags: + - user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - api_key: [] + summary: Delete user + tags: + - user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + security: + - api_key: [] + summary: Updated user + tags: + - user +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Order: + 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: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: + format: int64 + type: integer + name: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + title: Pet category + type: object + xml: + name: Category + User: + 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: + format: int64 + type: integer + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + title: a User + type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet Tag + type: object + xml: + name: Tag + Pet: + 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: + format: int64 + type: integer + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + deprecated: true + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + title: a Pet + type: object + xml: + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + title: An uploaded response + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 6e71720a940..091c7850ccd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs index b657ec45f5a..893e777536b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/Auth/OAuthAuthenticator.cs @@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -88,7 +88,7 @@ namespace Org.OpenAPITools.Client.Auth .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); + var response = await client.PostAsync(request).ConfigureAwait(false); return $"{response.TokenType} {response.AccessToken}"; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ClientUtils.cs index a2cd17c0c2c..8aa6221bd12 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -10,6 +10,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Org.OpenAPITools.Client /// Filename public static string SanitizeFilename(string filename) { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); + Match match = Regex.Match(filename, ".*[/\\](.*)$"); return match.Success ? match.Groups[1].Value : filename; } @@ -115,8 +116,12 @@ namespace Org.OpenAPITools.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/ApiResponse.cs index cc3ceb025cb..5fabc42ec82 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs index e1cd62ca772..7d870f6d86d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs @@ -121,10 +121,10 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // Name (string) pattern - Regex regexName = new Regex(@"^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant); + Regex regexName = new Regex("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant); if (false == regexName.Match(this.Name).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" }); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Order.cs index df6c3d1d138..a5757597084 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Order.cs @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs index feaf8650e28..249ccf70ff0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs @@ -116,6 +116,7 @@ namespace Org.OpenAPITools.Model /// /// Gets or Sets Name /// + /// "doggie" [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } @@ -214,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Tag.cs index d0042987aae..4f4f4949eb1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Tag.cs @@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/User.cs index 8b03a001b07..ba02e3d2f79 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/User.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Model /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 774035168ae..a6f431cde58 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex index f355e74e9ad..0d99c2eea02 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex @@ -14,13 +14,15 @@ defmodule OpenapiPetstore.Model.AllOfWithSingleRef do @type t :: %__MODULE__{ :username => String.t | nil, - :SingleRefType => any() | nil + :SingleRefType => OpenapiPetstore.Model.SingleRefType.t | nil } end defimpl Poison.Decoder, for: OpenapiPetstore.Model.AllOfWithSingleRef do - def decode(value, _options) do + import OpenapiPetstore.Deserializer + def decode(value, options) do value + |> deserialize(:SingleRefType, :struct, OpenapiPetstore.Model.SingleRefType, options) end end diff --git a/samples/client/petstore/erlang-client/.openapi-generator/VERSION b/samples/client/petstore/erlang-client/.openapi-generator/VERSION index 4b448de535c..757e6740040 100644 --- a/samples/client/petstore/erlang-client/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0-SNAPSHOT \ No newline at end of file +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl index 0c40195e7f6..7466253bb67 100644 --- a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl @@ -12,7 +12,6 @@ -define(BASE_URL, <<"/v2">>). %% @doc Add a new pet to the store -%% -spec add_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. add_pet(Ctx, PetstorePet) -> add_pet(Ctx, PetstorePet, #{}). @@ -23,17 +22,16 @@ add_pet(Ctx, PetstorePet, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = post, - Path = [<<"/pet">>], + Path = [?BASE_URL, "/pet"], QS = [], Headers = [], Body1 = PetstorePet, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>, <<"application/xml">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Deletes a pet -%% -spec delete_pet(ctx:ctx(), integer()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. delete_pet(Ctx, PetId) -> delete_pet(Ctx, PetId, #{}). @@ -44,14 +42,14 @@ delete_pet(Ctx, PetId, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = delete, - Path = [<<"/pet/", PetId, "">>], + Path = [?BASE_URL, "/pet/", PetId, ""], QS = [], Headers = []++petstore_utils:optional_params(['api_key'], _OptionalParams), Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Finds Pets by status %% Multiple status values can be provided with comma separated strings @@ -65,14 +63,14 @@ find_pets_by_status(Ctx, Status, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = get, - Path = [<<"/pet/findByStatus">>], + Path = [?BASE_URL, "/pet/findByStatus"], QS = lists:flatten([[{<<"status">>, X} || X <- Status]])++petstore_utils:optional_params([], _OptionalParams), Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Finds Pets by tags %% Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -86,14 +84,14 @@ find_pets_by_tags(Ctx, Tags, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = get, - Path = [<<"/pet/findByTags">>], + Path = [?BASE_URL, "/pet/findByTags"], QS = lists:flatten([[{<<"tags">>, X} || X <- Tags]])++petstore_utils:optional_params([], _OptionalParams), Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Find pet by ID %% Returns a single pet @@ -107,17 +105,16 @@ get_pet_by_id(Ctx, PetId, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = get, - Path = [<<"/pet/", PetId, "">>], + Path = [?BASE_URL, "/pet/", PetId, ""], QS = [], Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Update an existing pet -%% -spec update_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. update_pet(Ctx, PetstorePet) -> update_pet(Ctx, PetstorePet, #{}). @@ -128,17 +125,16 @@ update_pet(Ctx, PetstorePet, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = put, - Path = [<<"/pet">>], + Path = [?BASE_URL, "/pet"], QS = [], Headers = [], Body1 = PetstorePet, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>, <<"application/xml">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Updates a pet in the store with form data -%% -spec update_pet_with_form(ctx:ctx(), integer()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. update_pet_with_form(Ctx, PetId) -> update_pet_with_form(Ctx, PetId, #{}). @@ -149,17 +145,16 @@ update_pet_with_form(Ctx, PetId, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = post, - Path = [<<"/pet/", PetId, "">>], + Path = [?BASE_URL, "/pet/", PetId, ""], QS = [], Headers = [], Body1 = {form, []++petstore_utils:optional_params(['name', 'status'], _OptionalParams)}, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/x-www-form-urlencoded">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc uploads an image -%% -spec upload_file(ctx:ctx(), integer()) -> {ok, petstore_api_response:petstore_api_response(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. upload_file(Ctx, PetId) -> upload_file(Ctx, PetId, #{}). @@ -170,13 +165,13 @@ upload_file(Ctx, PetId, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = post, - Path = [<<"/pet/", PetId, "/uploadImage">>], + Path = [?BASE_URL, "/pet/", PetId, "/uploadImage"], QS = [], Headers = [], Body1 = {form, []++petstore_utils:optional_params(['additionalMetadata', 'file'], _OptionalParams)}, ContentTypeHeader = petstore_utils:select_header_content_type([<<"multipart/form-data">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). diff --git a/samples/client/petstore/erlang-client/src/petstore_store_api.erl b/samples/client/petstore/erlang-client/src/petstore_store_api.erl index d9ae2c153a8..6000a98469b 100644 --- a/samples/client/petstore/erlang-client/src/petstore_store_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_store_api.erl @@ -19,14 +19,14 @@ delete_order(Ctx, OrderId, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = delete, - Path = [<<"/store/order/", OrderId, "">>], + Path = [?BASE_URL, "/store/order/", OrderId, ""], QS = [], Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Returns pet inventories by status %% Returns a map of status codes to quantities @@ -40,14 +40,14 @@ get_inventory(Ctx, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = get, - Path = [<<"/store/inventory">>], + Path = [?BASE_URL, "/store/inventory"], QS = [], Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Find purchase order by ID %% For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -61,17 +61,16 @@ get_order_by_id(Ctx, OrderId, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = get, - Path = [<<"/store/order/", OrderId, "">>], + Path = [?BASE_URL, "/store/order/", OrderId, ""], QS = [], Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Place an order for a pet -%% -spec place_order(ctx:ctx(), petstore_order:petstore_order()) -> {ok, petstore_order:petstore_order(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. place_order(Ctx, PetstoreOrder) -> place_order(Ctx, PetstoreOrder, #{}). @@ -82,13 +81,13 @@ place_order(Ctx, PetstoreOrder, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = post, - Path = [<<"/store/order">>], + Path = [?BASE_URL, "/store/order"], QS = [], Headers = [], Body1 = PetstoreOrder, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). diff --git a/samples/client/petstore/erlang-client/src/petstore_user_api.erl b/samples/client/petstore/erlang-client/src/petstore_user_api.erl index 7a0da8b56b2..b1fea505c62 100644 --- a/samples/client/petstore/erlang-client/src/petstore_user_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_user_api.erl @@ -23,17 +23,16 @@ create_user(Ctx, PetstoreUser, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = post, - Path = [<<"/user">>], + Path = [?BASE_URL, "/user"], QS = [], Headers = [], Body1 = PetstoreUser, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Creates list of users with given input array -%% -spec create_users_with_array_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. create_users_with_array_input(Ctx, PetstoreUserArray) -> create_users_with_array_input(Ctx, PetstoreUserArray, #{}). @@ -44,17 +43,16 @@ create_users_with_array_input(Ctx, PetstoreUserArray, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = post, - Path = [<<"/user/createWithArray">>], + Path = [?BASE_URL, "/user/createWithArray"], QS = [], Headers = [], Body1 = PetstoreUserArray, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Creates list of users with given input array -%% -spec create_users_with_list_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. create_users_with_list_input(Ctx, PetstoreUserArray) -> create_users_with_list_input(Ctx, PetstoreUserArray, #{}). @@ -65,14 +63,14 @@ create_users_with_list_input(Ctx, PetstoreUserArray, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = post, - Path = [<<"/user/createWithList">>], + Path = [?BASE_URL, "/user/createWithList"], QS = [], Headers = [], Body1 = PetstoreUserArray, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Delete user %% This can only be done by the logged in user. @@ -86,17 +84,16 @@ delete_user(Ctx, Username, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = delete, - Path = [<<"/user/", Username, "">>], + Path = [?BASE_URL, "/user/", Username, ""], QS = [], Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Get user by user name -%% -spec get_user_by_name(ctx:ctx(), binary()) -> {ok, petstore_user:petstore_user(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. get_user_by_name(Ctx, Username) -> get_user_by_name(Ctx, Username, #{}). @@ -107,17 +104,16 @@ get_user_by_name(Ctx, Username, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = get, - Path = [<<"/user/", Username, "">>], + Path = [?BASE_URL, "/user/", Username, ""], QS = [], Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Logs user into the system -%% -spec login_user(ctx:ctx(), binary(), binary()) -> {ok, binary(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. login_user(Ctx, Username, Password) -> login_user(Ctx, Username, Password, #{}). @@ -128,17 +124,16 @@ login_user(Ctx, Username, Password, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = get, - Path = [<<"/user/login">>], + Path = [?BASE_URL, "/user/login"], QS = lists:flatten([{<<"username">>, Username}, {<<"password">>, Password}])++petstore_utils:optional_params([], _OptionalParams), Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Logs out current logged in user session -%% -spec logout_user(ctx:ctx()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. logout_user(Ctx) -> logout_user(Ctx, #{}). @@ -149,14 +144,14 @@ logout_user(Ctx, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = get, - Path = [<<"/user/logout">>], + Path = [?BASE_URL, "/user/logout"], QS = [], Headers = [], Body1 = [], ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). %% @doc Updated user %% This can only be done by the logged in user. @@ -170,13 +165,13 @@ update_user(Ctx, Username, PetstoreUser, Optional) -> Cfg = maps:get(cfg, Optional, application:get_env(petstore_api, config, #{})), Method = put, - Path = [<<"/user/", Username, "">>], + Path = [?BASE_URL, "/user/", Username, ""], QS = [], Headers = [], Body1 = PetstoreUser, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), - petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). + petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). diff --git a/samples/client/petstore/erlang-client/src/petstore_utils.erl b/samples/client/petstore/erlang-client/src/petstore_utils.erl index b96ec3da5ad..ec44cf3068b 100644 --- a/samples/client/petstore/erlang-client/src/petstore_utils.erl +++ b/samples/client/petstore/erlang-client/src/petstore_utils.erl @@ -11,7 +11,8 @@ request(_Ctx, Method, Path, QS, Headers, Body, Opts, Cfg) -> {Headers1, QS1} = update_params_with_auth(Cfg, Headers, QS), Host = maps:get(host, Cfg, "localhost:8001"), - Url = hackney_url:make_url(Host, Path, QS1), + Path1 = prepare_path(Path), + Url = hackney_url:make_url(Host, Path1, QS1), ConfigHackneyOpts = maps:get(hackney_opts, Cfg, []), Body1 = case lists:keyfind(<<"Content-Type">>, 1, Headers1) of @@ -38,6 +39,14 @@ request(_Ctx, Method, Path, QS, Headers, Body, Opts, Cfg) -> headers => RespHeaders}} end. +prepare_path(Path) -> + lists:map(fun convert/1, Path). + +convert(PathPart) when is_integer(PathPart) -> + integer_to_binary(PathPart); +convert(PathPart) when is_list(PathPart) or is_binary(PathPart) -> + PathPart. + decode_response(Headers, Body) -> case lists:keyfind(<<"Content-Type">>, 1, Headers) of {_, <<"application/json", _/binary>>} -> @@ -72,12 +81,12 @@ auth_with_prefix(Cfg, Key, Token) -> update_params_with_auth(Cfg, Headers, QS) -> AuthSettings = maps:get(auth, Cfg, #{}), - Auths = #{ 'api_key' => - #{type => 'apiKey', - key => <<"api_key">>, - in => header}, 'petstore_auth' => + Auths = #{ 'petstore_auth' => #{type => 'oauth2', key => <<"Authorization">>, + in => header}, 'api_key' => + #{type => 'apiKey', + key => <<"api_key">>, in => header}}, maps:fold(fun(AuthName, #{type := _Type, diff --git a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION index 6555596f931..757e6740040 100644 --- a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.0-SNAPSHOT \ No newline at end of file +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-proper/src/petstore_api.erl b/samples/client/petstore/erlang-proper/src/petstore_api.erl index b45cf6a1607..c7f847e86cc 100644 --- a/samples/client/petstore/erlang-proper/src/petstore_api.erl +++ b/samples/client/petstore/erlang-proper/src/petstore_api.erl @@ -26,7 +26,6 @@ create_user(PetstoreUser) -> petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). %% @doc Creates list of users with given input array -%% -spec create_users_with_array_input(list(petstore_user:petstore_user())) -> petstore_utils:response(). create_users_with_array_input(PetstoreUserArray) -> @@ -39,7 +38,6 @@ create_users_with_array_input(PetstoreUserArray) -> petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). %% @doc Creates list of users with given input array -%% -spec create_users_with_list_input(list(petstore_user:petstore_user())) -> petstore_utils:response(). create_users_with_list_input(PetstoreUserArray) -> @@ -63,7 +61,6 @@ delete_user(Username) -> petstore_utils:request(Method, [Host, ?BASE_URL, Path]). %% @doc Get user by user name -%% -spec get_user_by_name(binary()) -> petstore_utils:response(). get_user_by_name(Username) -> @@ -74,7 +71,6 @@ get_user_by_name(Username) -> petstore_utils:request(Method, [Host, ?BASE_URL, Path]). %% @doc Logs user into the system -%% -spec login_user(binary(), binary()) -> petstore_utils:response(). login_user(Username, Password) -> @@ -86,7 +82,6 @@ login_user(Username, Password) -> petstore_utils:request(Method, [Host, ?BASE_URL, Path, <<"?">>, QueryString]). %% @doc Logs out current logged in user session -%% -spec logout_user() -> petstore_utils:response(). logout_user() -> diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index bf4e180c44f..3209cfd0181 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -672,16 +672,17 @@ func formatErrorMessage(status string, v interface{}) string { str := "" metaValue := reflect.ValueOf(v).Elem() - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } } - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - - // status title (detail) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } 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 eabab3d7438..c557a4008cb 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 @@ -19,7 +19,7 @@ class Pet { List photoUrls = new ArrayList<>() - List tags = new ArrayList<>() + List tags /* pet status in the store */ String status } diff --git a/samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md b/samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md index 0a9e61bc682..4146d56a372 100644 --- a/samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md +++ b/samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**username** | **String** | | [optional] | -|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java index 36ecf9c54f6..52742a478bb 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java @@ -20,8 +20,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; diff --git a/samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md b/samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md index 0a9e61bc682..4146d56a372 100644 --- a/samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md +++ b/samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**username** | **String** | | [optional] | -|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java index 36ecf9c54f6..52742a478bb 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java @@ -20,8 +20,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 907f4e4be0a..2c283feec16 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -101,3 +101,4 @@ public class AdditionalPropertiesAnyType extends HashMap { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 75d43481bab..20ad4fd7039 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -102,3 +102,4 @@ public class AdditionalPropertiesArray extends HashMap { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 9eee8f95f51..793b63a7dbe 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -101,3 +101,4 @@ public class AdditionalPropertiesBoolean extends HashMap { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 36365c4ff1c..09909a079fc 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -444,3 +444,4 @@ public class AdditionalPropertiesClass { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index cd8ef08023e..3e1bd4582f6 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -101,3 +101,4 @@ public class AdditionalPropertiesInteger extends HashMap { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index c6a441aa064..1c33885b254 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -102,3 +102,4 @@ public class AdditionalPropertiesNumber extends HashMap { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 5b89cda02cf..bba1f9ec9e3 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -101,3 +101,4 @@ public class AdditionalPropertiesObject extends HashMap { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index b7f59b0229d..26ea43071f3 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -101,3 +101,4 @@ public class AdditionalPropertiesString extends HashMap { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java index 5114c4ebd29..0afb6fac1d9 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java @@ -161,3 +161,4 @@ public class Animal { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index fadb79c8c54..d8bcd06844b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -107,3 +107,4 @@ public class ArrayOfArrayOfNumberOnly { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index d10cbe105bd..3adddc81191 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -107,3 +107,4 @@ public class ArrayOfNumberOnly { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java index f81d676585c..741e1a6ff8d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java @@ -179,3 +179,4 @@ public class ArrayTest { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java index 369bc324e65..d1fc9f788db 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java @@ -139,3 +139,4 @@ public class BigCat extends Cat { return visitor.visitBigCat(this); } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java index f303a9ebc69..526c109adc1 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -132,3 +132,4 @@ public class BigCatAllOf { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java index 5ffd100f25a..22c68b07adc 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java @@ -236,3 +236,4 @@ public class Capitalization { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java index c45811094b2..b7a4167f879 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java @@ -104,3 +104,4 @@ public class Cat extends Animal { return visitor.visitCat(this); } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java index 87d4c30e74f..85c7c389bb0 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java @@ -97,3 +97,4 @@ public class CatAllOf { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java index 91352eb0d09..fb919fde9b1 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java @@ -124,3 +124,4 @@ public class Category { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java index 4ed9eb6e21c..c2b9c29a362 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java @@ -96,3 +96,4 @@ public class ClassModel { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java index d328e83b9ec..9635972df07 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java @@ -104,3 +104,4 @@ public class Dog extends Animal { return visitor.visitDog(this); } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java index e4af0ea8e8d..56c83ee99a4 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java @@ -97,3 +97,4 @@ public class DogAllOf { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java index 60ea312f8b8..fcaa8a81eca 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java @@ -200,3 +200,4 @@ public class EnumArrays { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java index ec6a2594159..9f9a95ca704 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java @@ -344,3 +344,4 @@ public class EnumTest { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 73a1631da7d..f15ad8e478d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -136,3 +136,4 @@ public class FileSchemaTestClass { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java index c1f33ed5d02..1929ddf3f6b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java @@ -492,3 +492,4 @@ public class FormatTest { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 294cfbe27ae..8816857e282 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -103,3 +103,4 @@ public class HasOnlyReadOnly { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java index 9856c0c8ae8..169227ff058 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java @@ -247,3 +247,4 @@ public class MapTest { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 413b142da0d..4b0a89e46ec 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -167,3 +167,4 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java index f5b12136a71..1fc1eac5970 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java @@ -125,3 +125,4 @@ public class Model200Response { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java index 8ad4e9443d0..4d3e3bddbd5 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -153,3 +153,4 @@ public class ModelApiResponse { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java index 79590740b8b..b2822eca530 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java @@ -97,3 +97,4 @@ public class ModelClient { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java index 8e0a521983c..bf2d278e6a9 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java @@ -97,3 +97,4 @@ public class ModelFile { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java index e35a6b61545..ae7f788961d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java @@ -97,3 +97,4 @@ public class ModelList { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java index 648b21603cf..b7ae844f1ef 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java @@ -97,3 +97,4 @@ public class ModelReturn { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java index 51914b985b7..01a237f2ac7 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java @@ -158,3 +158,4 @@ public class Name { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java index abd009b546d..8559de7a52c 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java @@ -97,3 +97,4 @@ public class NumberOnly { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java index 82be9f4c1e2..4a9d5181db5 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java @@ -273,3 +273,4 @@ public class Order { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java index 5b390f83312..12b7229b3ce 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java @@ -153,3 +153,4 @@ public class OuterComposite { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java index 56e43b48d0d..449e8f5b444 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java @@ -292,3 +292,4 @@ public class Pet { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java index c1ec89b33b2..1cc19c26409 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -113,3 +113,4 @@ public class ReadOnlyFirst { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java index e4bc0ecf874..224b4cc8b9c 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java @@ -97,3 +97,4 @@ public class SpecialModelName { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java index 91bf95a9362..d58523d6894 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java @@ -124,3 +124,4 @@ public class Tag { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java index 37daa7895c8..2923740e488 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -216,3 +216,4 @@ public class TypeHolderDefault { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java index 1756fe9a085..32955fd70e8 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -244,3 +244,4 @@ public class TypeHolderExample { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java index 42bd0258eef..b3549c2f8a9 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java @@ -292,3 +292,4 @@ public class User { } } + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java index c241ee3adf7..6c905e2bd1b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java @@ -955,3 +955,4 @@ public class XmlItem { } } + diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 2828944e554..97b8e4c677a 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1507,6 +1507,9 @@ components: - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' propertyName: className properties: className: diff --git a/samples/client/petstore/java/apache-httpclient/docs/AllOfWithSingleRef.md b/samples/client/petstore/java/apache-httpclient/docs/AllOfWithSingleRef.md index 0a9e61bc682..4146d56a372 100644 --- a/samples/client/petstore/java/apache-httpclient/docs/AllOfWithSingleRef.md +++ b/samples/client/petstore/java/apache-httpclient/docs/AllOfWithSingleRef.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**username** | **String** | | [optional] | -|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 3a0c4c5ef77..81c2b245a5b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; +import org.openapitools.jackson.nullable.JsonNullableModule; import org.apache.hc.client5.http.cookie.BasicCookieStore; import org.apache.hc.client5.http.cookie.Cookie; @@ -163,6 +164,7 @@ public class ApiClient extends JavaTimeFormatter { objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); objectMapper.registerModule(new JavaTimeModule()); + objectMapper.registerModule(new JsonNullableModule()); objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 6f6e9b8ed1e..c4a27c424a8 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -24,6 +24,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,6 +32,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AnotherFakeApi { + + private ApiClient apiClient; public AnotherFakeApi() { @@ -57,6 +60,19 @@ public class AnotherFakeApi { * @throws ApiException if fails to make API call */ public Client call123testSpecialTags(Client client) throws ApiException { + return this.call123testSpecialTags(client, Collections.emptyMap()); + } + + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @param additionalHeaders additionalHeaders for this call + * @return Client + * @throws ApiException if fails to make API call + */ + public Client call123testSpecialTags(Client client, Map additionalHeaders) throws ApiException { Object localVarPostBody = client; // verify the required parameter 'client' is set @@ -76,6 +92,8 @@ public class AnotherFakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -107,4 +125,5 @@ public class AnotherFakeApi { localVarReturnType ); } + } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/DefaultApi.java index 6045a630c1d..b037b033b08 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -24,6 +24,7 @@ import org.openapitools.client.model.FooGetDefaultResponse; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,6 +32,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DefaultApi { + + private ApiClient apiClient; public DefaultApi() { @@ -56,6 +59,18 @@ public class DefaultApi { * @throws ApiException if fails to make API call */ public FooGetDefaultResponse fooGet() throws ApiException { + return this.fooGet(Collections.emptyMap()); + } + + + /** + * + * + * @param additionalHeaders additionalHeaders for this call + * @return FooGetDefaultResponse + * @throws ApiException if fails to make API call + */ + public FooGetDefaultResponse fooGet(Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -70,6 +85,8 @@ public class DefaultApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -101,4 +118,5 @@ public class DefaultApi { localVarReturnType ); } + } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java index 18f8b7d6d77..727d782fb9d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -35,6 +35,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -42,6 +43,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FakeApi { + + private ApiClient apiClient; public FakeApi() { @@ -67,6 +70,18 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public HealthCheckResult fakeHealthGet() throws ApiException { + return this.fakeHealthGet(Collections.emptyMap()); + } + + + /** + * Health check endpoint + * + * @param additionalHeaders additionalHeaders for this call + * @return HealthCheckResult + * @throws ApiException if fails to make API call + */ + public HealthCheckResult fakeHealthGet(Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -81,6 +96,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -112,6 +129,7 @@ public class FakeApi { localVarReturnType ); } + /** * test http signature authentication * @@ -121,6 +139,20 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public void fakeHttpSignatureTest(Pet pet, String query1, String header1) throws ApiException { + this.fakeHttpSignatureTest(pet, query1, header1, Collections.emptyMap()); + } + + + /** + * test http signature authentication + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void fakeHttpSignatureTest(Pet pet, String query1, String header1, Map additionalHeaders) throws ApiException { Object localVarPostBody = pet; // verify the required parameter 'pet' is set @@ -143,6 +175,8 @@ public class FakeApi { if (header1 != null) localVarHeaderParams.put("header_1", apiClient.parameterToString(header1)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -173,6 +207,7 @@ public class FakeApi { null ); } + /** * * Test serialization of outer boolean types @@ -181,6 +216,19 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + return this.fakeOuterBooleanSerialize(body, Collections.emptyMap()); + } + + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param additionalHeaders additionalHeaders for this call + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(Boolean body, Map additionalHeaders) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -195,6 +243,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -226,6 +276,7 @@ public class FakeApi { localVarReturnType ); } + /** * * Test serialization of object with outer number type @@ -234,6 +285,19 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + return this.fakeOuterCompositeSerialize(outerComposite, Collections.emptyMap()); + } + + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @param additionalHeaders additionalHeaders for this call + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite, Map additionalHeaders) throws ApiException { Object localVarPostBody = outerComposite; // create path and map variables @@ -248,6 +312,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -279,6 +345,7 @@ public class FakeApi { localVarReturnType ); } + /** * * Test serialization of outer number types @@ -287,6 +354,19 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + return this.fakeOuterNumberSerialize(body, Collections.emptyMap()); + } + + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param additionalHeaders additionalHeaders for this call + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body, Map additionalHeaders) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -301,6 +381,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -332,6 +414,7 @@ public class FakeApi { localVarReturnType ); } + /** * * Test serialization of outer string types @@ -340,6 +423,19 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public String fakeOuterStringSerialize(String body) throws ApiException { + return this.fakeOuterStringSerialize(body, Collections.emptyMap()); + } + + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(String body, Map additionalHeaders) throws ApiException { Object localVarPostBody = body; // create path and map variables @@ -354,6 +450,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -385,6 +483,7 @@ public class FakeApi { localVarReturnType ); } + /** * * Test serialization of enum (int) properties with examples @@ -393,6 +492,19 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws ApiException { + return this.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, Collections.emptyMap()); + } + + + /** + * + * Test serialization of enum (int) properties with examples + * @param outerObjectWithEnumProperty Input enum (int) as post body (required) + * @param additionalHeaders additionalHeaders for this call + * @return OuterObjectWithEnumProperty + * @throws ApiException if fails to make API call + */ + public OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty, Map additionalHeaders) throws ApiException { Object localVarPostBody = outerObjectWithEnumProperty; // verify the required parameter 'outerObjectWithEnumProperty' is set @@ -412,6 +524,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -443,6 +557,7 @@ public class FakeApi { localVarReturnType ); } + /** * * For this test, the body has to be a binary file. @@ -450,6 +565,18 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public void testBodyWithBinary(File body) throws ApiException { + this.testBodyWithBinary(body, Collections.emptyMap()); + } + + + /** + * + * For this test, the body has to be a binary file. + * @param body image to upload (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testBodyWithBinary(File body, Map additionalHeaders) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -469,6 +596,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -499,6 +628,7 @@ public class FakeApi { null ); } + /** * * For this test, the body for this request must reference a schema named `File`. @@ -506,6 +636,18 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException { + this.testBodyWithFileSchema(fileSchemaTestClass, Collections.emptyMap()); + } + + + /** + * + * For this test, the body for this request must reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass, Map additionalHeaders) throws ApiException { Object localVarPostBody = fileSchemaTestClass; // verify the required parameter 'fileSchemaTestClass' is set @@ -525,6 +667,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -555,6 +699,7 @@ public class FakeApi { null ); } + /** * * @@ -563,6 +708,19 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public void testBodyWithQueryParams(String query, User user) throws ApiException { + this.testBodyWithQueryParams(query, user, Collections.emptyMap()); + } + + + /** + * + * + * @param query (required) + * @param user (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testBodyWithQueryParams(String query, User user, Map additionalHeaders) throws ApiException { Object localVarPostBody = user; // verify the required parameter 'query' is set @@ -588,6 +746,8 @@ public class FakeApi { localVarQueryParams.addAll(apiClient.parameterToPair("query", query)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -618,6 +778,7 @@ public class FakeApi { null ); } + /** * To test \"client\" model * To test \"client\" model @@ -626,6 +787,19 @@ public class FakeApi { * @throws ApiException if fails to make API call */ public Client testClientModel(Client client) throws ApiException { + return this.testClientModel(client, Collections.emptyMap()); + } + + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @param additionalHeaders additionalHeaders for this call + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testClientModel(Client client, Map additionalHeaders) throws ApiException { Object localVarPostBody = client; // verify the required parameter 'client' is set @@ -645,6 +819,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -676,6 +852,7 @@ public class FakeApi { localVarReturnType ); } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -696,6 +873,31 @@ public class FakeApi { * @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 { + this.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, Collections.emptyMap()); + } + + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @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) + * @param additionalHeaders additionalHeaders for this call + * @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, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'number' is set @@ -730,6 +932,8 @@ public class FakeApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + if (integer != null) localVarFormParams.put("integer", integer); @@ -788,6 +992,7 @@ if (paramCallback != null) null ); } + /** * To test enum parameters * To test enum parameters @@ -803,6 +1008,26 @@ if (paramCallback != null) * @throws ApiException if fails to make API call */ public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws ApiException { + this.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, Collections.emptyMap()); + } + + + /** + * 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 enumQueryModelArray (optional + * @param enumFormStringArray Form parameter enum test (string array) (optional + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -826,6 +1051,8 @@ if (paramCallback != null) if (enumHeaderString != null) localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + localVarHeaderParams.putAll(additionalHeaders); + if (enumFormStringArray != null) localVarFormParams.put("enum_form_string_array", enumFormStringArray); @@ -860,6 +1087,7 @@ if (enumFormString != null) null ); } + /** * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -872,6 +1100,23 @@ if (enumFormString != null) * @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 { + this.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, Collections.emptyMap()); + } + + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set @@ -909,6 +1154,8 @@ if (enumFormString != null) if (booleanGroup != null) localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -939,6 +1186,7 @@ if (booleanGroup != null) null ); } + /** * test inline additionalProperties * @@ -946,6 +1194,18 @@ if (booleanGroup != null) * @throws ApiException if fails to make API call */ public void testInlineAdditionalProperties(Map requestBody) throws ApiException { + this.testInlineAdditionalProperties(requestBody, Collections.emptyMap()); + } + + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testInlineAdditionalProperties(Map requestBody, Map additionalHeaders) throws ApiException { Object localVarPostBody = requestBody; // verify the required parameter 'requestBody' is set @@ -965,6 +1225,8 @@ if (booleanGroup != null) Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -995,6 +1257,7 @@ if (booleanGroup != null) null ); } + /** * test json serialization of form data * @@ -1003,6 +1266,19 @@ if (booleanGroup != null) * @throws ApiException if fails to make API call */ public void testJsonFormData(String param, String param2) throws ApiException { + this.testJsonFormData(param, param2, Collections.emptyMap()); + } + + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testJsonFormData(String param, String param2, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'param' is set @@ -1027,6 +1303,8 @@ if (booleanGroup != null) Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + if (param != null) localVarFormParams.put("param", param); @@ -1061,6 +1339,7 @@ if (param2 != null) null ); } + /** * * To test the collection format in query parameters @@ -1074,6 +1353,24 @@ if (param2 != null) * @throws ApiException if fails to make API call */ public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws ApiException { + this.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, Collections.emptyMap()); + } + + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param allowEmpty (required) + * @param language (optional + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'pipe' is set @@ -1125,6 +1422,8 @@ if (param2 != null) localVarQueryParams.addAll(apiClient.parameterToPair("language", language)); localVarQueryParams.addAll(apiClient.parameterToPair("allowEmpty", allowEmpty)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -1155,4 +1454,5 @@ if (param2 != null) null ); } + } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 4e3839ffdf7..dd68819959f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -24,6 +24,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,6 +32,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FakeClassnameTags123Api { + + private ApiClient apiClient; public FakeClassnameTags123Api() { @@ -57,6 +60,19 @@ public class FakeClassnameTags123Api { * @throws ApiException if fails to make API call */ public Client testClassname(Client client) throws ApiException { + return this.testClassname(client, Collections.emptyMap()); + } + + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @param additionalHeaders additionalHeaders for this call + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testClassname(Client client, Map additionalHeaders) throws ApiException { Object localVarPostBody = client; // verify the required parameter 'client' is set @@ -76,6 +92,8 @@ public class FakeClassnameTags123Api { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -107,4 +125,5 @@ public class FakeClassnameTags123Api { localVarReturnType ); } + } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/PetApi.java index 1da9b5cc1d1..e9b323aaf11 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -27,6 +27,7 @@ import java.util.Set; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -34,6 +35,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class PetApi { + + private ApiClient apiClient; public PetApi() { @@ -59,6 +62,18 @@ public class PetApi { * @throws ApiException if fails to make API call */ public void addPet(Pet pet) throws ApiException { + this.addPet(pet, Collections.emptyMap()); + } + + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void addPet(Pet pet, Map additionalHeaders) throws ApiException { Object localVarPostBody = pet; // verify the required parameter 'pet' is set @@ -78,6 +93,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -108,6 +125,7 @@ public class PetApi { null ); } + /** * Deletes a pet * @@ -116,6 +134,19 @@ public class PetApi { * @throws ApiException if fails to make API call */ public void deletePet(Long petId, String apiKey) throws ApiException { + this.deletePet(petId, apiKey, Collections.emptyMap()); + } + + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deletePet(Long petId, String apiKey, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -138,6 +169,8 @@ public class PetApi { if (apiKey != null) localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -168,6 +201,7 @@ public class PetApi { null ); } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -176,6 +210,19 @@ public class PetApi { * @throws ApiException if fails to make API call */ public List findPetsByStatus(List status) throws ApiException { + return this.findPetsByStatus(status, Collections.emptyMap()); + } + + + /** + * 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 (required) + * @param additionalHeaders additionalHeaders for this call + * @return List<Pet> + * @throws ApiException if fails to make API call + */ + public List findPetsByStatus(List status, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'status' is set @@ -196,6 +243,8 @@ public class PetApi { localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -227,6 +276,7 @@ public class PetApi { localVarReturnType ); } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -237,6 +287,21 @@ public class PetApi { */ @Deprecated public Set findPetsByTags(Set tags) throws ApiException { + return this.findPetsByTags(tags, Collections.emptyMap()); + } + + + /** + * 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 (required) + * @param additionalHeaders additionalHeaders for this call + * @return Set<Pet> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public Set findPetsByTags(Set tags, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'tags' is set @@ -257,6 +322,8 @@ public class PetApi { localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -288,6 +355,7 @@ public class PetApi { localVarReturnType ); } + /** * Find pet by ID * Returns a single pet @@ -296,6 +364,19 @@ public class PetApi { * @throws ApiException if fails to make API call */ public Pet getPetById(Long petId) throws ApiException { + return this.getPetById(petId, Collections.emptyMap()); + } + + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @param additionalHeaders additionalHeaders for this call + * @return Pet + * @throws ApiException if fails to make API call + */ + public Pet getPetById(Long petId, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -316,6 +397,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -347,6 +430,7 @@ public class PetApi { localVarReturnType ); } + /** * Update an existing pet * @@ -354,6 +438,18 @@ public class PetApi { * @throws ApiException if fails to make API call */ public void updatePet(Pet pet) throws ApiException { + this.updatePet(pet, Collections.emptyMap()); + } + + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updatePet(Pet pet, Map additionalHeaders) throws ApiException { Object localVarPostBody = pet; // verify the required parameter 'pet' is set @@ -373,6 +469,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -403,6 +501,7 @@ public class PetApi { null ); } + /** * Updates a pet in the store with form data * @@ -412,6 +511,20 @@ public class PetApi { * @throws ApiException if fails to make API call */ public void updatePetWithForm(Long petId, String name, String status) throws ApiException { + this.updatePetWithForm(petId, name, status, Collections.emptyMap()); + } + + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updatePetWithForm(Long petId, String name, String status, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -432,6 +545,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + if (name != null) localVarFormParams.put("name", name); @@ -466,6 +581,7 @@ if (status != null) null ); } + /** * uploads an image * @@ -476,6 +592,21 @@ if (status != null) * @throws ApiException if fails to make API call */ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException { + return this.uploadFile(petId, additionalMetadata, _file, Collections.emptyMap()); + } + + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @param additionalHeaders additionalHeaders for this call + * @return ModelApiResponse + * @throws ApiException if fails to make API call + */ + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -496,6 +627,8 @@ if (status != null) Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); @@ -531,6 +664,7 @@ if (_file != null) localVarReturnType ); } + /** * uploads an image (required) * @@ -541,6 +675,21 @@ if (_file != null) * @throws ApiException if fails to make API call */ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + return this.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, Collections.emptyMap()); + } + + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param additionalHeaders additionalHeaders for this call + * @return ModelApiResponse + * @throws ApiException if fails to make API call + */ + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -566,6 +715,8 @@ if (_file != null) Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); @@ -601,4 +752,5 @@ if (requiredFile != null) localVarReturnType ); } + } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/StoreApi.java index 5ecd834878a..2c21005990f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -24,6 +24,7 @@ import org.openapitools.client.model.Order; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,6 +32,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class StoreApi { + + private ApiClient apiClient; public StoreApi() { @@ -56,6 +59,18 @@ public class StoreApi { * @throws ApiException if fails to make API call */ public void deleteOrder(String orderId) throws ApiException { + this.deleteOrder(orderId, Collections.emptyMap()); + } + + + /** + * 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 (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteOrder(String orderId, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'orderId' is set @@ -76,6 +91,8 @@ public class StoreApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -106,6 +123,7 @@ public class StoreApi { null ); } + /** * Returns pet inventories by status * Returns a map of status codes to quantities @@ -113,6 +131,18 @@ public class StoreApi { * @throws ApiException if fails to make API call */ public Map getInventory() throws ApiException { + return this.getInventory(Collections.emptyMap()); + } + + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param additionalHeaders additionalHeaders for this call + * @return Map<String, Integer> + * @throws ApiException if fails to make API call + */ + public Map getInventory(Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -127,6 +157,8 @@ public class StoreApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -158,6 +190,7 @@ public class StoreApi { localVarReturnType ); } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -166,6 +199,19 @@ public class StoreApi { * @throws ApiException if fails to make API call */ public Order getOrderById(Long orderId) throws ApiException { + return this.getOrderById(orderId, Collections.emptyMap()); + } + + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param additionalHeaders additionalHeaders for this call + * @return Order + * @throws ApiException if fails to make API call + */ + public Order getOrderById(Long orderId, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'orderId' is set @@ -186,6 +232,8 @@ public class StoreApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -217,6 +265,7 @@ public class StoreApi { localVarReturnType ); } + /** * Place an order for a pet * @@ -225,6 +274,19 @@ public class StoreApi { * @throws ApiException if fails to make API call */ public Order placeOrder(Order order) throws ApiException { + return this.placeOrder(order, Collections.emptyMap()); + } + + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @param additionalHeaders additionalHeaders for this call + * @return Order + * @throws ApiException if fails to make API call + */ + public Order placeOrder(Order order, Map additionalHeaders) throws ApiException { Object localVarPostBody = order; // verify the required parameter 'order' is set @@ -244,6 +306,8 @@ public class StoreApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -275,4 +339,5 @@ public class StoreApi { localVarReturnType ); } + } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java index 205427abdb8..f8b7c1ed598 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -25,6 +25,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -32,6 +33,8 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UserApi { + + private ApiClient apiClient; public UserApi() { @@ -57,6 +60,18 @@ public class UserApi { * @throws ApiException if fails to make API call */ public void createUser(User user) throws ApiException { + this.createUser(user, Collections.emptyMap()); + } + + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void createUser(User user, Map additionalHeaders) throws ApiException { Object localVarPostBody = user; // verify the required parameter 'user' is set @@ -76,6 +91,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -106,6 +123,7 @@ public class UserApi { null ); } + /** * Creates list of users with given input array * @@ -113,6 +131,18 @@ public class UserApi { * @throws ApiException if fails to make API call */ public void createUsersWithArrayInput(List user) throws ApiException { + this.createUsersWithArrayInput(user, Collections.emptyMap()); + } + + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void createUsersWithArrayInput(List user, Map additionalHeaders) throws ApiException { Object localVarPostBody = user; // verify the required parameter 'user' is set @@ -132,6 +162,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -162,6 +194,7 @@ public class UserApi { null ); } + /** * Creates list of users with given input array * @@ -169,6 +202,18 @@ public class UserApi { * @throws ApiException if fails to make API call */ public void createUsersWithListInput(List user) throws ApiException { + this.createUsersWithListInput(user, Collections.emptyMap()); + } + + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void createUsersWithListInput(List user, Map additionalHeaders) throws ApiException { Object localVarPostBody = user; // verify the required parameter 'user' is set @@ -188,6 +233,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -218,6 +265,7 @@ public class UserApi { null ); } + /** * Delete user * This can only be done by the logged in user. @@ -225,6 +273,18 @@ public class UserApi { * @throws ApiException if fails to make API call */ public void deleteUser(String username) throws ApiException { + this.deleteUser(username, Collections.emptyMap()); + } + + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void deleteUser(String username, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'username' is set @@ -245,6 +305,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -275,6 +337,7 @@ public class UserApi { null ); } + /** * Get user by user name * @@ -283,6 +346,19 @@ public class UserApi { * @throws ApiException if fails to make API call */ public User getUserByName(String username) throws ApiException { + return this.getUserByName(username, Collections.emptyMap()); + } + + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param additionalHeaders additionalHeaders for this call + * @return User + * @throws ApiException if fails to make API call + */ + public User getUserByName(String username, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'username' is set @@ -303,6 +379,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -334,6 +412,7 @@ public class UserApi { localVarReturnType ); } + /** * Logs user into the system * @@ -343,6 +422,20 @@ public class UserApi { * @throws ApiException if fails to make API call */ public String loginUser(String username, String password) throws ApiException { + return this.loginUser(username, password, Collections.emptyMap()); + } + + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param additionalHeaders additionalHeaders for this call + * @return String + * @throws ApiException if fails to make API call + */ + public String loginUser(String username, String password, Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'username' is set @@ -369,6 +462,8 @@ public class UserApi { localVarQueryParams.addAll(apiClient.parameterToPair("username", username)); localVarQueryParams.addAll(apiClient.parameterToPair("password", password)); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -400,12 +495,24 @@ public class UserApi { localVarReturnType ); } + /** * Logs out current logged in user session * * @throws ApiException if fails to make API call */ public void logoutUser() throws ApiException { + this.logoutUser(Collections.emptyMap()); + } + + + /** + * Logs out current logged in user session + * + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void logoutUser(Map additionalHeaders) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -420,6 +527,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -450,6 +559,7 @@ public class UserApi { null ); } + /** * Updated user * This can only be done by the logged in user. @@ -458,6 +568,19 @@ public class UserApi { * @throws ApiException if fails to make API call */ public void updateUser(String username, User user) throws ApiException { + this.updateUser(username, user, Collections.emptyMap()); + } + + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @param additionalHeaders additionalHeaders for this call + * @throws ApiException if fails to make API call + */ + public void updateUser(String username, User user, Map additionalHeaders) throws ApiException { Object localVarPostBody = user; // verify the required parameter 'username' is set @@ -483,6 +606,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); + localVarHeaderParams.putAll(additionalHeaders); + final String[] localVarAccepts = { @@ -513,4 +638,5 @@ public class UserApi { null ); } + } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index adac805a396..296c9b6f0cf 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -113,7 +113,6 @@ public class AdditionalPropertiesClass { this.mapOfMapProperty = mapOfMapProperty; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 68f60026b89..cdffcd1d521 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -96,7 +96,6 @@ public class AllOfWithSingleRef { this.singleRefType = singleRefType; } - @Override public boolean equals(Object o) { if (this == o) { @@ -180,7 +179,12 @@ public class AllOfWithSingleRef { // add `SingleRefType` to the URL query string if (getSingleRefType() != null) { - joiner.add(getSingleRefType().toUrlQueryString(prefix + "SingleRefType" + suffix)); + try { + joiner.add(String.format("%sSingleRefType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSingleRefType()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } } return joiner.toString(); diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java index 1d37baf0f8c..f84ec477ba4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java @@ -23,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import java.io.UnsupportedEncodingException; @@ -45,8 +43,8 @@ import java.util.StringJoiner; ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), }) public class Animal { @@ -110,7 +108,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c0e0edadabb..1b9d42f423a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index d17bdca9103..2cea68ab8b4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java index 832b2bd3ca8..1e635eba1b1 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -40,13 +40,13 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -152,7 +152,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java index d0716716b6c..bcf75af5368 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -215,7 +215,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java index b3ab6517bc0..bb8aab5e1a8 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java @@ -76,6 +76,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java index 0c3637fdb67..1739765e058 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -66,7 +66,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java index 74267bf6985..3d0cedf0f79 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java @@ -95,7 +95,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java index 3d904821aaa..e125bacd840 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -65,7 +65,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java index 69f45c30e84..1b38c4aa1f1 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Client.java @@ -65,7 +65,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 842bcd1386e..482e19ae2cc 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -67,7 +67,6 @@ public class DeprecatedObject { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java index 055a293ec28..c3517c53c5e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Dog.java @@ -76,6 +76,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java index 8400a2ffeee..80a71d87578 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -66,7 +66,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java index adc690cf3cc..af49ebc57d2 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -111,7 +111,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -175,7 +175,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java index a1ec634cb06..6b6e1dbaf4f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -436,7 +436,6 @@ public class EnumTest { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f8b0436c273..aec83ef8896 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -42,7 +42,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -106,7 +106,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Foo.java index 837f286376b..7c686d88d55 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Foo.java @@ -65,7 +65,6 @@ public class Foo { this.bar = bar; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 24955a1b750..17121fa9900 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -67,7 +67,6 @@ public class FooGetDefaultResponse { this.string = string; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java index ccfa16f1dd3..d7e7bb3b9b5 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -531,7 +531,6 @@ public class FormatTest { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index dbfe98898fe..6247993fce5 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -84,7 +84,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java index cc0e8b04f4a..0eb146772b1 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -77,7 +77,6 @@ public class HealthCheckResult { this.nullableMessage = JsonNullable.of(nullableMessage); } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java index 3760d8ad968..5cda18c154d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -224,7 +224,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index e2338e16854..066b0c87fbb 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -138,7 +138,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java index b5bc68d4e19..d438ec12569 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -96,7 +96,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 0d7a12780e3..1985236191d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -126,7 +126,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java index e14130a295b..69e82c20acd 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -66,7 +66,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java index b58f2e168c5..0b59d681efa 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -66,7 +66,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 1dfb8ee7cf6..03951bf746e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -66,7 +66,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java index 4f699a6939f..dee8e786ca1 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java @@ -143,7 +143,6 @@ public class Name { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NullableClass.java index 78694271007..58d52f86429 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NullableClass.java @@ -81,7 +81,7 @@ public class NullableClass extends HashMap { private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; private JsonNullable> objectNullableProp = JsonNullable.>undefined(); @@ -551,7 +551,6 @@ public class NullableClass extends HashMap { this.objectItemsNullable = objectItemsNullable; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 1e08e1f7c06..8d7a8ac6248 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -66,7 +66,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 7abd9fefce3..9bfb45cd7b4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -51,7 +51,7 @@ public class ObjectWithDeprecatedFields { private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields() { } @@ -173,7 +173,6 @@ public class ObjectWithDeprecatedFields { this.bars = bars; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java index 013f8c3e049..4488adc59c2 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java @@ -253,7 +253,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 2259dfcaacf..8048eacccc2 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -126,7 +126,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 737d1c245d3..7eda42701a6 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -66,7 +66,6 @@ public class OuterObjectWithEnumProperty { this.value = value; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java index 50617daf217..8fcaffb9bd5 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java @@ -59,7 +59,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -189,6 +189,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -273,7 +276,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 0516626bab1..af5604baa0e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -92,7 +92,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index 8783277244d..b7eef066543 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -66,7 +66,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java index b31d271ffbf..0ceb819b58f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java @@ -95,7 +95,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java index ad9710c2340..ffadeb6fac0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java @@ -275,7 +275,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 19f0da1c92e..a1afba9cb00 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -66,7 +66,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index c948a64cacc..686c5ccd028 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -67,7 +67,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index f91ebb3b346..e939b317815 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -66,7 +66,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 87fb4f79616..176e935f8c8 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -431,7 +431,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f4d98959333..06c20e8c176 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -66,7 +66,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index cf4f678d959..6bbbdbd7625 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -67,7 +67,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 201633dceda..e1487c9bf06 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -66,7 +66,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 0b381dc495f..067c225b47b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -66,7 +66,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index d7839c78fb1..7de0d5c3006 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -110,7 +107,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7a041781ff7..fa56b4a6528 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -74,7 +74,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 7a2edc838d5..f0e287e4378 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -74,7 +74,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index 98545291c9b..7641f36ceb1 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -38,13 +38,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -150,7 +150,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index 69efb73e7de..18f44f7aaea 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -113,6 +113,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 144b1a5aae5..5f3150ba5ba 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -103,7 +103,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index a9a64db5019..9d1c067f3eb 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -213,7 +213,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index e4bd0696ec0..a312737a13a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -78,6 +77,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java index fcf57d08fb0..39ca7362a05 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -64,7 +64,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java index 83b8be3ee2a..b8c8ccb7aba 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -93,7 +93,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 1fa0e2d8cfb..641d4fc582e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -63,7 +63,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java index 80fd39a2a8f..f022bec1ccd 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -63,7 +63,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 159bccf4385..f9e4e2cc9d2 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -74,6 +74,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java index 96422b89982..2bc9c54bc58 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -64,7 +64,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index 9e3ff98d5b1..b82cd768460 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -109,7 +109,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -173,7 +173,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 70b56e0182b..86ac4d7ce20 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -329,7 +329,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java index 10ba696ee80..7bbb5f84816 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java @@ -63,7 +63,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 58712d5d89b..fc000552f65 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -40,7 +40,7 @@ public class FileSchemaTestClass { private File file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -104,7 +104,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 54561ed8bc3..5df76617bff 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -469,7 +469,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 73f14f16bbd..381c9962b29 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -82,7 +82,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index 45c189a7393..09eed2279a3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -222,7 +222,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1b5a969aa14..962b2200faa 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -136,7 +136,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index 752885d8302..c357df4ff2b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -94,7 +94,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f5e9cccddfe..5d71f00af0c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -124,7 +124,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java index ac2ffbceb82..e4c68d3d492 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -64,7 +64,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index 94b13ecf8a1..66331c6b51c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -64,7 +64,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java index 6d0f4c454da..a750c0ef9b6 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -141,7 +141,6 @@ public class Name { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index 30df3b665db..dfce53aa917 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -64,7 +64,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java index ade407c9b36..236a4587d26 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -251,7 +251,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index 30bf371f5a2..cb9b86dfa97 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -124,7 +124,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 0f583a5b30c..d821b1bdfa3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -57,7 +57,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -187,6 +187,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -271,7 +274,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 281c41dde3c..ebbee619ef1 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -90,7 +90,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index 24b32fb20ec..a4dad93601b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -64,7 +64,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index ff1ada221e9..3cc444353f5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -93,7 +93,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f5876359ec2..ba0028a3fa9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -168,6 +168,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -191,7 +194,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 9215e28b66d..391fc96908f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -198,6 +198,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -221,7 +224,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java index d8ee684f1c9..f9f542e0906 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -273,7 +273,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index ff655010f92..3bfb826d97e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -76,7 +76,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -91,10 +91,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -109,10 +109,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -127,10 +127,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -145,10 +145,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -978,7 +978,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 2828944e554..97b8e4c677a 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1507,6 +1507,9 @@ components: - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' propertyName: className properties: className: 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 f3ffa9c153a..bb18d6f5c2d 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 @@ -110,7 +110,6 @@ public class AdditionalPropertiesClass { this.mapOfMapProperty = mapOfMapProperty; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 400ef6f1d44..ff55e37f2d7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -93,7 +93,6 @@ public class AllOfWithSingleRef { this.singleRefType = singleRefType; } - @Override public boolean equals(Object o) { if (this == o) { 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 31932c6e681..fd52da7ba5e 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 @@ -23,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -42,8 +40,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), }) public class Animal { @@ -107,7 +105,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 37fe0aed3eb..e68f1d1d56a 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 39e27dda318..b6189104c30 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 dbfe323fd6c..52d07003963 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 @@ -37,13 +37,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -149,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { 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 8f0460343a9..ed4f3970651 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 @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 98b53f1e4fd..7f8797d491d 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 @@ -73,6 +73,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 3bb502a7b29..aeeb26b79c2 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 @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 a78b9d41507..a599f6689ed 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 @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 9870d339058..f5db7231aef 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 @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 314945b1bbb..764697f4191 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 @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 837b1f13e7a..73cccb0d2d3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -64,7 +64,6 @@ public class DeprecatedObject { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 5de0e902a04..f77566c7746 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 @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 55d3afa8167..2978c34e2cc 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 @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 72549699100..13007002025 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 @@ -108,7 +108,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -172,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 17fd4e08549..dc4dbac1001 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 @@ -433,7 +433,6 @@ public class EnumTest { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java index 652898e6d00..1d8fb0178b9 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/File.java @@ -62,7 +62,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { 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 abb204abd00..e9019a2ef31 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 @@ -39,7 +39,7 @@ public class FileSchemaTestClass { private File file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -103,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java index 08d43f2d0b4..0ae068735bd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Foo.java @@ -62,7 +62,6 @@ public class Foo { this.bar = bar; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 64290b3fa02..0626a5810e6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -64,7 +64,6 @@ public class FooGetDefaultResponse { this.string = string; } - @Override public boolean equals(Object o) { if (this == o) { 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 0be153739ce..1efd4270dd5 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 @@ -528,7 +528,6 @@ public class FormatTest { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } - @Override public boolean equals(Object o) { if (this == o) { 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 2b2c88b9156..cdb08919cbf 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 @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java index db52cbac669..b156198397f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -74,7 +74,6 @@ public class HealthCheckResult { this.nullableMessage = JsonNullable.of(nullableMessage); } - @Override public boolean equals(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 045d7b8a085..4070e6e0d39 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 @@ -221,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 b782bb90c22..ad65e2d8fc5 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 @@ -135,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 e376774a161..28ff32d43f0 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 @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4082ed0ada..7cd7d657857 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 @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71e..4d903ec4d45 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 b1cc1b13819..eabe6a173bb 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 @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 07a612c1f00..9af78b50a14 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 @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java index c54aefee932..e5640368c98 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NullableClass.java @@ -78,7 +78,7 @@ public class NullableClass extends HashMap { private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; private JsonNullable> objectNullableProp = JsonNullable.>undefined(); @@ -548,7 +548,6 @@ public class NullableClass extends HashMap { this.objectItemsNullable = objectItemsNullable; } - @Override public boolean equals(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 c57472af9f0..b8453c0e955 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 @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 9fe55b6c03e..718908a08cb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -48,7 +48,7 @@ public class ObjectWithDeprecatedFields { private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields() { } @@ -170,7 +170,6 @@ public class ObjectWithDeprecatedFields { this.bars = bars; } - @Override public boolean equals(Object o) { if (this == o) { 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 09dadb18afa..cadf505edf8 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 @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 93a3a257cda..d036a39e1c5 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 @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index d45896c6839..0b8b5f66164 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -63,7 +63,6 @@ public class OuterObjectWithEnumProperty { this.value = value; } - @Override public boolean equals(Object o) { if (this == o) { 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 403bb06d3e9..3693c1e2cdc 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 @@ -56,7 +56,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -270,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d9dad261bd..9f25b2a6d30 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 @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4ab9de6df5..8c6588d73f4 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 @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ef8add1aada..cf6ef04de76 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 @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 95032c71bc0..b29fba7c1b6 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 @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index a68ffae2eaf..d1b32ac9653 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -65,7 +65,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 e41df9071f4..8fe930dfe2b 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b7e04b01c5..773db816ab8 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 656bc5ced98..46ec07ac55b 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 @@ -430,7 +430,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 38420a93f1a..0e5d01114b1 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 c9dafbb1f03..792fc1bbbe9 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 996c6413244..3f540e7de47 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 d7e667ed8d1..7231ea54b16 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 6c603bf62cf..a40c65533eb 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 @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -109,7 +106,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 37fe0aed3eb..e68f1d1d56a 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 39e27dda318..b6189104c30 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 dbfe323fd6c..52d07003963 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 @@ -37,13 +37,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -149,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java index 7928f0f2d61..e80a952e274 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -112,6 +112,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b..e357e3111ca 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -102,7 +102,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 8f0460343a9..ed4f3970651 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 @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 97ffcf45b25..a0a6af014cd 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 @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -77,6 +76,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 89e6e65c05e..7c404d48482 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 @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 a78b9d41507..a599f6689ed 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 @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 9870d339058..f5db7231aef 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 @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 314945b1bbb..764697f4191 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 @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 5de0e902a04..f77566c7746 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 @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 55d3afa8167..2978c34e2cc 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 @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 72549699100..13007002025 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 @@ -108,7 +108,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -172,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 7ef8de6dfc8..0b2ba27fcb6 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 @@ -328,7 +328,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 bd970475770..a338a0598c8 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 @@ -39,7 +39,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -103,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 ed2ed565601..9831eac4992 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 @@ -468,7 +468,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 2b2c88b9156..cdb08919cbf 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 @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 045d7b8a085..4070e6e0d39 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 @@ -221,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 b782bb90c22..ad65e2d8fc5 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 @@ -135,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 e376774a161..28ff32d43f0 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 @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4082ed0ada..7cd7d657857 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 @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d2..51a513be4a1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,7 +63,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71e..4d903ec4d45 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 b1cc1b13819..eabe6a173bb 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 @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 07a612c1f00..9af78b50a14 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 @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(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 c57472af9f0..b8453c0e955 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 @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 3d0061c01c9..73e649ff1fa 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 @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 445248fface..3a35d693a21 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 @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 403bb06d3e9..3693c1e2cdc 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 @@ -56,7 +56,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -270,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d9dad261bd..9f25b2a6d30 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 @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 0de3b216df4..bedacb16913 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 @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ef8add1aada..cf6ef04de76 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 @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b8352d3c3b..e18abf20e32 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 @@ -167,6 +167,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -190,7 +193,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 af0b85f4118..45ca7506a72 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 @@ -197,6 +197,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -220,7 +223,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 95032c71bc0..b29fba7c1b6 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 @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 bc5780cb632..cf5cce31bc5 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 @@ -75,7 +75,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -90,10 +90,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -108,10 +108,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -126,10 +126,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -144,10 +144,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -977,7 +977,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { 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 a68ffae2eaf..d1b32ac9653 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 e41df9071f4..8fe930dfe2b 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b7e04b01c5..773db816ab8 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 656bc5ced98..46ec07ac55b 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 @@ -430,7 +430,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 38420a93f1a..0e5d01114b1 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 c9dafbb1f03..792fc1bbbe9 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 996c6413244..3f540e7de47 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 d7e667ed8d1..7231ea54b16 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 6c603bf62cf..a40c65533eb 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 @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -109,7 +106,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 37fe0aed3eb..e68f1d1d56a 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 39e27dda318..b6189104c30 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 dbfe323fd6c..52d07003963 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 @@ -37,13 +37,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -149,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java index 7928f0f2d61..e80a952e274 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java @@ -112,6 +112,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b..e357e3111ca 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -102,7 +102,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 8f0460343a9..ed4f3970651 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 @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 97ffcf45b25..a0a6af014cd 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 @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -77,6 +76,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 89e6e65c05e..7c404d48482 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 @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 a78b9d41507..a599f6689ed 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 @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 9870d339058..f5db7231aef 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 @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 314945b1bbb..764697f4191 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 @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 5de0e902a04..f77566c7746 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 @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 55d3afa8167..2978c34e2cc 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 @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 72549699100..13007002025 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 @@ -108,7 +108,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -172,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 7ef8de6dfc8..0b2ba27fcb6 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 @@ -328,7 +328,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 bd970475770..a338a0598c8 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 @@ -39,7 +39,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -103,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 ed2ed565601..9831eac4992 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 @@ -468,7 +468,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 2b2c88b9156..cdb08919cbf 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 @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 045d7b8a085..4070e6e0d39 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 @@ -221,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 b782bb90c22..ad65e2d8fc5 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 @@ -135,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 e376774a161..28ff32d43f0 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 @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4082ed0ada..7cd7d657857 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 @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d2..51a513be4a1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,7 +63,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71e..4d903ec4d45 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 b1cc1b13819..eabe6a173bb 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 @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 07a612c1f00..9af78b50a14 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 @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(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 c57472af9f0..b8453c0e955 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 @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 3d0061c01c9..73e649ff1fa 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 @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 445248fface..3a35d693a21 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 @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 403bb06d3e9..3693c1e2cdc 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 @@ -56,7 +56,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -270,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d9dad261bd..9f25b2a6d30 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 @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 0de3b216df4..bedacb16913 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 @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ef8add1aada..cf6ef04de76 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 @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b8352d3c3b..e18abf20e32 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 @@ -167,6 +167,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -190,7 +193,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 af0b85f4118..45ca7506a72 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 @@ -197,6 +197,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -220,7 +223,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 95032c71bc0..b29fba7c1b6 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 @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 bc5780cb632..cf5cce31bc5 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 @@ -75,7 +75,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -90,10 +90,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -108,10 +108,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -126,10 +126,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -144,10 +144,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -977,7 +977,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java index 13d46665014..6a357bf177a 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java @@ -36,6 +36,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -43,11 +44,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -70,25 +74,26 @@ import org.openapitools.client.auth.OAuth; */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient extends JavaTimeFormatter { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "http://petstore.swagger.io:80/v2"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io:80/v2", - "No description provided", - new HashMap() - ) + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io:80/v2", + "No description provided", + new LinkedHashMap<>() + ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + protected Map> operationServers = new HashMap<>(); + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -125,7 +130,7 @@ public class ApiClient extends JavaTimeFormatter { setUserAgent("OpenAPI-Generator/1.0.0/java"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; if (authMap != null) { auth = authMap.get("petstore_auth"); @@ -163,7 +168,7 @@ public class ApiClient extends JavaTimeFormatter { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap(); + authenticationLookup = new HashMap<>(); } /** @@ -751,7 +756,7 @@ public class ApiClient extends JavaTimeFormatter { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -810,14 +815,13 @@ public class ApiClient extends JavaTimeFormatter { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -829,8 +833,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -850,8 +854,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1143,15 +1147,17 @@ public class ApiClient extends JavaTimeFormatter { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + null, + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1168,7 +1174,7 @@ public class ApiClient extends JavaTimeFormatter { final int statusCode = response.getStatusInfo().getStatusCode(); // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (statusCode == Status.UNAUTHORIZED.getStatusCode()) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1339,10 +1345,10 @@ public class ApiClient extends JavaTimeFormatter { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/JSON.java index 24317dfe36a..8e72ba03553 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/JSON.java @@ -64,7 +64,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -84,7 +84,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -193,12 +193,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 98b6a534086..540cf2cbba3 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,42 +75,16 @@ public class AnotherFakeApi { */ public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags"); } - - // create path and map variables - String localVarPath = "/another-fake/dummy"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", "/another-fake/dummy", "PATCH", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/FakeApi.java index fc418490a4a..9fb0bb1af9d 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/FakeApi.java @@ -20,6 +20,7 @@ import org.openapitools.client.model.XmlItem; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -81,41 +82,16 @@ public class FakeApi { */ public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException { - Object localVarPostBody = xmlItem; - - // verify the required parameter 'xmlItem' is set + // Check required parameters if (xmlItem == null) { throw new ApiException(400, "Missing the required parameter 'xmlItem' when calling createXmlItem"); } - - // create path and map variables - String localVarPath = "/fake/create_xml_item"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.createXmlItem", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"); + return apiClient.invokeAPI("FakeApi.createXmlItem", "/fake/create_xml_item", "POST", new ArrayList<>(), xmlItem, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * @@ -146,38 +122,12 @@ public class FakeApi { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/boolean"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", "/fake/outer/boolean", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -208,38 +158,12 @@ public class FakeApi { */ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/composite"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", "/fake/outer/composite", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -270,38 +194,12 @@ public class FakeApi { */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/number"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", "/fake/outer/number", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -332,38 +230,12 @@ public class FakeApi { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/string"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", "/fake/outer/string", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -393,41 +265,16 @@ public class FakeApi { */ public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithFileSchema"); } - - // create path and map variables - String localVarPath = "/fake/body-with-file-schema"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", "/fake/body-with-file-schema", "PUT", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * @@ -459,47 +306,24 @@ public class FakeApi { */ public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'query' is set + // Check required parameters if (query == null) { throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); } - - // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); } - - // create path and map variables - String localVarPath = "/fake/body-with-query-params"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "query", query) + ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", "/fake/body-with-query-params", "PUT", localVarQueryParams, body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * To test \"client\" model @@ -530,43 +354,17 @@ public class FakeApi { */ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); } - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.testClientModel", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.testClientModel", "/fake", "PATCH", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -624,83 +422,62 @@ public class FakeApi { */ 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, LocalDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'number' is set + // Check required parameters if (number == null) { throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); } - - // verify the required parameter '_double' is set if (_double == null) { throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); } - - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } - - // verify the required parameter '_byte' is set if (_byte == null) { throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - - // create path and map variables - String localVarPath = "/fake"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (integer != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (integer != null) { localVarFormParams.put("integer", integer); -if (int32 != null) + } + if (int32 != null) { localVarFormParams.put("int32", int32); -if (int64 != null) + } + if (int64 != null) { localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) + } + localVarFormParams.put("number", number); + if (_float != null) { localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) + } + localVarFormParams.put("double", _double); + if (string != null) { localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) + } + localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); + localVarFormParams.put("byte", _byte); + if (binary != null) { localVarFormParams.put("binary", binary); -if (date != null) + } + if (date != null) { localVarFormParams.put("date", date); -if (dateTime != null) + } + if (dateTime != null) { localVarFormParams.put("dateTime", dateTime); -if (password != null) + } + if (password != null) { localVarFormParams.put("password", password); -if (paramCallback != null) + } + if (paramCallback != null) { localVarFormParams.put("callback", paramCallback); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "http_basic_test" }; - - return apiClient.invokeAPI("FakeApi.testEndpointParameters", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"http_basic_test"}; + return apiClient.invokeAPI("FakeApi.testEndpointParameters", "/fake", "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -747,104 +524,71 @@ if (paramCallback != null) */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); - if (enumHeaderStringArray != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (enumHeaderStringArray != null) { localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + } + if (enumHeaderString != null) { localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + } - - if (enumFormStringArray != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (enumFormStringArray != null) { localVarFormParams.put("enum_form_string_array", enumFormStringArray); -if (enumFormString != null) + } + if (enumFormString != null) { localVarFormParams.put("enum_form_string", enumFormString); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testEnumParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + return apiClient.invokeAPI("FakeApi.testEnumParameters", "/fake", "GET", localVarQueryParams, null, + localVarHeaderParams, new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + null, null, false); } private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'requiredStringGroup' is set + // Check required parameters if (requiredStringGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); } - - // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); } - - // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - - // create path and map variables - String localVarPath = "/fake"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "required_string_group", requiredStringGroup) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group)); - if (requiredBooleanGroup != null) - localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); -if (booleanGroup != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + if (booleanGroup != null) { localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); + } - - - 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("FakeApi.testGroupParameters", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("FakeApi.testGroupParameters", "/fake", "DELETE", localVarQueryParams, null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } public class APItestGroupParametersRequest { @@ -989,41 +733,16 @@ if (booleanGroup != null) */ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map param) throws ApiException { - Object localVarPostBody = param; - - // verify the required parameter 'param' is set + // Check required parameters if (param == null) { throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); } - - // create path and map variables - String localVarPath = "/fake/inline-additionalProperties"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", "/fake/inline-additionalProperties", "POST", new ArrayList<>(), param, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * test json serialization of form data @@ -1055,50 +774,24 @@ if (booleanGroup != null) */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set + // Check required parameters if (param == null) { throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); } - - // verify the required parameter 'param2' is set if (param2 == null) { throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); } - - // create path and map variables - String localVarPath = "/fake/jsonFormData"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams.put("param", param); + localVarFormParams.put("param2", param2); - - - - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testJsonFormData", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + return apiClient.invokeAPI("FakeApi.testJsonFormData", "/fake/jsonFormData", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + null, null, false); } /** * @@ -1136,65 +829,36 @@ if (param2 != null) */ 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 + // Check required parameters 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-parameters"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "pipe", pipe) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "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("FakeApi.testQueryParameterCollectionFormat", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", "/fake/test-query-parameters", "PUT", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 3123826e28a..08f35e4a742 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,42 +75,17 @@ public class FakeClassnameTags123Api { */ public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); } - - // create path and map variables - String localVarPath = "/fake_classname_test"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key_query" }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key_query"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", "/fake_classname_test", "PATCH", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/PetApi.java index 7317e831e8c..ccc78f9d1ba 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/PetApi.java @@ -15,6 +15,7 @@ import java.util.Set; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -78,40 +79,16 @@ public class PetApi { */ public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); } - - // create path and map variables - String localVarPath = "/pet"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -146,43 +123,26 @@ public class PetApi { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - if (apiKey != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (apiKey != null) { localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + } - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", new ArrayList<>(), null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -216,43 +176,22 @@ public class PetApi { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'status' is set + // Check required parameters if (status == null) { throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); } - - // create path and map variables - String localVarPath = "/pet/findByStatus"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "status", status) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -290,43 +229,22 @@ public class PetApi { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'tags' is set + // Check required parameters if (tags == null) { throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); } - - // create path and map variables - String localVarPath = "/pet/findByTags"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "tags", tags) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -362,43 +280,21 @@ public class PetApi { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -435,40 +331,16 @@ public class PetApi { */ public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); } - - // create path and map variables - String localVarPath = "/pet"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -503,45 +375,29 @@ public class PetApi { */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (name != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (name != null) { localVarFormParams.put("name", name); -if (status != null) + } + if (status != null) { localVarFormParams.put("status", status); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -577,47 +433,30 @@ if (status != null) */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (_file != null) + } + if (_file != null) { localVarFormParams.put("file", _file); + } - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -653,52 +492,31 @@ if (_file != null) */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - - // verify the required parameter 'requiredFile' is set if (requiredFile == null) { throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (requiredFile != null) - localVarFormParams.put("requiredFile", requiredFile); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + } + localVarFormParams.put("requiredFile", requiredFile); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/StoreApi.java index 1f094916301..0552c144390 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/StoreApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Order; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -75,42 +76,20 @@ public class StoreApi { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + .replaceAll("\\{order_id}", apiClient.escapeString(orderId)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("StoreApi.deleteOrder", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Returns pet inventories by status @@ -139,37 +118,12 @@ public class StoreApi { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/inventory"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("StoreApi.getInventory", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("StoreApi.getInventory", "/store/inventory", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -205,44 +159,21 @@ public class StoreApi { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Place an order for a pet @@ -275,42 +206,16 @@ public class StoreApi { */ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); } - - // create path and map variables - String localVarPath = "/store/order"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.placeOrder", "/store/order", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java index a2b14e76422..ade423b52c7 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java @@ -13,6 +13,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,41 +75,16 @@ public class UserApi { */ public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); } - - // create path and map variables - String localVarPath = "/user"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.createUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Creates list of users with given input array @@ -138,41 +114,16 @@ public class UserApi { */ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); } - - // create path and map variables - String localVarPath = "/user/createWithArray"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.createUsersWithArrayInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Creates list of users with given input array @@ -202,41 +153,16 @@ public class UserApi { */ public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); } - - // create path and map variables - String localVarPath = "/user/createWithList"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.createUsersWithListInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Delete user @@ -268,42 +194,20 @@ public class UserApi { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.deleteUser", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Get user by user name @@ -338,44 +242,21 @@ public class UserApi { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{username}", apiClient.escapeString(username)); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs user into the system @@ -410,50 +291,26 @@ public class UserApi { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); } - - // verify the required parameter 'password' is set if (password == null) { throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); } - - // create path and map variables - String localVarPath = "/user/login"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "username", username) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.loginUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.loginUser", "/user/login", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs out current logged in user session @@ -481,36 +338,11 @@ public class UserApi { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/logout"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.logoutUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Updated user @@ -544,46 +376,22 @@ public class UserApi { */ public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - - // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.updateUser", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 28fdbd6e63a..69df9b57e7e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,7 @@ public class AdditionalPropertiesAnyType { @JsonAnySetter public AdditionalPropertiesAnyType putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 59093dc6eba..f9011269ad1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,7 @@ public class AdditionalPropertiesArray { @JsonAnySetter public AdditionalPropertiesArray putAdditionalProperty(String key, List value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 17ed09d84ac..a91038275c7 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,7 @@ public class AdditionalPropertiesBoolean { @JsonAnySetter public AdditionalPropertiesBoolean putAdditionalProperty(String key, Boolean value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index fe558167aca..c14ac4d5810 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,7 @@ public class AdditionalPropertiesInteger { @JsonAnySetter public AdditionalPropertiesInteger putAdditionalProperty(String key, Integer value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 1295699d45a..15c62efed1f 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,7 @@ public class AdditionalPropertiesNumber { @JsonAnySetter public AdditionalPropertiesNumber putAdditionalProperty(String key, BigDecimal value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 47374023df6..556a0ec2b09 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -83,7 +83,7 @@ public class AdditionalPropertiesObject { @JsonAnySetter public AdditionalPropertiesObject putAdditionalProperty(String key, Map value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index e5a9b0f86ae..a4b580f0412 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,7 @@ public class AdditionalPropertiesString { @JsonAnySetter public AdditionalPropertiesString putAdditionalProperty(String key, String value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java index 2920ae422d0..9ace6d0d824 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Animal.java @@ -25,9 +25,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -153,14 +150,14 @@ public class Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("BigCat", BigCat.class); - mappings.put("Cat", Cat.class); - mappings.put("Dog", Dog.class); - mappings.put("Animal", Animal.class); - JSON.registerDiscriminator(Animal.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("BigCat", BigCat.class); + mappings.put("Cat", Cat.class); + mappings.put("Dog", Dog.class); + mappings.put("Animal", Animal.class); + JSON.registerDiscriminator(Animal.class, "className", mappings); + } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index a4940ec1ec6..08081168ee6 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index a2679d903aa..d74f9a70f67 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java index 337c357f30e..b52510668e4 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -40,13 +40,13 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java index 46334a7030a..a3986a67006 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java @@ -156,11 +156,11 @@ public class BigCat extends Cat { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("BigCat", BigCat.class); - JSON.registerDiscriminator(BigCat.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("BigCat", BigCat.class); + JSON.registerDiscriminator(BigCat.class, "className", mappings); + } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java index 170ec427664..56b9877dcc5 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Cat.java @@ -26,7 +26,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -121,12 +120,12 @@ public class Cat extends Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("BigCat", BigCat.class); - mappings.put("Cat", Cat.class); - JSON.registerDiscriminator(Cat.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("BigCat", BigCat.class); + mappings.put("Cat", Cat.class); + JSON.registerDiscriminator(Cat.class, "className", mappings); + } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java index ba19147b2d5..523ed807c85 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Dog.java @@ -117,11 +117,11 @@ public class Dog extends Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Dog", Dog.class); - JSON.registerDiscriminator(Dog.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Dog", Dog.class); + JSON.registerDiscriminator(Dog.class, "className", mappings); + } } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java index 618d07b460a..db4d50934a8 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -111,7 +111,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index fa760cf7ab3..2535ea9856c 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -42,7 +42,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java index 5c1d067af62..a98a3cd6bdc 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/Pet.java @@ -59,7 +59,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -185,6 +185,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 67f0407b0f3..78b2a687843 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -165,6 +165,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 4fb1b1e2fb4..b6fbee409df 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -194,6 +194,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java index 6db436d4841..517e1594c3e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/XmlItem.java @@ -78,7 +78,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -93,10 +93,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -111,10 +111,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -129,10 +129,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -147,10 +147,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } 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 13d46665014..6a357bf177a 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 @@ -36,6 +36,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -43,11 +44,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -70,25 +74,26 @@ import org.openapitools.client.auth.OAuth; */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient extends JavaTimeFormatter { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "http://petstore.swagger.io:80/v2"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io:80/v2", - "No description provided", - new HashMap() - ) + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io:80/v2", + "No description provided", + new LinkedHashMap<>() + ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + protected Map> operationServers = new HashMap<>(); + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -125,7 +130,7 @@ public class ApiClient extends JavaTimeFormatter { setUserAgent("OpenAPI-Generator/1.0.0/java"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; if (authMap != null) { auth = authMap.get("petstore_auth"); @@ -163,7 +168,7 @@ public class ApiClient extends JavaTimeFormatter { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap(); + authenticationLookup = new HashMap<>(); } /** @@ -751,7 +756,7 @@ public class ApiClient extends JavaTimeFormatter { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -810,14 +815,13 @@ public class ApiClient extends JavaTimeFormatter { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -829,8 +833,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -850,8 +854,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1143,15 +1147,17 @@ public class ApiClient extends JavaTimeFormatter { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + null, + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1168,7 +1174,7 @@ public class ApiClient extends JavaTimeFormatter { final int statusCode = response.getStatusInfo().getStatusCode(); // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (statusCode == Status.UNAUTHORIZED.getStatusCode()) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1339,10 +1345,10 @@ public class ApiClient extends JavaTimeFormatter { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } 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 24317dfe36a..8e72ba03553 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 @@ -64,7 +64,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -84,7 +84,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -193,12 +193,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 98b6a534086..540cf2cbba3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,42 +75,16 @@ public class AnotherFakeApi { */ public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags"); } - - // create path and map variables - String localVarPath = "/another-fake/dummy"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", "/another-fake/dummy", "PATCH", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } 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 0c31d3c2d14..597605cede0 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 @@ -20,6 +20,7 @@ import org.openapitools.client.model.XmlItem; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -81,41 +82,16 @@ public class FakeApi { */ public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException { - Object localVarPostBody = xmlItem; - - // verify the required parameter 'xmlItem' is set + // Check required parameters if (xmlItem == null) { throw new ApiException(400, "Missing the required parameter 'xmlItem' when calling createXmlItem"); } - - // create path and map variables - String localVarPath = "/fake/create_xml_item"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.createXmlItem", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"); + return apiClient.invokeAPI("FakeApi.createXmlItem", "/fake/create_xml_item", "POST", new ArrayList<>(), xmlItem, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * @@ -146,38 +122,12 @@ public class FakeApi { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/boolean"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", "/fake/outer/boolean", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -208,38 +158,12 @@ public class FakeApi { */ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/composite"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", "/fake/outer/composite", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -270,38 +194,12 @@ public class FakeApi { */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/number"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", "/fake/outer/number", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -332,38 +230,12 @@ public class FakeApi { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/string"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", "/fake/outer/string", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -393,41 +265,16 @@ public class FakeApi { */ public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithFileSchema"); } - - // create path and map variables - String localVarPath = "/fake/body-with-file-schema"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", "/fake/body-with-file-schema", "PUT", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * @@ -459,47 +306,24 @@ public class FakeApi { */ public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'query' is set + // Check required parameters if (query == null) { throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); } - - // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); } - - // create path and map variables - String localVarPath = "/fake/body-with-query-params"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "query", query) + ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", "/fake/body-with-query-params", "PUT", localVarQueryParams, body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * To test \"client\" model @@ -530,43 +354,17 @@ public class FakeApi { */ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); } - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.testClientModel", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.testClientModel", "/fake", "PATCH", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -624,83 +422,62 @@ public class FakeApi { */ 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 = null; - - // verify the required parameter 'number' is set + // Check required parameters if (number == null) { throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); } - - // verify the required parameter '_double' is set if (_double == null) { throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); } - - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } - - // verify the required parameter '_byte' is set if (_byte == null) { throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - - // create path and map variables - String localVarPath = "/fake"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (integer != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (integer != null) { localVarFormParams.put("integer", integer); -if (int32 != null) + } + if (int32 != null) { localVarFormParams.put("int32", int32); -if (int64 != null) + } + if (int64 != null) { localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) + } + localVarFormParams.put("number", number); + if (_float != null) { localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) + } + localVarFormParams.put("double", _double); + if (string != null) { localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) + } + localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); + localVarFormParams.put("byte", _byte); + if (binary != null) { localVarFormParams.put("binary", binary); -if (date != null) + } + if (date != null) { localVarFormParams.put("date", date); -if (dateTime != null) + } + if (dateTime != null) { localVarFormParams.put("dateTime", dateTime); -if (password != null) + } + if (password != null) { localVarFormParams.put("password", password); -if (paramCallback != null) + } + if (paramCallback != null) { localVarFormParams.put("callback", paramCallback); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "http_basic_test" }; - - return apiClient.invokeAPI("FakeApi.testEndpointParameters", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"http_basic_test"}; + return apiClient.invokeAPI("FakeApi.testEndpointParameters", "/fake", "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -747,104 +524,71 @@ if (paramCallback != null) */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); - if (enumHeaderStringArray != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (enumHeaderStringArray != null) { localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + } + if (enumHeaderString != null) { localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + } - - if (enumFormStringArray != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (enumFormStringArray != null) { localVarFormParams.put("enum_form_string_array", enumFormStringArray); -if (enumFormString != null) + } + if (enumFormString != null) { localVarFormParams.put("enum_form_string", enumFormString); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testEnumParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + return apiClient.invokeAPI("FakeApi.testEnumParameters", "/fake", "GET", localVarQueryParams, null, + localVarHeaderParams, new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + null, null, false); } private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'requiredStringGroup' is set + // Check required parameters if (requiredStringGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); } - - // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); } - - // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - - // create path and map variables - String localVarPath = "/fake"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "required_string_group", requiredStringGroup) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group)); - if (requiredBooleanGroup != null) - localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); -if (booleanGroup != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + if (booleanGroup != null) { localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); + } - - - 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("FakeApi.testGroupParameters", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("FakeApi.testGroupParameters", "/fake", "DELETE", localVarQueryParams, null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } public class APItestGroupParametersRequest { @@ -989,41 +733,16 @@ if (booleanGroup != null) */ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map param) throws ApiException { - Object localVarPostBody = param; - - // verify the required parameter 'param' is set + // Check required parameters if (param == null) { throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); } - - // create path and map variables - String localVarPath = "/fake/inline-additionalProperties"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", "/fake/inline-additionalProperties", "POST", new ArrayList<>(), param, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * test json serialization of form data @@ -1055,50 +774,24 @@ if (booleanGroup != null) */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set + // Check required parameters if (param == null) { throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); } - - // verify the required parameter 'param2' is set if (param2 == null) { throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); } - - // create path and map variables - String localVarPath = "/fake/jsonFormData"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams.put("param", param); + localVarFormParams.put("param2", param2); - - - - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testJsonFormData", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + return apiClient.invokeAPI("FakeApi.testJsonFormData", "/fake/jsonFormData", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + null, null, false); } /** * @@ -1136,65 +829,36 @@ if (param2 != null) */ 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 + // Check required parameters 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-parameters"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "pipe", pipe) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "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("FakeApi.testQueryParameterCollectionFormat", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", "/fake/test-query-parameters", "PUT", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 3123826e28a..08f35e4a742 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,42 +75,17 @@ public class FakeClassnameTags123Api { */ public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); } - - // create path and map variables - String localVarPath = "/fake_classname_test"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key_query" }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key_query"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", "/fake_classname_test", "PATCH", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } 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 7317e831e8c..ccc78f9d1ba 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 @@ -15,6 +15,7 @@ import java.util.Set; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -78,40 +79,16 @@ public class PetApi { */ public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); } - - // create path and map variables - String localVarPath = "/pet"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -146,43 +123,26 @@ public class PetApi { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - if (apiKey != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (apiKey != null) { localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + } - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", new ArrayList<>(), null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -216,43 +176,22 @@ public class PetApi { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'status' is set + // Check required parameters if (status == null) { throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); } - - // create path and map variables - String localVarPath = "/pet/findByStatus"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "status", status) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -290,43 +229,22 @@ public class PetApi { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'tags' is set + // Check required parameters if (tags == null) { throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); } - - // create path and map variables - String localVarPath = "/pet/findByTags"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "tags", tags) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -362,43 +280,21 @@ public class PetApi { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -435,40 +331,16 @@ public class PetApi { */ public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); } - - // create path and map variables - String localVarPath = "/pet"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -503,45 +375,29 @@ public class PetApi { */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (name != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (name != null) { localVarFormParams.put("name", name); -if (status != null) + } + if (status != null) { localVarFormParams.put("status", status); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -577,47 +433,30 @@ if (status != null) */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (_file != null) + } + if (_file != null) { localVarFormParams.put("file", _file); + } - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -653,52 +492,31 @@ if (_file != null) */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - - // verify the required parameter 'requiredFile' is set if (requiredFile == null) { throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (requiredFile != null) - localVarFormParams.put("requiredFile", requiredFile); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + } + localVarFormParams.put("requiredFile", requiredFile); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } 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 1f094916301..0552c144390 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 @@ -12,6 +12,7 @@ import org.openapitools.client.model.Order; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -75,42 +76,20 @@ public class StoreApi { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + .replaceAll("\\{order_id}", apiClient.escapeString(orderId)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("StoreApi.deleteOrder", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Returns pet inventories by status @@ -139,37 +118,12 @@ public class StoreApi { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/inventory"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("StoreApi.getInventory", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("StoreApi.getInventory", "/store/inventory", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -205,44 +159,21 @@ public class StoreApi { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Place an order for a pet @@ -275,42 +206,16 @@ public class StoreApi { */ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); } - - // create path and map variables - String localVarPath = "/store/order"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.placeOrder", "/store/order", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } 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 2a59daac578..1ccc0aad36b 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 @@ -13,6 +13,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,41 +75,16 @@ public class UserApi { */ public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); } - - // create path and map variables - String localVarPath = "/user"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.createUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Creates list of users with given input array @@ -138,41 +114,16 @@ public class UserApi { */ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); } - - // create path and map variables - String localVarPath = "/user/createWithArray"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.createUsersWithArrayInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Creates list of users with given input array @@ -202,41 +153,16 @@ public class UserApi { */ public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set + // Check required parameters if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); } - - // create path and map variables - String localVarPath = "/user/createWithList"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.createUsersWithListInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Delete user @@ -268,42 +194,20 @@ public class UserApi { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.deleteUser", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Get user by user name @@ -338,44 +242,21 @@ public class UserApi { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{username}", apiClient.escapeString(username)); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs user into the system @@ -410,50 +291,26 @@ public class UserApi { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); } - - // verify the required parameter 'password' is set if (password == null) { throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); } - - // create path and map variables - String localVarPath = "/user/login"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "username", username) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.loginUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.loginUser", "/user/login", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs out current logged in user session @@ -481,36 +338,11 @@ public class UserApi { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/logout"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.logoutUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Updated user @@ -544,46 +376,22 @@ public class UserApi { */ public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - - // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.updateUser", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } } 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 28fdbd6e63a..69df9b57e7e 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 @@ -82,7 +82,7 @@ public class AdditionalPropertiesAnyType { @JsonAnySetter public AdditionalPropertiesAnyType putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; 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 59093dc6eba..f9011269ad1 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 @@ -83,7 +83,7 @@ public class AdditionalPropertiesArray { @JsonAnySetter public AdditionalPropertiesArray putAdditionalProperty(String key, List value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; 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 17ed09d84ac..a91038275c7 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 @@ -82,7 +82,7 @@ public class AdditionalPropertiesBoolean { @JsonAnySetter public AdditionalPropertiesBoolean putAdditionalProperty(String key, Boolean value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; 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 fe558167aca..c14ac4d5810 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 @@ -82,7 +82,7 @@ public class AdditionalPropertiesInteger { @JsonAnySetter public AdditionalPropertiesInteger putAdditionalProperty(String key, Integer value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; 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 1295699d45a..15c62efed1f 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 @@ -83,7 +83,7 @@ public class AdditionalPropertiesNumber { @JsonAnySetter public AdditionalPropertiesNumber putAdditionalProperty(String key, BigDecimal value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; 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 47374023df6..556a0ec2b09 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 @@ -83,7 +83,7 @@ public class AdditionalPropertiesObject { @JsonAnySetter public AdditionalPropertiesObject putAdditionalProperty(String key, Map value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; 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 e5a9b0f86ae..a4b580f0412 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 @@ -82,7 +82,7 @@ public class AdditionalPropertiesString { @JsonAnySetter public AdditionalPropertiesString putAdditionalProperty(String key, String value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; 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 2920ae422d0..9ace6d0d824 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 @@ -25,9 +25,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -153,14 +150,14 @@ public class Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("BigCat", BigCat.class); - mappings.put("Cat", Cat.class); - mappings.put("Dog", Dog.class); - mappings.put("Animal", Animal.class); - JSON.registerDiscriminator(Animal.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("BigCat", BigCat.class); + mappings.put("Cat", Cat.class); + mappings.put("Dog", Dog.class); + mappings.put("Animal", Animal.class); + JSON.registerDiscriminator(Animal.class, "className", mappings); + } } 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 a4940ec1ec6..08081168ee6 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 @@ -38,7 +38,7 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } 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 a2679d903aa..d74f9a70f67 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 @@ -38,7 +38,7 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } 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 337c357f30e..b52510668e4 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 @@ -40,13 +40,13 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java index 46334a7030a..a3986a67006 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java @@ -156,11 +156,11 @@ public class BigCat extends Cat { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("BigCat", BigCat.class); - JSON.registerDiscriminator(BigCat.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("BigCat", BigCat.class); + JSON.registerDiscriminator(BigCat.class, "className", mappings); + } } 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 170ec427664..56b9877dcc5 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 @@ -26,7 +26,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -121,12 +120,12 @@ public class Cat extends Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("BigCat", BigCat.class); - mappings.put("Cat", Cat.class); - JSON.registerDiscriminator(Cat.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("BigCat", BigCat.class); + mappings.put("Cat", Cat.class); + JSON.registerDiscriminator(Cat.class, "className", mappings); + } } 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 ba19147b2d5..523ed807c85 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 @@ -117,11 +117,11 @@ public class Dog extends Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Dog", Dog.class); - JSON.registerDiscriminator(Dog.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Dog", Dog.class); + JSON.registerDiscriminator(Dog.class, "className", mappings); + } } 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 618d07b460a..db4d50934a8 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 @@ -111,7 +111,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } 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 fa760cf7ab3..2535ea9856c 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 @@ -42,7 +42,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } 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 5c1d067af62..a98a3cd6bdc 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 @@ -59,7 +59,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -185,6 +185,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 67f0407b0f3..78b2a687843 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 @@ -165,6 +165,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 4fb1b1e2fb4..b6fbee409df 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 @@ -194,6 +194,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 6db436d4841..517e1594c3e 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 @@ -78,7 +78,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -93,10 +93,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -111,10 +111,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -129,10 +129,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -147,10 +147,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index b6d7bde6e20..7ffc9869d69 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -36,6 +36,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -43,11 +44,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -71,94 +75,93 @@ import org.openapitools.client.auth.OAuth; */ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient extends JavaTimeFormatter { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "http://petstore.swagger.io:80/v2"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://{server}.swagger.io:{port}/v2", - "petstore server", - new HashMap() {{ - put("server", new ServerVariable( - "No description provided", - "petstore", - new HashSet( - Arrays.asList( - "petstore", - "qa-petstore", - "dev-petstore" - ) + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://{server}.swagger.io:{port}/v2", + "petstore server", + Stream.>of( + new SimpleEntry<>("server", new ServerVariable( + "No description provided", + "petstore", + new LinkedHashSet<>(Arrays.asList( + "petstore", + "qa-petstore", + "dev-petstore" + )) + )), + new SimpleEntry<>("port", new ServerVariable( + "No description provided", + "80", + new LinkedHashSet<>(Arrays.asList( + "80", + "8080" + )) + )) + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + ), + new ServerConfiguration( + "https://localhost:8080/{version}", + "The local server", + Stream.>of( + new SimpleEntry<>("version", new ServerVariable( + "No description provided", + "v2", + new LinkedHashSet<>(Arrays.asList( + "v1", + "v2" + )) + )) + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + ), + new ServerConfiguration( + "https://127.0.0.1/no_variable", + "The local server without variables", + new LinkedHashMap<>() ) - )); - put("port", new ServerVariable( - "No description provided", - "80", - new HashSet( - Arrays.asList( - "80", - "8080" - ) - ) - )); - }} - ), - new ServerConfiguration( - "https://localhost:8080/{version}", - "The local server", - new HashMap() {{ - put("version", new ServerVariable( - "No description provided", - "v2", - new HashSet( - Arrays.asList( - "v1", - "v2" - ) - ) - )); - }} - ), - new ServerConfiguration( - "https://127.0.0.1/no_variable", - "The local server without variables", - new HashMap() - ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - put("PetApi.addPet", new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io/v2", - "No description provided", - new HashMap() - ), + protected Map> operationServers; - new ServerConfiguration( - "http://path-server-test.petstore.local/v2", - "No description provided", - new HashMap() - ) + { + Map> operationServers = new LinkedHashMap<>(); + operationServers.put("PetApi.addPet", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new LinkedHashMap<>() + ), + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new LinkedHashMap<>() + ) ))); - put("PetApi.updatePet", new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io/v2", - "No description provided", - new HashMap() - ), + operationServers.put("PetApi.updatePet", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new LinkedHashMap<>() + ), + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new LinkedHashMap<>() + ) + ))); + this.operationServers = operationServers; + } - new ServerConfiguration( - "http://path-server-test.petstore.local/v2", - "No description provided", - new HashMap() - ) - ))); - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -195,7 +198,7 @@ public class ApiClient extends JavaTimeFormatter { setUserAgent("OpenAPI-Generator/1.0.0/java"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; if (authMap != null) { auth = authMap.get("petstore_auth"); @@ -247,7 +250,7 @@ public class ApiClient extends JavaTimeFormatter { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap(); + authenticationLookup = new HashMap<>(); } /** @@ -835,7 +838,7 @@ public class ApiClient extends JavaTimeFormatter { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -894,14 +897,13 @@ public class ApiClient extends JavaTimeFormatter { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -913,8 +915,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -934,8 +936,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1227,15 +1229,17 @@ public class ApiClient extends JavaTimeFormatter { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - serializeToString(body, formParams, contentType, isBodyNullable), - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + serializeToString(body, formParams, contentType, isBodyNullable), + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1252,7 +1256,7 @@ public class ApiClient extends JavaTimeFormatter { final int statusCode = response.getStatusInfo().getStatusCode(); // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (statusCode == Status.UNAUTHORIZED.getStatusCode()) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1423,10 +1427,10 @@ public class ApiClient extends JavaTimeFormatter { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java index f1dc353af58..8652344eaa3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java @@ -64,7 +64,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -84,7 +84,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -193,12 +193,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 0437af1a111..b5bfe28a7fc 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,42 +75,16 @@ public class AnotherFakeApi { */ public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { - Object localVarPostBody = client; - - // verify the required parameter 'client' is set + // Check required parameters if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); } - - // create path and map variables - String localVarPath = "/another-fake/dummy"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", "/another-fake/dummy", "PATCH", new ArrayList<>(), client, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java index e9b2ade6895..6b2bab68d7b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.FooGetDefaultResponse; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -72,37 +73,11 @@ public class DefaultApi { */ public ApiResponse fooGetWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/foo"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("DefaultApi.fooGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("DefaultApi.fooGet", "/foo", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java index 84549ce0609..6ac9438f44b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -21,6 +21,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -81,38 +82,12 @@ public class FakeApi { */ public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/health"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeHealthGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeHealthGet", "/fake/health", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -143,38 +118,12 @@ public class FakeApi { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/boolean"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", "/fake/outer/boolean", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -205,38 +154,12 @@ public class FakeApi { */ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { - Object localVarPostBody = outerComposite; - - // create path and map variables - String localVarPath = "/fake/outer/composite"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", "/fake/outer/composite", "POST", new ArrayList<>(), outerComposite, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -267,38 +190,12 @@ public class FakeApi { */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/number"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", "/fake/outer/number", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -329,38 +226,12 @@ public class FakeApi { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/string"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", "/fake/outer/string", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Array of Enums @@ -389,38 +260,12 @@ public class FakeApi { */ public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/array-of-enums"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("FakeApi.getArrayOfEnums", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.getArrayOfEnums", "/fake/array-of-enums", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -450,41 +295,16 @@ public class FakeApi { */ public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - Object localVarPostBody = fileSchemaTestClass; - - // verify the required parameter 'fileSchemaTestClass' is set + // Check required parameters if (fileSchemaTestClass == null) { throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema"); } - - // create path and map variables - String localVarPath = "/fake/body-with-file-schema"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", "/fake/body-with-file-schema", "PUT", new ArrayList<>(), fileSchemaTestClass, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * @@ -516,47 +336,24 @@ public class FakeApi { */ public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'query' is set + // Check required parameters if (query == null) { throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); } - - // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); } - - // create path and map variables - String localVarPath = "/fake/body-with-query-params"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "query", query) + ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", "/fake/body-with-query-params", "PUT", localVarQueryParams, user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * To test \"client\" model @@ -587,43 +384,17 @@ public class FakeApi { */ public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { - Object localVarPostBody = client; - - // verify the required parameter 'client' is set + // Check required parameters if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); } - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.testClientModel", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.testClientModel", "/fake", "PATCH", new ArrayList<>(), client, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -681,83 +452,62 @@ public class FakeApi { */ 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 = null; - - // verify the required parameter 'number' is set + // Check required parameters if (number == null) { throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); } - - // verify the required parameter '_double' is set if (_double == null) { throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); } - - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } - - // verify the required parameter '_byte' is set if (_byte == null) { throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - - // create path and map variables - String localVarPath = "/fake"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (integer != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (integer != null) { localVarFormParams.put("integer", integer); -if (int32 != null) + } + if (int32 != null) { localVarFormParams.put("int32", int32); -if (int64 != null) + } + if (int64 != null) { localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) + } + localVarFormParams.put("number", number); + if (_float != null) { localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) + } + localVarFormParams.put("double", _double); + if (string != null) { localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) + } + localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); + localVarFormParams.put("byte", _byte); + if (binary != null) { localVarFormParams.put("binary", binary); -if (date != null) + } + if (date != null) { localVarFormParams.put("date", date); -if (dateTime != null) + } + if (dateTime != null) { localVarFormParams.put("dateTime", dateTime); -if (password != null) + } + if (password != null) { localVarFormParams.put("password", password); -if (paramCallback != null) + } + if (paramCallback != null) { localVarFormParams.put("callback", paramCallback); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "http_basic_test" }; - - return apiClient.invokeAPI("FakeApi.testEndpointParameters", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"http_basic_test"}; + return apiClient.invokeAPI("FakeApi.testEndpointParameters", "/fake", "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -804,103 +554,71 @@ if (paramCallback != null) */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); - if (enumHeaderStringArray != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (enumHeaderStringArray != null) { localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + } + if (enumHeaderString != null) { localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + } - - if (enumFormStringArray != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (enumFormStringArray != null) { localVarFormParams.put("enum_form_string_array", enumFormStringArray); -if (enumFormString != null) + } + if (enumFormString != null) { localVarFormParams.put("enum_form_string", enumFormString); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testEnumParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + return apiClient.invokeAPI("FakeApi.testEnumParameters", "/fake", "GET", localVarQueryParams, null, + localVarHeaderParams, new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + null, null, false); } private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'requiredStringGroup' is set + // Check required parameters if (requiredStringGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); } - - // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); } - - // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - - // create path and map variables - String localVarPath = "/fake"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "required_string_group", requiredStringGroup) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group)); - if (requiredBooleanGroup != null) - localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); -if (booleanGroup != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + if (booleanGroup != null) { localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); + } - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "bearer_test" }; - - return apiClient.invokeAPI("FakeApi.testGroupParameters", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"bearer_test"}; + return apiClient.invokeAPI("FakeApi.testGroupParameters", "/fake", "DELETE", localVarQueryParams, null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } @@ -1046,41 +764,16 @@ if (booleanGroup != null) */ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws ApiException { - Object localVarPostBody = requestBody; - - // verify the required parameter 'requestBody' is set + // Check required parameters if (requestBody == null) { throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } - - // create path and map variables - String localVarPath = "/fake/inline-additionalProperties"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", "/fake/inline-additionalProperties", "POST", new ArrayList<>(), requestBody, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * test json serialization of form data @@ -1112,50 +805,24 @@ if (booleanGroup != null) */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set + // Check required parameters if (param == null) { throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); } - - // verify the required parameter 'param2' is set if (param2 == null) { throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); } - - // create path and map variables - String localVarPath = "/fake/jsonFormData"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams.put("param", param); + localVarFormParams.put("param2", param2); - - - - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testJsonFormData", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + return apiClient.invokeAPI("FakeApi.testJsonFormData", "/fake/jsonFormData", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + null, null, false); } /** * @@ -1193,65 +860,36 @@ if (param2 != null) */ 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 + // Check required parameters 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-parameters"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "pipe", pipe)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("multi", "pipe", pipe) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "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("FakeApi.testQueryParameterCollectionFormat", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", "/fake/test-query-parameters", "PUT", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 6aee09d3edd..7827fe7274c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,42 +75,17 @@ public class FakeClassnameTags123Api { */ public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { - Object localVarPostBody = client; - - // verify the required parameter 'client' is set + // Check required parameters if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); } - - // create path and map variables - String localVarPath = "/fake_classname_test"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key_query" }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key_query"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", "/fake_classname_test", "PATCH", new ArrayList<>(), client, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java index 273c7ffb489..5b1ed054cc3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,6 +14,7 @@ import org.openapitools.client.model.Pet; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -75,40 +76,16 @@ public class PetApi { */ public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { - Object localVarPostBody = pet; - - // verify the required parameter 'pet' is set + // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } - - // create path and map variables - String localVarPath = "/pet"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; - - return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), pet, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -141,43 +118,26 @@ public class PetApi { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - if (apiKey != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (apiKey != null) { localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + } - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", new ArrayList<>(), null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -211,43 +171,22 @@ public class PetApi { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'status' is set + // Check required parameters if (status == null) { throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); } - - // create path and map variables - String localVarPath = "/pet/findByStatus"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "status", status) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -285,43 +224,22 @@ public class PetApi { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'tags' is set + // Check required parameters if (tags == null) { throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); } - - // create path and map variables - String localVarPath = "/pet/findByTags"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "tags", tags) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -357,43 +275,21 @@ public class PetApi { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -428,40 +324,16 @@ public class PetApi { */ public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { - Object localVarPostBody = pet; - - // verify the required parameter 'pet' is set + // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } - - // create path and map variables - String localVarPath = "/pet"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; - - return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), pet, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -496,45 +368,29 @@ public class PetApi { */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (name != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (name != null) { localVarFormParams.put("name", name); -if (status != null) + } + if (status != null) { localVarFormParams.put("status", status); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -570,47 +426,30 @@ if (status != null) */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (_file != null) + } + if (_file != null) { localVarFormParams.put("file", _file); + } - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -646,52 +485,31 @@ if (_file != null) */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - - // verify the required parameter 'requiredFile' is set if (requiredFile == null) { throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (requiredFile != null) - localVarFormParams.put("requiredFile", requiredFile); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + } + localVarFormParams.put("requiredFile", requiredFile); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java index bee4f7e72bf..53b91b2abe9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Order; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -75,42 +76,20 @@ public class StoreApi { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + .replaceAll("\\{order_id}", apiClient.escapeString(orderId)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("StoreApi.deleteOrder", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Returns pet inventories by status @@ -139,37 +118,12 @@ public class StoreApi { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/inventory"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("StoreApi.getInventory", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("StoreApi.getInventory", "/store/inventory", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -205,44 +159,21 @@ public class StoreApi { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Place an order for a pet @@ -275,42 +206,16 @@ public class StoreApi { */ public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { - Object localVarPostBody = order; - - // verify the required parameter 'order' is set + // Check required parameters if (order == null) { throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } - - // create path and map variables - String localVarPath = "/store/order"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.placeOrder", "/store/order", "POST", new ArrayList<>(), order, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java index c23402c300b..837abd285fd 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java @@ -13,6 +13,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,41 +75,16 @@ public class UserApi { */ public ApiResponse createUserWithHttpInfo(User user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } - - // create path and map variables - String localVarPath = "/user"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("UserApi.createUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Creates list of users with given input array @@ -138,41 +114,16 @@ public class UserApi { */ public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } - - // create path and map variables - String localVarPath = "/user/createWithArray"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Creates list of users with given input array @@ -202,41 +153,16 @@ public class UserApi { */ public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } - - // create path and map variables - String localVarPath = "/user/createWithList"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("UserApi.createUsersWithListInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Delete user @@ -268,42 +194,20 @@ public class UserApi { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.deleteUser", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Get user by user name @@ -338,44 +242,21 @@ public class UserApi { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{username}", apiClient.escapeString(username)); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs user into the system @@ -410,50 +291,26 @@ public class UserApi { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); } - - // verify the required parameter 'password' is set if (password == null) { throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); } - - // create path and map variables - String localVarPath = "/user/login"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "username", username) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.loginUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.loginUser", "/user/login", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs out current logged in user session @@ -481,36 +338,11 @@ public class UserApi { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/logout"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.logoutUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Updated user @@ -544,46 +376,22 @@ public class UserApi { */ public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - - // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java index a64e28aa537..d81363597cd 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java @@ -25,8 +25,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -151,13 +149,13 @@ public class Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Cat", Cat.class); - mappings.put("Dog", Dog.class); - mappings.put("Animal", Animal.class); - JSON.registerDiscriminator(Animal.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Cat", Cat.class); + mappings.put("Dog", Dog.class); + mappings.put("Animal", Animal.class); + JSON.registerDiscriminator(Animal.class, "className", mappings); + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e100f429780..b98b8193d9b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index a2043e449ce..58805427f3a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java index 63418199ab0..8b94c7fed76 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -40,13 +40,13 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java index 032be87b127..64da62158f8 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java @@ -92,7 +92,7 @@ public class Cat extends Animal { @JsonAnySetter public Cat putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -160,11 +160,11 @@ public class Cat extends Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Cat", Cat.class); - JSON.registerDiscriminator(Cat.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Cat", Cat.class); + JSON.registerDiscriminator(Cat.class, "className", mappings); + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java index f97f1c28530..9d87b793cd8 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java @@ -135,7 +135,7 @@ public class ChildCat extends ParentPet { @JsonAnySetter public ChildCat putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -205,11 +205,11 @@ public class ChildCat extends ParentPet { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ChildCat", ChildCat.class); + JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings); + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index aa3660ca479..79990832e00 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -111,7 +111,7 @@ public class ComplexQuadrilateral { @JsonAnySetter public ComplexQuadrilateral putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java index bd197421d13..6fcd4ce468e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java @@ -92,7 +92,7 @@ public class Dog extends Animal { @JsonAnySetter public Dog putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -160,11 +160,11 @@ public class Dog extends Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Dog", Dog.class); - JSON.registerDiscriminator(Dog.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Dog", Dog.class); + JSON.registerDiscriminator(Dog.class, "className", mappings); + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java index c5eaa771d2f..d9dd5f94e52 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java @@ -61,7 +61,7 @@ public class Drawing { private JsonNullable nullableShape = JsonNullable.undefined(); public static final String JSON_PROPERTY_SHAPES = "shapes"; - private List shapes = new ArrayList<>(); + private List shapes; public Drawing() { } @@ -195,7 +195,7 @@ public class Drawing { @JsonAnySetter public Drawing putAdditionalProperty(String key, Fruit value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java index 8830dd2f510..14c2f345d6d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -111,7 +111,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 0eb9d642457..d9c3cf11119 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -111,7 +111,7 @@ public class EquilateralTriangle { @JsonAnySetter public EquilateralTriangle putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 483524bac85..50dbf971010 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -42,7 +42,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java index 6bd90ba2086..7f4ff8190bc 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java @@ -162,7 +162,7 @@ public class Fruit extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Fruit() { super("oneOf", Boolean.FALSE); @@ -201,12 +201,12 @@ public class Fruit extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Banana.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java index 69bc43bf44f..812aee01f83 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -164,7 +164,7 @@ public class FruitReq extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public FruitReq() { super("oneOf", Boolean.TRUE); @@ -208,12 +208,12 @@ public class FruitReq extends AbstractOpenApiSchema { return; } - if (JSON.isInstanceOf(AppleReq.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(AppleReq.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(BananaReq.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(BananaReq.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java index 23f7dedaf94..92dbb1a6550 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -122,7 +122,7 @@ public class GmFruit extends AbstractOpenApiSchema { } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public GmFruit() { super("anyOf", Boolean.FALSE); @@ -161,12 +161,12 @@ public class GmFruit extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Banana.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index c1e20a04960..c0bf159da9b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -25,8 +25,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; -import org.openapitools.client.model.ParentPet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -120,13 +118,13 @@ public class GrandparentAnimal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - mappings.put("ParentPet", ParentPet.class); - mappings.put("GrandparentAnimal", GrandparentAnimal.class); - JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ChildCat", ChildCat.class); + mappings.put("ParentPet", ParentPet.class); + mappings.put("GrandparentAnimal", GrandparentAnimal.class); + JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings); + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java index b83972ae700..4a14248c240 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java @@ -215,7 +215,7 @@ public class Mammal extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Mammal() { super("oneOf", Boolean.FALSE); @@ -234,7 +234,7 @@ public class Mammal extends AbstractOpenApiSchema { @JsonAnySetter public Mammal putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -294,7 +294,7 @@ public class Mammal extends AbstractOpenApiSchema { }); JSON.registerDescendants(Mammal.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("Pig", Pig.class); mappings.put("whale", Whale.class); mappings.put("zebra", Zebra.class); @@ -317,17 +317,17 @@ public class Mammal extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Pig.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Pig.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Whale.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Whale.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Zebra.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java index 2b68e8615f3..de951d9cb68 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -85,7 +85,7 @@ public class NullableClass { private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; private JsonNullable> objectNullableProp = JsonNullable.>undefined(); @@ -556,7 +556,7 @@ public class NullableClass { @JsonAnySetter public NullableClass putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java index d1700e791de..e51f239ec04 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -186,7 +186,7 @@ public class NullableShape extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public NullableShape() { super("oneOf", Boolean.TRUE); @@ -205,7 +205,7 @@ public class NullableShape extends AbstractOpenApiSchema { @JsonAnySetter public NullableShape putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -258,7 +258,7 @@ public class NullableShape extends AbstractOpenApiSchema { }); JSON.registerDescendants(NullableShape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("Quadrilateral", Quadrilateral.class); mappings.put("Triangle", Triangle.class); mappings.put("NullableShape", NullableShape.class); @@ -285,12 +285,12 @@ public class NullableShape extends AbstractOpenApiSchema { return; } - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 31b94b0a7b4..1e4fcf041f3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -51,7 +51,7 @@ public class ObjectWithDeprecatedFields { private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields() { } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java index e84cafd2ff6..ec0d6794fbf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java @@ -29,7 +29,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -67,7 +66,7 @@ public class ParentPet extends GrandparentAnimal { @JsonAnySetter public ParentPet putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -131,12 +130,12 @@ public class ParentPet extends GrandparentAnimal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - mappings.put("ParentPet", ParentPet.class); - JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ChildCat", ChildCat.class); + mappings.put("ParentPet", ParentPet.class); + JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings); + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index 6339f08e4cc..74a8a036a02 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -56,7 +56,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -182,6 +182,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java index 64fd06875a3..2428fcd0d9f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java @@ -184,7 +184,7 @@ public class Pig extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Pig() { super("oneOf", Boolean.FALSE); @@ -203,7 +203,7 @@ public class Pig extends AbstractOpenApiSchema { @JsonAnySetter public Pig putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -256,7 +256,7 @@ public class Pig extends AbstractOpenApiSchema { }); JSON.registerDescendants(Pig.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("BasquePig", BasquePig.class); mappings.put("DanishPig", DanishPig.class); mappings.put("Pig", Pig.class); @@ -278,12 +278,12 @@ public class Pig extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(BasquePig.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(BasquePig.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(DanishPig.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(DanishPig.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java index f13a722423a..77835c95271 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -184,7 +184,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Quadrilateral() { super("oneOf", Boolean.FALSE); @@ -203,7 +203,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { @JsonAnySetter public Quadrilateral putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -256,7 +256,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { }); JSON.registerDescendants(Quadrilateral.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("ComplexQuadrilateral", ComplexQuadrilateral.class); mappings.put("SimpleQuadrilateral", SimpleQuadrilateral.class); mappings.put("Quadrilateral", Quadrilateral.class); @@ -278,12 +278,12 @@ public class Quadrilateral extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 8152b82cde9..6c6e585e557 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -111,7 +111,7 @@ public class ScaleneTriangle { @JsonAnySetter public ScaleneTriangle putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java index 6f278d5f261..673436c0965 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java @@ -184,7 +184,7 @@ public class Shape extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Shape() { super("oneOf", Boolean.FALSE); @@ -203,7 +203,7 @@ public class Shape extends AbstractOpenApiSchema { @JsonAnySetter public Shape putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -256,7 +256,7 @@ public class Shape extends AbstractOpenApiSchema { }); JSON.registerDescendants(Shape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("Quadrilateral", Quadrilateral.class); mappings.put("Triangle", Triangle.class); mappings.put("Shape", Shape.class); @@ -278,12 +278,12 @@ public class Shape extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 4cfa05685c1..435c59cda0b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -186,7 +186,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public ShapeOrNull() { super("oneOf", Boolean.TRUE); @@ -205,7 +205,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { @JsonAnySetter public ShapeOrNull putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -258,7 +258,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { }); JSON.registerDescendants(ShapeOrNull.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("Quadrilateral", Quadrilateral.class); mappings.put("Triangle", Triangle.class); mappings.put("ShapeOrNull", ShapeOrNull.class); @@ -285,12 +285,12 @@ public class ShapeOrNull extends AbstractOpenApiSchema { return; } - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index e18386d9875..154e29bf76e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -111,7 +111,7 @@ public class SimpleQuadrilateral { @JsonAnySetter public SimpleQuadrilateral putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java index d79423b2b3e..faa35f7e747 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java @@ -215,7 +215,7 @@ public class Triangle extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Triangle() { super("oneOf", Boolean.FALSE); @@ -234,7 +234,7 @@ public class Triangle extends AbstractOpenApiSchema { @JsonAnySetter public Triangle putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -294,7 +294,7 @@ public class Triangle extends AbstractOpenApiSchema { }); JSON.registerDescendants(Triangle.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("EquilateralTriangle", EquilateralTriangle.class); mappings.put("IsoscelesTriangle", IsoscelesTriangle.class); mappings.put("ScaleneTriangle", ScaleneTriangle.class); @@ -317,17 +317,17 @@ public class Triangle extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(EquilateralTriangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(EquilateralTriangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(IsoscelesTriangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(IsoscelesTriangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(ScaleneTriangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(ScaleneTriangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java index 30ea3e69bf1..a2e2dbb4a71 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java @@ -149,7 +149,7 @@ public class Zebra { @JsonAnySetter public Zebra putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java index a2ebd3c168f..c4809a5ea03 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1032,20 +1032,48 @@ public class FakeApi { localVarRequestBuilder.header("Accept", "application/json"); List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("integer", integer.toString())); - formValues.add(new BasicNameValuePair("int32", int32.toString())); - formValues.add(new BasicNameValuePair("int64", int64.toString())); - formValues.add(new BasicNameValuePair("number", number.toString())); - formValues.add(new BasicNameValuePair("float", _float.toString())); - formValues.add(new BasicNameValuePair("double", _double.toString())); - formValues.add(new BasicNameValuePair("string", string.toString())); - formValues.add(new BasicNameValuePair("pattern_without_delimiter", patternWithoutDelimiter.toString())); - formValues.add(new BasicNameValuePair("byte", _byte.toString())); - formValues.add(new BasicNameValuePair("binary", binary.toString())); - formValues.add(new BasicNameValuePair("date", date.toString())); - formValues.add(new BasicNameValuePair("dateTime", dateTime.toString())); - formValues.add(new BasicNameValuePair("password", password.toString())); - formValues.add(new BasicNameValuePair("callback", paramCallback.toString())); + if (integer != null) { + formValues.add(new BasicNameValuePair("integer", integer.toString())); + } + if (int32 != null) { + formValues.add(new BasicNameValuePair("int32", int32.toString())); + } + if (int64 != null) { + formValues.add(new BasicNameValuePair("int64", int64.toString())); + } + if (number != null) { + formValues.add(new BasicNameValuePair("number", number.toString())); + } + if (_float != null) { + formValues.add(new BasicNameValuePair("float", _float.toString())); + } + if (_double != null) { + formValues.add(new BasicNameValuePair("double", _double.toString())); + } + if (string != null) { + formValues.add(new BasicNameValuePair("string", string.toString())); + } + if (patternWithoutDelimiter != null) { + formValues.add(new BasicNameValuePair("pattern_without_delimiter", patternWithoutDelimiter.toString())); + } + if (_byte != null) { + formValues.add(new BasicNameValuePair("byte", _byte.toString())); + } + if (binary != null) { + formValues.add(new BasicNameValuePair("binary", binary.toString())); + } + if (date != null) { + formValues.add(new BasicNameValuePair("date", date.toString())); + } + if (dateTime != null) { + formValues.add(new BasicNameValuePair("dateTime", dateTime.toString())); + } + if (password != null) { + formValues.add(new BasicNameValuePair("password", password.toString())); + } + if (paramCallback != null) { + formValues.add(new BasicNameValuePair("callback", paramCallback.toString())); + } HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { @@ -1172,9 +1200,13 @@ public class FakeApi { List formValues = new ArrayList<>(); for (int i=0; i < enumFormStringArray.size(); i++) { - formValues.add(new BasicNameValuePair("enum_form_string_array", enumFormStringArray.get(i).toString())); + if (enumFormStringArray.get(i) != null) { + formValues.add(new BasicNameValuePair("enum_form_string_array", enumFormStringArray.get(i).toString())); + } + } + if (enumFormString != null) { + formValues.add(new BasicNameValuePair("enum_form_string", enumFormString.toString())); } - formValues.add(new BasicNameValuePair("enum_form_string", enumFormString.toString())); HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { @@ -1585,8 +1617,12 @@ public class FakeApi { localVarRequestBuilder.header("Accept", "application/json"); List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("param", param.toString())); - formValues.add(new BasicNameValuePair("param2", param2.toString())); + if (param != null) { + formValues.add(new BasicNameValuePair("param", param.toString())); + } + if (param2 != null) { + formValues.add(new BasicNameValuePair("param2", param2.toString())); + } HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java index 42e39cee839..9fc98447324 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java @@ -724,8 +724,12 @@ public class PetApi { localVarRequestBuilder.header("Accept", "application/json"); List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("name", name.toString())); - formValues.add(new BasicNameValuePair("status", status.toString())); + if (name != null) { + formValues.add(new BasicNameValuePair("name", name.toString())); + } + if (status != null) { + formValues.add(new BasicNameValuePair("status", status.toString())); + } HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java index cffa1c6286a..c61c6475cad 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java @@ -28,8 +28,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 06e670c331e..856d6942ae8 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 0acb932ad36..6986ea26644 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java index a43acb13b57..6851972d586 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -42,13 +42,13 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java index 8b85a7bb108..6c3b20b091e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java @@ -78,6 +78,18 @@ public class Cat extends Animal { } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } + /** * Return true if this Cat object is equal to o. */ diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java index e46cae8e00e..7fd17f897a6 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java @@ -78,6 +78,18 @@ public class Dog extends Animal { } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } + /** * Return true if this Dog object is equal to o. */ diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Drawing.java index 3b3908f1932..6b2348140c4 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Drawing.java @@ -65,7 +65,7 @@ public class Drawing extends HashMap { private JsonNullable nullableShape = JsonNullable.undefined(); public static final String JSON_PROPERTY_SHAPES = "shapes"; - private List shapes = new ArrayList<>(); + private List shapes; public Drawing() { } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java index ddcc6e0f217..d35a143c9e2 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -113,7 +113,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index fb6ea071580..b51183684d7 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -44,7 +44,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 53cf95c9c15..329bd4ae97a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -28,8 +28,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; -import org.openapitools.client.model.ParentPet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableClass.java index 9f20bc8b9c8..f9db358215e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableClass.java @@ -87,7 +87,7 @@ public class NullableClass extends HashMap { private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; private JsonNullable> objectNullableProp = JsonNullable.>undefined(); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index febc37817e3..e0025df0e7a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -53,7 +53,7 @@ public class ObjectWithDeprecatedFields { private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields() { } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ParentPet.java index 54215bdc679..7b3ac1af02a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ParentPet.java @@ -28,7 +28,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -53,6 +52,12 @@ public class ParentPet extends GrandparentAnimal { public ParentPet() { } + @Override + public ParentPet petType(String petType) { + this.setPetType(petType); + return this; + } + /** * Return true if this ParentPet object is equal to o. */ diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java index 5d3fbd208ee..762833c0d8e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java @@ -58,7 +58,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -184,6 +184,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/PetApi.java index b7ca4bee0f8..03617eed08e 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/PetApi.java @@ -646,8 +646,12 @@ public class PetApi { localVarRequestBuilder.header("Accept", "application/json"); List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("name", name.toString())); - formValues.add(new BasicNameValuePair("status", status.toString())); + if (name != null) { + formValues.add(new BasicNameValuePair("name", name.toString())); + } + if (status != null) { + formValues.add(new BasicNameValuePair("status", status.toString())); + } HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Pet.java index c003989b341..f0223525613 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/model/Pet.java @@ -58,7 +58,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -184,6 +184,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 3e0efc40c8e..b73dbbc80c0 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 @@ -875,20 +875,48 @@ public class FakeApi { localVarRequestBuilder.header("Accept", "application/json"); List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("integer", integer.toString())); - formValues.add(new BasicNameValuePair("int32", int32.toString())); - formValues.add(new BasicNameValuePair("int64", int64.toString())); - formValues.add(new BasicNameValuePair("number", number.toString())); - formValues.add(new BasicNameValuePair("float", _float.toString())); - formValues.add(new BasicNameValuePair("double", _double.toString())); - formValues.add(new BasicNameValuePair("string", string.toString())); - formValues.add(new BasicNameValuePair("pattern_without_delimiter", patternWithoutDelimiter.toString())); - formValues.add(new BasicNameValuePair("byte", _byte.toString())); - formValues.add(new BasicNameValuePair("binary", binary.toString())); - formValues.add(new BasicNameValuePair("date", date.toString())); - formValues.add(new BasicNameValuePair("dateTime", dateTime.toString())); - formValues.add(new BasicNameValuePair("password", password.toString())); - formValues.add(new BasicNameValuePair("callback", paramCallback.toString())); + if (integer != null) { + formValues.add(new BasicNameValuePair("integer", integer.toString())); + } + if (int32 != null) { + formValues.add(new BasicNameValuePair("int32", int32.toString())); + } + if (int64 != null) { + formValues.add(new BasicNameValuePair("int64", int64.toString())); + } + if (number != null) { + formValues.add(new BasicNameValuePair("number", number.toString())); + } + if (_float != null) { + formValues.add(new BasicNameValuePair("float", _float.toString())); + } + if (_double != null) { + formValues.add(new BasicNameValuePair("double", _double.toString())); + } + if (string != null) { + formValues.add(new BasicNameValuePair("string", string.toString())); + } + if (patternWithoutDelimiter != null) { + formValues.add(new BasicNameValuePair("pattern_without_delimiter", patternWithoutDelimiter.toString())); + } + if (_byte != null) { + formValues.add(new BasicNameValuePair("byte", _byte.toString())); + } + if (binary != null) { + formValues.add(new BasicNameValuePair("binary", binary.toString())); + } + if (date != null) { + formValues.add(new BasicNameValuePair("date", date.toString())); + } + if (dateTime != null) { + formValues.add(new BasicNameValuePair("dateTime", dateTime.toString())); + } + if (password != null) { + formValues.add(new BasicNameValuePair("password", password.toString())); + } + if (paramCallback != null) { + formValues.add(new BasicNameValuePair("callback", paramCallback.toString())); + } HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { @@ -1012,9 +1040,13 @@ public class FakeApi { List formValues = new ArrayList<>(); for (int i=0; i < enumFormStringArray.size(); i++) { - formValues.add(new BasicNameValuePair("enum_form_string_array", enumFormStringArray.get(i).toString())); + if (enumFormStringArray.get(i) != null) { + formValues.add(new BasicNameValuePair("enum_form_string_array", enumFormStringArray.get(i).toString())); + } + } + if (enumFormString != null) { + formValues.add(new BasicNameValuePair("enum_form_string", enumFormString.toString())); } - formValues.add(new BasicNameValuePair("enum_form_string", enumFormString.toString())); HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { @@ -1415,8 +1447,12 @@ public class FakeApi { localVarRequestBuilder.header("Accept", "application/json"); List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("param", param.toString())); - formValues.add(new BasicNameValuePair("param2", param2.toString())); + if (param != null) { + formValues.add(new BasicNameValuePair("param", param.toString())); + } + if (param2 != null) { + formValues.add(new BasicNameValuePair("param2", param2.toString())); + } HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java index 22813f610d5..68b065a4e17 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java @@ -648,8 +648,12 @@ public class PetApi { localVarRequestBuilder.header("Accept", "application/json"); List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("name", name.toString())); - formValues.add(new BasicNameValuePair("status", status.toString())); + if (name != null) { + formValues.add(new BasicNameValuePair("name", name.toString())); + } + if (status != null) { + formValues.add(new BasicNameValuePair("status", status.toString())); + } HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { 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 cffa1c6286a..c61c6475cad 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 @@ -28,8 +28,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; 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 06e670c331e..856d6942ae8 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 @@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } 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 0acb932ad36..6986ea26644 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 @@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } 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 a43acb13b57..6851972d586 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 @@ -42,13 +42,13 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } 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 8b85a7bb108..6c3b20b091e 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 @@ -78,6 +78,18 @@ public class Cat extends Animal { } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } + /** * Return true if this Cat object is equal to o. */ 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 e46cae8e00e..7fd17f897a6 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 @@ -78,6 +78,18 @@ public class Dog extends Animal { } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } + /** * Return true if this Dog object is equal to o. */ diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java index 3b3908f1932..6b2348140c4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java @@ -65,7 +65,7 @@ public class Drawing extends HashMap { private JsonNullable nullableShape = JsonNullable.undefined(); public static final String JSON_PROPERTY_SHAPES = "shapes"; - private List shapes = new ArrayList<>(); + private List shapes; public Drawing() { } 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 ddcc6e0f217..d35a143c9e2 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 @@ -113,7 +113,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } 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 fb6ea071580..b51183684d7 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 @@ -44,7 +44,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 53cf95c9c15..329bd4ae97a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -28,8 +28,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; -import org.openapitools.client.model.ParentPet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java index 9f20bc8b9c8..f9db358215e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java @@ -87,7 +87,7 @@ public class NullableClass extends HashMap { private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; private JsonNullable> objectNullableProp = JsonNullable.>undefined(); diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index febc37817e3..e0025df0e7a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -53,7 +53,7 @@ public class ObjectWithDeprecatedFields { private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields() { } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java index 54215bdc679..7b3ac1af02a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java @@ -28,7 +28,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -53,6 +52,12 @@ public class ParentPet extends GrandparentAnimal { public ParentPet() { } + @Override + public ParentPet petType(String petType) { + this.setPetType(petType); + return this; + } + /** * Return true if this ParentPet object is equal to o. */ 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 5d3fbd208ee..762833c0d8e 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 @@ -58,7 +58,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -184,6 +184,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Pet.java index 7c1fae69427..e07848f761c 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/src/main/java/org/openapitools/client/model/Pet.java @@ -70,7 +70,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -201,6 +201,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java index 96bba4a3d3e..fdb1f6b6877 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Animal.java @@ -21,9 +21,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b6cf6e52eb1..0ec0ed0f882 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -53,7 +53,7 @@ import org.openapitools.client.JSON; 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; public ArrayOfArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 639eb6c8bf2..68a021de56f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -53,7 +53,7 @@ import org.openapitools.client.JSON; 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; public ArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java index 2fc0d3d7f92..7e5cb650193 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -53,15 +53,15 @@ import org.openapitools.client.JSON; 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; 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; 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; public ArrayTest() { } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java index c09f326d7c0..d726c5945f6 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Cat.java @@ -22,7 +22,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java index 566409f6633..1a6532984aa 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -150,7 +150,7 @@ public class EnumArrays { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 3dc6b5924c9..168a8ac2ee2 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -57,7 +57,7 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java index 58b63bd27f1..204a48b0d39 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Pet.java @@ -72,7 +72,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -203,6 +203,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index a23142b665f..33e0fd810c0 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -169,6 +169,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 7b15f553591..77529915276 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -195,6 +195,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java index 135caa7cf2b..ffe57fb2e8b 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/XmlItem.java @@ -69,7 +69,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; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -89,11 +89,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; 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; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -113,11 +113,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; 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; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -137,11 +137,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; 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; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -161,11 +161,11 @@ 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; 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; public XmlItem() { } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Pet.java index 7c1fae69427..e07848f761c 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Pet.java @@ -70,7 +70,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -201,6 +201,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 8c8cd3d89be..a4f0db63b70 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 @@ -21,9 +21,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import android.os.Parcelable; import android.os.Parcel; 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 680c33333fe..d4e32dfb7dd 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 @@ -55,7 +55,7 @@ import org.openapitools.client.JSON; 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; public ArrayOfArrayOfNumberOnly() { } 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 dd8784f0c42..72e4d4bff62 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 @@ -55,7 +55,7 @@ import org.openapitools.client.JSON; 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; public ArrayOfNumberOnly() { } 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 ee1148a6f40..cb280070303 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 @@ -55,15 +55,15 @@ import org.openapitools.client.JSON; 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; 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; 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; public ArrayTest() { } 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 5d0950cc0c1..7561af20ef6 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 @@ -22,7 +22,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import android.os.Parcelable; import android.os.Parcel; 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 e994ab72859..1704edc41a9 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 @@ -152,7 +152,7 @@ public class EnumArrays implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } 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 438216ebfc3..adfdad46356 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 @@ -59,7 +59,7 @@ public class FileSchemaTestClass implements Parcelable { public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } 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 93057136b3e..060befbc6bc 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 @@ -74,7 +74,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; /** * pet status in the store @@ -205,6 +205,9 @@ public class Pet implements Parcelable { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 fd81fad5e7a..5bd0f79200e 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 @@ -171,6 +171,9 @@ public class TypeHolderDefault implements Parcelable { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 49f034daf56..0d35a2dab1f 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 @@ -197,6 +197,9 @@ public class TypeHolderExample implements Parcelable { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 78df14807d7..970412923c2 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 @@ -71,7 +71,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; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -91,11 +91,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; 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; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -115,11 +115,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; 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; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -139,11 +139,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; 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; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -163,11 +163,11 @@ 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; 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; public XmlItem() { } diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Pet.java index 1deb29bce92..f830ef3541c 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-swagger1/src/main/java/org/openapitools/client/model/Pet.java @@ -73,7 +73,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -207,6 +207,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 d4912377fb9..9f53acf471e 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 @@ -21,8 +21,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.google.gson.Gson; import com.google.gson.GsonBuilder; 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 0943e3784a8..9dd199b293e 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 @@ -53,7 +53,7 @@ import org.openapitools.client.JSON; 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; public ArrayOfArrayOfNumberOnly() { } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java index eac6d0db48c..3b847a940ef 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOf.java @@ -61,7 +61,7 @@ public class ArrayOfInlineAllOf { public static final String SERIALIZED_NAME_ARRAY_ALLOF_DOG_PROPERTY = "array_allof_dog_property"; @SerializedName(SERIALIZED_NAME_ARRAY_ALLOF_DOG_PROPERTY) - private List arrayAllofDogProperty = new ArrayList<>(); + private List arrayAllofDogProperty; public ArrayOfInlineAllOf() { } 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 71e3dc1b732..7db2b938d62 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 @@ -53,7 +53,7 @@ import org.openapitools.client.JSON; 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; public ArrayOfNumberOnly() { } 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 2c5560b7bb0..4b0b8a744c5 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 @@ -53,15 +53,15 @@ import org.openapitools.client.JSON; 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; 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; 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; public ArrayTest() { } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java index f350beb95ea..957a0e0b912 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Drawing.java @@ -69,7 +69,7 @@ public class Drawing { public static final String SERIALIZED_NAME_SHAPES = "shapes"; @SerializedName(SERIALIZED_NAME_SHAPES) - private List shapes = new ArrayList<>(); + private List shapes; public Drawing() { } 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 257fc4ad721..7c768fb0ac4 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 @@ -150,7 +150,7 @@ public class EnumArrays { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } 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 b16ea52b210..cbe42cff751 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 @@ -57,7 +57,7 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 647a6791560..39183918851 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -21,7 +21,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.ParentPet; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java index 2bd3ac824c2..bf8499180b6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableClass.java @@ -90,7 +90,7 @@ public class NullableClass { public static final String SERIALIZED_NAME_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; @SerializedName(SERIALIZED_NAME_ARRAY_ITEMS_NULLABLE) - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String SERIALIZED_NAME_OBJECT_NULLABLE_PROP = "object_nullable_prop"; @SerializedName(SERIALIZED_NAME_OBJECT_NULLABLE_PROP) @@ -246,6 +246,9 @@ public class NullableClass { } public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList<>(); + } this.arrayNullableProp.add(arrayNullablePropItem); return this; } @@ -273,6 +276,9 @@ public class NullableClass { } public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList<>(); + } this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); return this; } @@ -330,6 +336,9 @@ public class NullableClass { } public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap<>(); + } this.objectNullableProp.put(key, objectNullablePropItem); return this; } @@ -357,6 +366,9 @@ public class NullableClass { } public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap<>(); + } this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 3d651830fef..c7b55901d67 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -66,7 +66,7 @@ public class ObjectWithDeprecatedFields { public static final String SERIALIZED_NAME_BARS = "bars"; @SerializedName(SERIALIZED_NAME_BARS) - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields() { } 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 1d885d0acea..8e25a2f95b4 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 @@ -70,7 +70,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -201,6 +201,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java index 6fc90776b81..09e2be5fa02 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java @@ -201,6 +201,9 @@ public class PetWithRequiredTags { } public PetWithRequiredTags addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -228,6 +231,9 @@ public class PetWithRequiredTags { } public PetWithRequiredTags addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 7516f3b097e..c43986d9647 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -69,7 +69,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 1ee65debc9f..bd4679072e1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -70,7 +70,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 53b8b4b7376..3906086eef8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -69,7 +69,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index efe9d568afd..b0531df4da6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -449,7 +449,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d4c96364cfc..bd2a2951a4b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -69,7 +69,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 77cec71c7fa..b0cbff0dacc 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -70,7 +70,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 1806bc04841..50228d4d481 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -69,7 +69,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 0d684da17d8..cb0968fc42f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -69,7 +69,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java index a45e467b7af..acb913cfae4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; @@ -115,7 +112,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 233a700bfbf..6dd7e64b3e7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import org.hibernate.validator.constraints.*; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -78,7 +78,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 6b22a4d6f3b..6562c7ce928 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import org.hibernate.validator.constraints.*; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -78,7 +78,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java index 2f632875382..95f19eae3cd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -40,13 +40,13 @@ import org.hibernate.validator.constraints.*; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -157,7 +157,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java index 3cdddf76cd7..15b1ac5c28a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java @@ -116,6 +116,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 746f1a22dce..591388b6c28 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -106,7 +106,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java index 634ae02a198..56b88d871ef 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -221,7 +221,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java index bde591fc50b..afc3047688c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; @@ -81,6 +80,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java index 447c610d9d8..1c4b80b855c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -67,7 +67,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java index 9b6ec8784a6..51f7622a1de 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -98,7 +98,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java index 16ea5f04a5a..de8ad8f3252 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -66,7 +66,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java index 117d21bc71a..cc804d1cde3 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -66,7 +66,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java index f72ea421f1a..d30a459de3b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -77,6 +77,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java index a70f35ab402..8778fe82756 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -67,7 +67,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java index 3c61f8bcbf3..b93236c6352 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -111,7 +111,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -177,7 +177,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java index 81667453098..3bdbc15ca44 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -338,7 +338,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 9bf2e4dcb0a..4df6b8a5803 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -42,7 +42,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -110,7 +110,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java index e746724a9ff..24c613991cf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -495,7 +495,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index c775849bcda..bbca89ab084 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -86,7 +86,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java index 4dec1f53ec4..bbfdeb8f0b4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -229,7 +229,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9e3dbdfff1e..b3e2bf0b0d3 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -144,7 +144,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java index 29fef654373..d9ed0548012 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -98,7 +98,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 2a26389a36f..1dbf90b6780 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -129,7 +129,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java index f0097d3de33..7351630b941 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -67,7 +67,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java index 97a028a2c7e..53b3d72598c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java @@ -67,7 +67,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java index 6fc184774d0..043fb21bb8e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -67,7 +67,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java index 6a34675c6aa..3e5e56565e6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -148,7 +148,6 @@ public class Name { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java index e9c8e4f5901..a15fbfe24cb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -68,7 +68,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java index cc08d32e24f..7307432622b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -260,7 +260,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java index a36a4699c03..a8d42de2a20 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -130,7 +130,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index d9d8dcb7c43..bd73babf784 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -59,7 +59,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -194,6 +194,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -283,7 +286,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index abd01a50021..0515a265606 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -94,7 +94,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java index e4491c58358..194d84f8ef4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -67,7 +67,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java index e33db0303fd..74dca8dc9b5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -97,7 +97,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index c8312a55d65..cf982c67760 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -179,6 +179,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -204,7 +207,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 0806642aa5f..a15d332f772 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -211,6 +211,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -236,7 +239,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java index 07ac1e462b6..fe89dd47d9c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java @@ -283,7 +283,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java index bab16003b69..6f95936174f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -78,7 +78,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -93,10 +93,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -111,10 +111,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -129,10 +129,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -147,10 +147,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -1014,7 +1014,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { 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 e6aa7fa5869..b2dff5b2170 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 @@ -62,7 +62,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 06a3bd4d975..99c7c6f6251 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 @@ -63,7 +63,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 bba5e524ba5..62f313b5188 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 @@ -62,7 +62,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 0d9b17e0fd3..f68ff4f22a9 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 @@ -402,7 +402,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 dc158ee4eff..9c89c6b2b17 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 @@ -62,7 +62,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 ce66f4f15a2..1eecddbf850 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 @@ -63,7 +63,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 1180ad885f4..7eb12149bd5 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 @@ -62,7 +62,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 69785c3d56e..e7aa07a8b87 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 @@ -62,7 +62,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 ba4d7e40f94..f95e03a3a9e 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 @@ -21,9 +21,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import javax.validation.constraints.*; import javax.validation.Valid; import org.hibernate.validator.constraints.*; @@ -90,7 +87,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 ac55ea686ea..d16100dc831 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 @@ -35,7 +35,7 @@ import org.hibernate.validator.constraints.*; 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; public ArrayOfArrayOfNumberOnly() { } @@ -71,7 +71,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 ac26ff59b12..1ec3840ebb4 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 @@ -35,7 +35,7 @@ import org.hibernate.validator.constraints.*; 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; public ArrayOfNumberOnly() { } @@ -71,7 +71,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 ec76a81add0..2e636bb0b7e 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 @@ -35,15 +35,15 @@ import org.hibernate.validator.constraints.*; 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; 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; 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; public ArrayTest() { } @@ -142,7 +142,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index fa1b61a61ee..f84c0565a4a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -112,6 +112,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 7b41ea7b59c..587609a35dd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -110,7 +110,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 c62fb76c6f0..a7176ec699a 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 @@ -194,7 +194,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 3063c81fa0b..ff312c3ccb9 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 @@ -22,7 +22,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import javax.validation.constraints.*; import javax.validation.Valid; import org.hibernate.validator.constraints.*; @@ -62,6 +61,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 5814781dad3..57f23c08af1 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 @@ -59,7 +59,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 cbaac501106..62c314786bf 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 @@ -87,7 +87,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 11e24ed8c15..e9853047524 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 @@ -59,7 +59,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 ad5ded57f60..67e9c314dd3 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 @@ -59,7 +59,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 bccf4e8494f..ca309c55238 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 @@ -61,6 +61,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 df502e55dc0..5f25bae6c90 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 @@ -59,7 +59,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 8ea142ace10..a70e2d3c4fa 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 @@ -132,7 +132,7 @@ public class EnumArrays { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -190,7 +190,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 67143c2afd8..1b8ff1e3f00 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 @@ -362,7 +362,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 886cd9c4053..12856a06ea6 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 @@ -39,7 +39,7 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -99,7 +99,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 771fce7dae8..595f75f15ce 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 @@ -435,7 +435,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 9600a950f70..745d71fa1cb 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 @@ -78,7 +78,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 74c9baaf297..3fe40f3ceb0 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 @@ -222,7 +222,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 068accc90d0..04a283f5969 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 @@ -129,7 +129,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 3c298f17b38..c20a3350d40 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 @@ -86,7 +86,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 634092c753d..98e81aed6a0 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 @@ -113,7 +113,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java index 632a24a1983..b5dcaf367e0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java @@ -59,7 +59,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java index 5958fb28b2d..8cb28c0f4e3 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java @@ -59,7 +59,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 69a6b6d3596..d60e7f37252 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 @@ -59,7 +59,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 fb6083aa976..be6a4b2d93b 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 @@ -133,7 +133,6 @@ public class Name { - @Override public boolean equals(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 4b8f043e911..8bbbf91359e 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 @@ -61,7 +61,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 9bd544be1b1..1066c326ed6 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 @@ -245,7 +245,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 83bfeaa6036..58c7274521e 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 @@ -115,7 +115,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 c61b7de72f5..923d68afa55 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 @@ -54,7 +54,7 @@ public class Pet { public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -190,6 +190,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -266,7 +269,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 e7e26e4c3fb..b49b9f6e7b2 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 @@ -85,7 +85,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 1c141677481..9b926f828a4 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 @@ -59,7 +59,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d2af47379e..8d3f5fae203 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 @@ -86,7 +86,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 ceb75925011..d49917fe38f 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 @@ -160,6 +160,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -181,7 +184,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 fd76fbc5d64..d1586fb3638 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 @@ -188,6 +188,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -209,7 +212,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 c681e6ddccf..e46aa37f7c8 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 @@ -248,7 +248,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 674a2d09ff8..9903913048e 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 @@ -51,7 +51,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; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -71,11 +71,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; 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; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -95,11 +95,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; 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; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -119,11 +119,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; 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; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -143,11 +143,11 @@ 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; 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; public XmlItem() { } @@ -895,7 +895,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { 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 a68ffae2eaf..d1b32ac9653 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 e41df9071f4..8fe930dfe2b 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b7e04b01c5..773db816ab8 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 656bc5ced98..46ec07ac55b 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 @@ -430,7 +430,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 38420a93f1a..0e5d01114b1 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 c9dafbb1f03..792fc1bbbe9 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 996c6413244..3f540e7de47 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 d7e667ed8d1..7231ea54b16 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 6c603bf62cf..a40c65533eb 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 @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -109,7 +106,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 37fe0aed3eb..e68f1d1d56a 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 39e27dda318..b6189104c30 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 dbfe323fd6c..52d07003963 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 @@ -37,13 +37,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -149,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java index 7928f0f2d61..e80a952e274 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java @@ -112,6 +112,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b..e357e3111ca 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -102,7 +102,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 8f0460343a9..ed4f3970651 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 @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 97ffcf45b25..a0a6af014cd 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 @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -77,6 +76,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 89e6e65c05e..7c404d48482 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 @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 a78b9d41507..a599f6689ed 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 @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 9870d339058..f5db7231aef 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 @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 314945b1bbb..764697f4191 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 @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 5de0e902a04..f77566c7746 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 @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 55d3afa8167..2978c34e2cc 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 @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 72549699100..13007002025 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 @@ -108,7 +108,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -172,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 7ef8de6dfc8..0b2ba27fcb6 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 @@ -328,7 +328,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 bd970475770..a338a0598c8 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 @@ -39,7 +39,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -103,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 ed2ed565601..9831eac4992 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 @@ -468,7 +468,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 2b2c88b9156..cdb08919cbf 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 @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 045d7b8a085..4070e6e0d39 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 @@ -221,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 b782bb90c22..ad65e2d8fc5 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 @@ -135,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 e376774a161..28ff32d43f0 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 @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4082ed0ada..7cd7d657857 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 @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d2..51a513be4a1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,7 +63,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71e..4d903ec4d45 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 b1cc1b13819..eabe6a173bb 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 @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 07a612c1f00..9af78b50a14 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 @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(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 c57472af9f0..b8453c0e955 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 @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 3d0061c01c9..73e649ff1fa 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 @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 445248fface..3a35d693a21 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 @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 403bb06d3e9..3693c1e2cdc 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 @@ -56,7 +56,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -270,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d9dad261bd..9f25b2a6d30 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 @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 0de3b216df4..bedacb16913 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 @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ef8add1aada..cf6ef04de76 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 @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b8352d3c3b..e18abf20e32 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 @@ -167,6 +167,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -190,7 +193,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 af0b85f4118..45ca7506a72 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 @@ -197,6 +197,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -220,7 +223,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 95032c71bc0..b29fba7c1b6 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 @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 bc5780cb632..cf5cce31bc5 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 @@ -75,7 +75,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -90,10 +90,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -108,10 +108,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -126,10 +126,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -144,10 +144,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -977,7 +977,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/build.gradle b/samples/client/petstore/java/resttemplate-jakarta/build.gradle index 46db68d6e80..04779860a1e 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/build.gradle +++ b/samples/client/petstore/java/resttemplate-jakarta/build.gradle @@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } // Rename the aar correctly @@ -66,7 +66,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 publishing { publications { @@ -91,24 +91,22 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } ext { - swagger_annotations_version = "1.6.9" jackson_version = "2.14.1" jackson_databind_version = "2.14.1" jackson_databind_nullable_version = "0.2.6" - jakarta_annotation_version = "1.3.5" - spring_web_version = "5.3.24" + spring_web_version = "6.0.3" + jakarta_annotation_version = "2.1.1" jodatime_version = "2.9.9" junit_version = "4.13.2" } dependencies { - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.springframework:spring-web:$spring_web_version" implementation "org.springframework:spring-context:$spring_web_version" diff --git a/samples/client/petstore/java/resttemplate-jakarta/gradlew b/samples/client/petstore/java/resttemplate-jakarta/gradlew old mode 100644 new mode 100755 diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/ApiClient.java index c6b8de1d33d..9dc97571d97 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/ApiClient.java @@ -58,7 +58,6 @@ import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.ApiClient") public class ApiClient extends JavaTimeFormatter { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -92,7 +91,6 @@ public class ApiClient extends JavaTimeFormatter { init(); } - @Autowired public ApiClient(RestTemplate restTemplate) { this.restTemplate = restTemplate; init(); diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/PetApi.java index b65ff8d09dd..ade2b53c084 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/PetApi.java @@ -28,7 +28,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.PetApi") public class PetApi { private ApiClient apiClient; @@ -36,7 +35,6 @@ public class PetApi { this(new ApiClient()); } - @Autowired public PetApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/StoreApi.java index 4b7c551119a..d2fa07f1e39 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/StoreApi.java @@ -26,7 +26,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.StoreApi") public class StoreApi { private ApiClient apiClient; @@ -34,7 +33,6 @@ public class StoreApi { this(new ApiClient()); } - @Autowired public StoreApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/UserApi.java index 1f19f553c9c..10d0d6bed3c 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,7 +27,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.UserApi") public class UserApi { private ApiClient apiClient; @@ -35,7 +34,6 @@ public class UserApi { this(new ApiClient()); } - @Autowired public UserApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java index ae6f22ff7e6..da5171a054f 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 15f94f82a40..dfafbc5b2ce 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java index a7e56dad9aa..43a535ed359 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java index 5002324b301..74158a9b2eb 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java @@ -53,7 +53,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -183,6 +183,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -268,7 +271,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java index a3dfb40983b..e1a3ebb780a 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java index 54c65485694..bcf36d2d8e2 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/build.gradle b/samples/client/petstore/java/resttemplate-swagger1/build.gradle index 46db68d6e80..96b3d8f412e 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/build.gradle +++ b/samples/client/petstore/java/resttemplate-swagger1/build.gradle @@ -66,7 +66,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -91,7 +91,7 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } @@ -101,8 +101,8 @@ ext { jackson_version = "2.14.1" jackson_databind_version = "2.14.1" jackson_databind_nullable_version = "0.2.6" - jakarta_annotation_version = "1.3.5" spring_web_version = "5.3.24" + jakarta_annotation_version = "1.3.5" jodatime_version = "2.9.9" junit_version = "4.13.2" } diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/ApiClient.java index 1adabd0c01a..43d2387c888 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/ApiClient.java @@ -58,7 +58,6 @@ import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.ApiClient") public class ApiClient extends JavaTimeFormatter { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -92,7 +91,6 @@ public class ApiClient extends JavaTimeFormatter { init(); } - @Autowired public ApiClient(RestTemplate restTemplate) { this.restTemplate = restTemplate; init(); diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/PetApi.java index 6dcab96f8cd..56085d401a6 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/PetApi.java @@ -28,7 +28,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.PetApi") public class PetApi { private ApiClient apiClient; @@ -36,7 +35,6 @@ public class PetApi { this(new ApiClient()); } - @Autowired public PetApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java index 3172d5ab47e..0274b05080b 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java @@ -26,7 +26,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.StoreApi") public class StoreApi { private ApiClient apiClient; @@ -34,7 +33,6 @@ public class StoreApi { this(new ApiClient()); } - @Autowired public StoreApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/UserApi.java index c05c7830e97..51dcb10ef63 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,7 +27,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.UserApi") public class UserApi { private ApiClient apiClient; @@ -35,7 +34,6 @@ public class UserApi { this(new ApiClient()); } - @Autowired public UserApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java index 998f801cc46..6fb3a740c3d 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java @@ -97,7 +97,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fdc794743a5..8cb3529ef72 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -129,7 +129,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java index 27f2091a238..130272bcf51 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java @@ -259,7 +259,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java index 040ddedd0ba..fa47ea018ad 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java @@ -56,7 +56,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -189,6 +189,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -277,7 +280,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java index d2b5aed75a7..f45052e1c9d 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java @@ -97,7 +97,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java index 692ff39362e..a72584d46c5 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java @@ -283,7 +283,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index 6882fdc04a2..52ead24bbae 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -66,7 +66,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -91,24 +91,22 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } ext { - swagger_annotations_version = "1.6.9" jackson_version = "2.14.1" jackson_databind_version = "2.14.1" jackson_databind_nullable_version = "0.2.6" - jakarta_annotation_version = "1.3.5" spring_web_version = "5.3.24" + jakarta_annotation_version = "1.3.5" jodatime_version = "2.9.9" junit_version = "4.13.2" } dependencies { - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.springframework:spring-web:$spring_web_version" implementation "org.springframework:spring-context:$spring_web_version" 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 a94b4917a8c..cdbe1ed2673 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 @@ -64,7 +64,6 @@ import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.ApiClient") public class ApiClient extends JavaTimeFormatter { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -98,7 +97,6 @@ public class ApiClient extends JavaTimeFormatter { init(); } - @Autowired public ApiClient(RestTemplate restTemplate) { this.restTemplate = restTemplate; init(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 67aa8844f17..7a14617aa42 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -26,7 +26,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.AnotherFakeApi") public class AnotherFakeApi { private ApiClient apiClient; @@ -34,7 +33,6 @@ public class AnotherFakeApi { this(new ApiClient()); } - @Autowired public AnotherFakeApi(ApiClient apiClient) { this.apiClient = apiClient; } 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 3251aaa0e15..d0a6a8ccd77 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 @@ -34,7 +34,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.FakeApi") public class FakeApi { private ApiClient apiClient; @@ -42,7 +41,6 @@ public class FakeApi { this(new ApiClient()); } - @Autowired public FakeApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index eebf656bb5c..6744a0f8826 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -26,7 +26,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.FakeClassnameTags123Api") public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -34,7 +33,6 @@ public class FakeClassnameTags123Api { this(new ApiClient()); } - @Autowired public FakeClassnameTags123Api(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java index 2d26052eb28..43440d7863d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java @@ -29,7 +29,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.PetApi") public class PetApi { private ApiClient apiClient; @@ -37,7 +36,6 @@ public class PetApi { this(new ApiClient()); } - @Autowired public PetApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java index b45b41c32fd..2ece51a779c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java @@ -26,7 +26,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.StoreApi") public class StoreApi { private ApiClient apiClient; @@ -34,7 +33,6 @@ public class StoreApi { this(new ApiClient()); } - @Autowired public StoreApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java index 55369257c1e..b48b7d47c89 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,7 +27,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.UserApi") public class UserApi { private ApiClient apiClient; @@ -35,7 +34,6 @@ public class UserApi { this(new ApiClient()); } - @Autowired public UserApi(ApiClient apiClient) { this.apiClient = apiClient; } 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 8418b0b9853..ece7706af1d 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 @@ -75,7 +75,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 87ca684b81a..301073a6ff0 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 @@ -76,7 +76,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 e51ead6b044..0649b7bb61c 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 @@ -75,7 +75,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 5b8cb3220b2..75fe8a77fcf 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 @@ -478,7 +478,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 c40a77e16d2..97cce0de607 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 @@ -75,7 +75,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 b6b9b70eedd..2dbaba31e3d 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 @@ -76,7 +76,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 df46d42d6e3..5d329ba379b 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 @@ -75,7 +75,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 72fa3fd1879..e8b2ca8be2b 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 @@ -75,7 +75,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 6304aa13cce..5d517bd7302 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 @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.dataformat.xml.annotation.*; @@ -122,7 +119,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 960bb779b35..340c4bc13fd 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 @@ -46,7 +46,7 @@ public class ArrayOfArrayOfNumberOnly { // items.name=arrayArrayNumber items.baseName=arrayArrayNumber items.xmlName= items.xmlNamespace= // items.example= items.type=List<BigDecimal> @XmlElement(name = "arrayArrayNumber") - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -84,7 +84,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 3ff8fa2e779..7cb2459021f 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 @@ -46,7 +46,7 @@ public class ArrayOfNumberOnly { // items.name=arrayNumber items.baseName=arrayNumber items.xmlName= items.xmlNamespace= // items.example= items.type=BigDecimal @XmlElement(name = "arrayNumber") - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -84,7 +84,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 b2c1f7ea3d4..efb117c1b07 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 @@ -48,21 +48,21 @@ public class ArrayTest { // items.name=arrayOfString items.baseName=arrayOfString items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "arrayOfString") - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "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<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "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<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -168,7 +168,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java index 96c4f6486a9..26fcad09980 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java @@ -128,6 +128,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java index bf1526857ae..617e7b6a1da 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 5ee0fad069c..f236752bfc0 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 @@ -237,7 +237,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 24eb8295dd3..5d49eac98c8 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 @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.dataformat.xml.annotation.*; @@ -87,6 +86,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 7eafd8fa288..1a3e13dfd3c 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 @@ -73,7 +73,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 3ae14a8a4f1..aa7564f66b5 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 @@ -105,7 +105,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 c3811deb1bf..17724868acc 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 @@ -72,7 +72,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 408f75774e7..f54674aed58 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 @@ -72,7 +72,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 e3c285cb3c0..b9dd97caa94 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 @@ -83,6 +83,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 c0cd8c02386..334c5ff8c0b 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 @@ -73,7 +73,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 2c94312ead5..caa3a5fc0e9 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 @@ -128,7 +128,7 @@ public class EnumArrays { // items.name=arrayEnum items.baseName=arrayEnum items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "arrayEnum") - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -194,7 +194,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 a9eb0adf4d7..4507a8572fe 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 @@ -368,7 +368,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 89eaa3f6e88..eddb5c22f96 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 @@ -51,7 +51,7 @@ public class FileSchemaTestClass { // items.name=files items.baseName=files items.xmlName= items.xmlNamespace= // items.example= items.type=ModelFile @XmlElement(name = "files") - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -117,7 +117,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 6fd0fc74d61..77e2ae4889c 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 @@ -518,7 +518,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 8d17a0b8a73..776cb182051 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 @@ -82,7 +82,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 ccce10e4b48..796d8f5b289 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 @@ -248,7 +248,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 bab8f1621f1..ac69d68d001 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 @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 e924373ead0..3091fbe093a 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 @@ -106,7 +106,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 9de4150675f..1b9c66fb90e 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 @@ -139,7 +139,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java index 5ea992eb114..c9a633b9502 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java @@ -73,7 +73,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java index 2a312ed9331..d956edcb721 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java @@ -73,7 +73,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 8d1b414b0b7..333ba4e0a01 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 @@ -73,7 +73,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 fc1158316e9..a9cbdbfbb83 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 @@ -147,7 +147,6 @@ public class Name { - @Override public boolean equals(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 36b35c7299a..dde269e3700 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 @@ -73,7 +73,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 486d1a2824b..fd6e4549f90 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 @@ -281,7 +281,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 2464e94e5c0..05846343834 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 @@ -139,7 +139,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 81128b586c2..5f56e0a02ae 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 @@ -76,7 +76,7 @@ public class Pet { // items.example= items.type=Tag @XmlElement(name = "tags") @XmlElementWrapper(name = "tag") - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -218,6 +218,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -312,7 +315,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 d86bc539cce..9490b6e0622 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 @@ -93,7 +93,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 446af7f5e0e..4b865f05653 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 @@ -73,7 +73,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 b24ff035a84..c85ecc1b58f 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 @@ -105,7 +105,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 55727d356cc..1ba86661029 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 @@ -190,6 +190,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -213,7 +216,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 cd1ba842633..a969eaf9e0d 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 @@ -223,6 +223,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -246,7 +249,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 130e957aa7d..47f1b84e11a 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 @@ -303,7 +303,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 08a9c08c120..fa34d0b05b6 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 @@ -91,7 +91,7 @@ public class XmlItem { // items.example= items.type=Integer @XmlElement(name = "wrappedArray") @XmlElementWrapper(name = "wrapped_array") - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; @XmlElement(name = "xml_name_string") @@ -114,7 +114,7 @@ public class XmlItem { // 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<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; // Is a container wrapped=true @@ -122,7 +122,7 @@ public class XmlItem { // items.example= items.type=Integer @XmlElement(name = "xml_name_wrapped_array_item") @XmlElementWrapper(name = "xml_name_wrapped_array") - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; @XmlElement(name = "prefix_string") @@ -145,7 +145,7 @@ public class XmlItem { // items.name=prefixArray items.baseName=prefixArray items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "prefixArray") - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; // Is a container wrapped=true @@ -153,7 +153,7 @@ public class XmlItem { // items.example= items.type=Integer @XmlElement(name = "prefixWrappedArray") @XmlElementWrapper(name = "prefix_wrapped_array") - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; @XmlElement(namespace="http://a.com/schema", name = "namespace_string") @@ -176,7 +176,7 @@ public class XmlItem { // 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<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; // Is a container wrapped=true @@ -184,7 +184,7 @@ public class XmlItem { // 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<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; @XmlElement(namespace="http://a.com/schema", name = "prefix_ns_string") @@ -207,7 +207,7 @@ public class XmlItem { // 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<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; // Is a container wrapped=true @@ -215,7 +215,7 @@ public class XmlItem { // 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<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -1105,7 +1105,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index 46db68d6e80..c97d101a7c4 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -66,7 +66,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -91,24 +91,22 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } ext { - swagger_annotations_version = "1.6.9" jackson_version = "2.14.1" jackson_databind_version = "2.14.1" jackson_databind_nullable_version = "0.2.6" - jakarta_annotation_version = "1.3.5" spring_web_version = "5.3.24" + jakarta_annotation_version = "1.3.5" jodatime_version = "2.9.9" junit_version = "4.13.2" } dependencies { - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.springframework:spring-web:$spring_web_version" implementation "org.springframework:spring-context:$spring_web_version" 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 64b9513ef33..2633f1cb708 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 @@ -59,7 +59,6 @@ import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.ApiClient") public class ApiClient extends JavaTimeFormatter { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -93,7 +92,6 @@ public class ApiClient extends JavaTimeFormatter { init(); } - @Autowired public ApiClient(RestTemplate restTemplate) { this.restTemplate = restTemplate; init(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 67aa8844f17..7a14617aa42 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -26,7 +26,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.AnotherFakeApi") public class AnotherFakeApi { private ApiClient apiClient; @@ -34,7 +33,6 @@ public class AnotherFakeApi { this(new ApiClient()); } - @Autowired public AnotherFakeApi(ApiClient apiClient) { this.apiClient = apiClient; } 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 3251aaa0e15..d0a6a8ccd77 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 @@ -34,7 +34,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.FakeApi") public class FakeApi { private ApiClient apiClient; @@ -42,7 +41,6 @@ public class FakeApi { this(new ApiClient()); } - @Autowired public FakeApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index eebf656bb5c..6744a0f8826 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -26,7 +26,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.FakeClassnameTags123Api") public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -34,7 +33,6 @@ public class FakeClassnameTags123Api { this(new ApiClient()); } - @Autowired public FakeClassnameTags123Api(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java index 2d26052eb28..43440d7863d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java @@ -29,7 +29,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.PetApi") public class PetApi { private ApiClient apiClient; @@ -37,7 +36,6 @@ public class PetApi { this(new ApiClient()); } - @Autowired public PetApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java index b45b41c32fd..2ece51a779c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java @@ -26,7 +26,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.StoreApi") public class StoreApi { private ApiClient apiClient; @@ -34,7 +33,6 @@ public class StoreApi { this(new ApiClient()); } - @Autowired public StoreApi(ApiClient apiClient) { this.apiClient = apiClient; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java index 55369257c1e..b48b7d47c89 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,7 +27,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@Component("org.openapitools.client.api.UserApi") public class UserApi { private ApiClient apiClient; @@ -35,7 +34,6 @@ public class UserApi { this(new ApiClient()); } - @Autowired public UserApi(ApiClient apiClient) { this.apiClient = apiClient; } 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 a68ffae2eaf..d1b32ac9653 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 e41df9071f4..8fe930dfe2b 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b7e04b01c5..773db816ab8 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 765ed621329..5dbb3f42d39 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 @@ -88,6 +88,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap<>(); + } this.mapString.put(key, mapStringItem); return this; } @@ -119,6 +122,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap<>(); + } this.mapNumber.put(key, mapNumberItem); return this; } @@ -150,6 +156,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap<>(); + } this.mapInteger.put(key, mapIntegerItem); return this; } @@ -181,6 +190,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap<>(); + } this.mapBoolean.put(key, mapBooleanItem); return this; } @@ -212,6 +224,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap<>(); + } this.mapArrayInteger.put(key, mapArrayIntegerItem); return this; } @@ -243,6 +258,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap<>(); + } this.mapArrayAnytype.put(key, mapArrayAnytypeItem); return this; } @@ -274,6 +292,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap<>(); + } this.mapMapString.put(key, mapMapStringItem); return this; } @@ -305,6 +326,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap<>(); + } this.mapMapAnytype.put(key, mapMapAnytypeItem); return this; } @@ -406,7 +430,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 38420a93f1a..0e5d01114b1 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 c9dafbb1f03..792fc1bbbe9 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 996c6413244..3f540e7de47 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 d7e667ed8d1..7231ea54b16 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 6c603bf62cf..a40c65533eb 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 @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -109,7 +106,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 458dcd501b7..e68f1d1d56a 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 @@ -47,6 +47,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } @@ -70,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 1bf6b6eca33..b6189104c30 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 @@ -47,6 +47,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } this.arrayNumber.add(arrayNumberItem); return this; } @@ -70,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 6fa67a39efd..52d07003963 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 @@ -55,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -86,6 +89,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -117,6 +123,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } @@ -140,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java index 7928f0f2d61..e80a952e274 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java @@ -112,6 +112,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b..e357e3111ca 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -102,7 +102,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 8f0460343a9..ed4f3970651 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 @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 97ffcf45b25..a0a6af014cd 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 @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -77,6 +76,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 89e6e65c05e..7c404d48482 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 @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 a78b9d41507..a599f6689ed 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 @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 9870d339058..f5db7231aef 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 @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 314945b1bbb..764697f4191 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 @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 5de0e902a04..f77566c7746 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 @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 55d3afa8167..2978c34e2cc 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 @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 4e390827d8a..13007002025 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 @@ -146,6 +146,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } this.arrayEnum.add(arrayEnumItem); return this; } @@ -169,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 7ef8de6dfc8..0b2ba27fcb6 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 @@ -328,7 +328,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 d6a00997d93..a338a0598c8 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 @@ -77,6 +77,9 @@ public class FileSchemaTestClass { } public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } this.files.add(filesItem); return this; } @@ -100,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 ed2ed565601..9831eac4992 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 @@ -468,7 +468,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 2b2c88b9156..cdb08919cbf 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 @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 dc7486f4194..417563b5d44 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 @@ -93,6 +93,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -124,6 +127,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } @@ -155,6 +161,9 @@ public class MapTest { } public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } this.directMap.put(key, directMapItem); return this; } @@ -186,6 +195,9 @@ public class MapTest { } public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } this.indirectMap.put(key, indirectMapItem); return this; } @@ -209,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 e7f63f4af67..e90966d8648 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 @@ -109,6 +109,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } this.map.put(key, mapItem); return this; } @@ -132,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 e376774a161..28ff32d43f0 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 @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4082ed0ada..7cd7d657857 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 @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d2..51a513be4a1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,7 +63,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71e..4d903ec4d45 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 b1cc1b13819..eabe6a173bb 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 @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 07a612c1f00..9af78b50a14 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 @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(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 c57472af9f0..b8453c0e955 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 @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 3d0061c01c9..73e649ff1fa 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 @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 445248fface..3a35d693a21 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 @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 beca2d006a6..f6f901c99f0 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 @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -218,6 +221,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } this.tags.add(tagsItem); return this; } @@ -267,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d9dad261bd..9f25b2a6d30 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 @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 0de3b216df4..bedacb16913 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 @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ef8add1aada..cf6ef04de76 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 @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 0aea34bdbc6..202e142bddb 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 @@ -167,6 +167,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -190,7 +193,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 21904a8fefe..6be2e8f6eb8 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 @@ -197,6 +197,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -220,7 +223,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 95032c71bc0..b29fba7c1b6 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 @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 e23a10154fc..cf5cce31bc5 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 @@ -263,6 +263,9 @@ public class XmlItem { } public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList<>(); + } this.wrappedArray.add(wrappedArrayItem); return this; } @@ -398,6 +401,9 @@ public class XmlItem { } public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList<>(); + } this.nameArray.add(nameArrayItem); return this; } @@ -429,6 +435,9 @@ public class XmlItem { } public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList<>(); + } this.nameWrappedArray.add(nameWrappedArrayItem); return this; } @@ -564,6 +573,9 @@ public class XmlItem { } public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList<>(); + } this.prefixArray.add(prefixArrayItem); return this; } @@ -595,6 +607,9 @@ public class XmlItem { } public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList<>(); + } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; } @@ -730,6 +745,9 @@ public class XmlItem { } public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList<>(); + } this.namespaceArray.add(namespaceArrayItem); return this; } @@ -761,6 +779,9 @@ public class XmlItem { } public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList<>(); + } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; } @@ -896,6 +917,9 @@ public class XmlItem { } public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList<>(); + } this.prefixNsArray.add(prefixNsArrayItem); return this; } @@ -927,6 +951,9 @@ public class XmlItem { } public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList<>(); + } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; } @@ -950,7 +977,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { 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 e8200553ab2..3c45f1fc84a 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 @@ -68,7 +68,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7ec58cb31ef..190767650a5 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 @@ -69,7 +69,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 4a951a9ee93..b2e14e6a01e 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 @@ -68,7 +68,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 8e3262c9ca0..957897178a4 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 @@ -448,7 +448,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 1a5d4ee039a..6b63f8c6470 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 @@ -68,7 +68,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 19e27633b46..cfaa45e63c8 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 @@ -69,7 +69,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 74e1171c664..ee067e4bdbc 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 @@ -68,7 +68,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 68048830ae4..d2574d22d8c 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 @@ -68,7 +68,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 8958b1c8497..49ce8ad9622 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 @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; @@ -114,7 +111,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 f21e248f733..9177806e1ea 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 @@ -37,7 +37,7 @@ import javax.validation.Valid; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 64b6b2ab61c..b1b97c48f92 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 @@ -37,7 +37,7 @@ import javax.validation.Valid; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 5973087e536..018de202529 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 @@ -39,13 +39,13 @@ import javax.validation.Valid; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -156,7 +156,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java index 3fcaf0c9225..cb9b9bd9a96 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -115,6 +115,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 6c0bb23d8c3..c9b7b7bf9b9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -105,7 +105,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 c4cec1dfdd3..85a7363acde 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 @@ -220,7 +220,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 0037a486368..f2255b50b92 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 @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.validation.constraints.*; @@ -80,6 +79,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 f678a8e68e1..149c8334327 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 @@ -66,7 +66,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 cc41e9f9bbb..db98e38d04c 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 @@ -97,7 +97,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 640c7e7f64e..f27e6602234 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 @@ -65,7 +65,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 51d82786848..dcaab8e67ca 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 @@ -65,7 +65,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 58471fd14aa..d4dac86eaef 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 @@ -76,6 +76,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 1139310f535..7d0c456524f 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 @@ -66,7 +66,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 bc7874f42fb..e67a710f1f9 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 @@ -110,7 +110,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -176,7 +176,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 d2017a8d86f..cce345eacbe 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 @@ -337,7 +337,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 50c5aa83d7e..451e3f3b707 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 @@ -41,7 +41,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -109,7 +109,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d205cb03f8..2b21678a0f3 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 @@ -494,7 +494,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 1cce647184e..1fea556b2eb 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 @@ -85,7 +85,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 77ddaf9a501..53aafffc176 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 @@ -228,7 +228,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 a0dca748c46..5c07ddce048 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 @@ -143,7 +143,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 8c1f8d3019a..9fec85a142c 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 @@ -97,7 +97,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 a50478222f7..4f03ac75627 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 @@ -128,7 +128,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java index 7ef37c8d48d..4528205a367 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java @@ -66,7 +66,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java index d4e547b9ebe..85806593098 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java @@ -66,7 +66,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 ef6ba491632..76ba000a8d7 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 @@ -66,7 +66,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 c46d58b4050..2ef7d373592 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 @@ -147,7 +147,6 @@ public class Name { - @Override public boolean equals(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 e37b72ed8a3..33ce4f21fc4 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 @@ -67,7 +67,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 221dca5d302..0a4269883b5 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 @@ -259,7 +259,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 cd89b4fd527..7c0884d9428 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 @@ -129,7 +129,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 8d284276040..8e041025a75 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 @@ -58,7 +58,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -193,6 +193,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -282,7 +285,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 aa58e932e80..01583e7a1af 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 @@ -93,7 +93,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 bf5d28f4ce4..e591ecb24c8 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 @@ -66,7 +66,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 6e0f9c74de8..f94da1cd07d 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 @@ -96,7 +96,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 9ca4f41a5f0..03857841174 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 @@ -178,6 +178,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -203,7 +206,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 0a72bfddcea..fdfe42fb025 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 @@ -210,6 +210,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -235,7 +238,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 616e6e7af44..c68d011c326 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 @@ -282,7 +282,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 8a3c6d554dd..39785f0197e 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 @@ -77,7 +77,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -92,10 +92,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -110,10 +110,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -128,10 +128,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -146,10 +146,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -1013,7 +1013,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { 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 7262f72236b..cd9c1047973 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 86ea0dc3290..89ef30860c6 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 @@ -59,7 +59,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 3217915b619..6851472918d 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 1051d3bdafc..285876fa96e 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 @@ -383,7 +383,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 7299ac57367..21f462b26d5 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 24ff35983cb..9ef3d4bca00 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 @@ -59,7 +59,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 34204eee903..7df510e593c 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 8cc4539dccd..dc01e342b21 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 14e0f6107e6..e72d8cf6d8c 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 @@ -21,9 +21,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; /** * Animal @@ -84,7 +81,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 7d8ee05bce7..8e85bba5a17 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 @@ -32,7 +32,7 @@ import java.util.List; 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; public ArrayOfArrayOfNumberOnly() { } @@ -66,7 +66,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 85e90450532..3dceb648866 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 @@ -32,7 +32,7 @@ import java.util.List; 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; public ArrayOfNumberOnly() { } @@ -66,7 +66,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 f064c823a7f..7389aa67003 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 @@ -32,15 +32,15 @@ import org.openapitools.client.model.ReadOnlyFirst; 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; 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; 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; public ArrayTest() { } @@ -134,7 +134,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java index 0934134ef1d..5c0294de675 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java @@ -108,6 +108,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a4995b1f3bc..dc77482df48 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -106,7 +106,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 1c1a8c70ec3..68df4a1087b 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 @@ -185,7 +185,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 4196be52de5..cbbde4050b4 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 @@ -22,7 +22,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; /** * Cat @@ -58,6 +57,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 d4046608181..1af3ba94019 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 @@ -55,7 +55,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 1dfb7754208..44dd9a5ded1 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 @@ -81,7 +81,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 eae29993de2..7e21a4c0cae 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 @@ -55,7 +55,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 b6564700cbd..e47f4bda5de 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 @@ -55,7 +55,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 b7685e59ec6..9ac61811954 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 @@ -57,6 +57,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 e9c148729fe..ba9be150d62 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 @@ -55,7 +55,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 ed2e619beb9..65136ad6908 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 @@ -129,7 +129,7 @@ public class EnumArrays { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -185,7 +185,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 a4e074625bd..16d8e739f61 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 @@ -352,7 +352,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 255d299b1dd..92053e4f556 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 @@ -36,7 +36,7 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -92,7 +92,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 1a2a7061b9a..4a67a31ec94 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 @@ -408,7 +408,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 372c20bf8c2..7262c5e77a8 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 @@ -73,7 +73,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 21f0bc158bd..e1171ab5e96 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 @@ -214,7 +214,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 375ab7405d3..32e24753481 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 @@ -120,7 +120,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 50d580b399d..e94dde7ca09 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 @@ -81,7 +81,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 9e61dadbdf6..2ea517fb5ee 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 @@ -107,7 +107,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java index 9b797d92c4d..d6250ed246b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -55,7 +55,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java index c764b1708c7..62eb75ed7b5 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java @@ -55,7 +55,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 a6d47eb184d..607d9fecd6e 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 @@ -55,7 +55,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 ccd23bc9a52..b6867bd15f5 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 @@ -125,7 +125,6 @@ public class Name { - @Override public boolean equals(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 dd92accf170..343c3b782ef 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 @@ -56,7 +56,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 71aebe6d380..cd6450bb82b 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 @@ -235,7 +235,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 8ad961b0456..16a0936a8a4 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 @@ -108,7 +108,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 619410ccedf..1f9fdc39d7a 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 @@ -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; /** * pet status in the store @@ -182,6 +182,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -253,7 +256,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 e6294966e12..c8ed93e918b 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 @@ -80,7 +80,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 224c95abe41..b6bf8823d34 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 @@ -55,7 +55,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ccead09e04b..2b31a772344 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 @@ -81,7 +81,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 365dc6b0bf7..e19ec8f1bd8 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 @@ -148,6 +148,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -167,7 +170,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 487cc1f5658..5d6d048bbaa 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 @@ -174,6 +174,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -193,7 +196,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 3928bcb1fde..061c87d0d06 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 @@ -237,7 +237,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 7f4526ae0ba..70afa100804 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 @@ -48,7 +48,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; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -68,11 +68,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; 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; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -92,11 +92,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; 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; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -116,11 +116,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; 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; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -140,11 +140,11 @@ 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; 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; public XmlItem() { } @@ -858,7 +858,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { 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 7262f72236b..cd9c1047973 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 86ea0dc3290..89ef30860c6 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 @@ -59,7 +59,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 3217915b619..6851472918d 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 1051d3bdafc..285876fa96e 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 @@ -383,7 +383,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 7299ac57367..21f462b26d5 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 24ff35983cb..9ef3d4bca00 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 @@ -59,7 +59,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 34204eee903..7df510e593c 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 8cc4539dccd..dc01e342b21 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 @@ -58,7 +58,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 14e0f6107e6..e72d8cf6d8c 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 @@ -21,9 +21,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; /** * Animal @@ -84,7 +81,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 7d8ee05bce7..8e85bba5a17 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 @@ -32,7 +32,7 @@ import java.util.List; 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; public ArrayOfArrayOfNumberOnly() { } @@ -66,7 +66,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 85e90450532..3dceb648866 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 @@ -32,7 +32,7 @@ import java.util.List; 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; public ArrayOfNumberOnly() { } @@ -66,7 +66,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 f064c823a7f..7389aa67003 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 @@ -32,15 +32,15 @@ import org.openapitools.client.model.ReadOnlyFirst; 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; 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; 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; public ArrayTest() { } @@ -134,7 +134,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java index 0934134ef1d..5c0294de675 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java @@ -108,6 +108,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a4995b1f3bc..dc77482df48 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -106,7 +106,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 1c1a8c70ec3..68df4a1087b 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 @@ -185,7 +185,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 4196be52de5..cbbde4050b4 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 @@ -22,7 +22,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; /** * Cat @@ -58,6 +57,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 d4046608181..1af3ba94019 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 @@ -55,7 +55,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 1dfb7754208..44dd9a5ded1 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 @@ -81,7 +81,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 eae29993de2..7e21a4c0cae 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 @@ -55,7 +55,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 b6564700cbd..e47f4bda5de 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 @@ -55,7 +55,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 b7685e59ec6..9ac61811954 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 @@ -57,6 +57,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 e9c148729fe..ba9be150d62 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 @@ -55,7 +55,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 ed2e619beb9..65136ad6908 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 @@ -129,7 +129,7 @@ public class EnumArrays { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -185,7 +185,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 a4e074625bd..16d8e739f61 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 @@ -352,7 +352,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 255d299b1dd..92053e4f556 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 @@ -36,7 +36,7 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -92,7 +92,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 1a2a7061b9a..4a67a31ec94 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 @@ -408,7 +408,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 372c20bf8c2..7262c5e77a8 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 @@ -73,7 +73,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 21f0bc158bd..e1171ab5e96 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 @@ -214,7 +214,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 375ab7405d3..32e24753481 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 @@ -120,7 +120,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 50d580b399d..e94dde7ca09 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 @@ -81,7 +81,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 9e61dadbdf6..2ea517fb5ee 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 @@ -107,7 +107,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java index 9b797d92c4d..d6250ed246b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -55,7 +55,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java index c764b1708c7..62eb75ed7b5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java @@ -55,7 +55,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 a6d47eb184d..607d9fecd6e 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 @@ -55,7 +55,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 ccd23bc9a52..b6867bd15f5 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 @@ -125,7 +125,6 @@ public class Name { - @Override public boolean equals(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 dd92accf170..343c3b782ef 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 @@ -56,7 +56,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 71aebe6d380..cd6450bb82b 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 @@ -235,7 +235,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 8ad961b0456..16a0936a8a4 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 @@ -108,7 +108,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 619410ccedf..1f9fdc39d7a 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 @@ -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; /** * pet status in the store @@ -182,6 +182,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -253,7 +256,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 e6294966e12..c8ed93e918b 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 @@ -80,7 +80,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 224c95abe41..b6bf8823d34 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 @@ -55,7 +55,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ccead09e04b..2b31a772344 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 @@ -81,7 +81,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 365dc6b0bf7..e19ec8f1bd8 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 @@ -148,6 +148,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -167,7 +170,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 487cc1f5658..5d6d048bbaa 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 @@ -174,6 +174,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -193,7 +196,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 3928bcb1fde..061c87d0d06 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 @@ -237,7 +237,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 7f4526ae0ba..70afa100804 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 @@ -48,7 +48,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; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -68,11 +68,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; 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; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -92,11 +92,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; 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; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -116,11 +116,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; 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; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -140,11 +140,11 @@ 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; 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; public XmlItem() { } @@ -858,7 +858,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 7262f72236b..cd9c1047973 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -58,7 +58,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 86ea0dc3290..89ef30860c6 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -59,7 +59,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 3217915b619..6851472918d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -58,7 +58,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 1051d3bdafc..285876fa96e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -383,7 +383,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 7299ac57367..21f462b26d5 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -58,7 +58,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 24ff35983cb..9ef3d4bca00 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -59,7 +59,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 34204eee903..7df510e593c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -58,7 +58,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8cc4539dccd..dc01e342b21 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -58,7 +58,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java index 14e0f6107e6..e72d8cf6d8c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java @@ -21,9 +21,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; /** * Animal @@ -84,7 +81,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7d8ee05bce7..8e85bba5a17 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -32,7 +32,7 @@ import java.util.List; 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; public ArrayOfArrayOfNumberOnly() { } @@ -66,7 +66,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 85e90450532..3dceb648866 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -32,7 +32,7 @@ import java.util.List; 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; public ArrayOfNumberOnly() { } @@ -66,7 +66,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java index f064c823a7f..7389aa67003 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -32,15 +32,15 @@ import org.openapitools.client.model.ReadOnlyFirst; 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; 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; 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; public ArrayTest() { } @@ -134,7 +134,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java index 0934134ef1d..5c0294de675 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java @@ -108,6 +108,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a4995b1f3bc..dc77482df48 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -106,7 +106,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java index 1c1a8c70ec3..68df4a1087b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java @@ -185,7 +185,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java index 4196be52de5..cbbde4050b4 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java @@ -22,7 +22,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; /** * Cat @@ -58,6 +57,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java index d4046608181..1af3ba94019 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -55,7 +55,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java index 1dfb7754208..44dd9a5ded1 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java @@ -81,7 +81,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java index eae29993de2..7e21a4c0cae 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -55,7 +55,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java index b6564700cbd..e47f4bda5de 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java @@ -55,7 +55,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java index b7685e59ec6..9ac61811954 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java @@ -57,6 +57,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java index e9c148729fe..ba9be150d62 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -55,7 +55,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java index ed2e619beb9..65136ad6908 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -129,7 +129,7 @@ public class EnumArrays { public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -185,7 +185,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java index a4e074625bd..16d8e739f61 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -352,7 +352,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 255d299b1dd..92053e4f556 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -36,7 +36,7 @@ public class FileSchemaTestClass { public static final String SERIALIZED_NAME_FILES = "files"; @SerializedName(SERIALIZED_NAME_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -92,7 +92,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java index 1a2a7061b9a..4a67a31ec94 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -408,7 +408,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 372c20bf8c2..7262c5e77a8 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -73,7 +73,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java index 21f0bc158bd..e1171ab5e96 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java @@ -214,7 +214,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 375ab7405d3..32e24753481 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -120,7 +120,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java index 50d580b399d..e94dde7ca09 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -81,7 +81,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 9e61dadbdf6..2ea517fb5ee 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -107,7 +107,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java index 9b797d92c4d..d6250ed246b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -55,7 +55,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java index c764b1708c7..62eb75ed7b5 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java @@ -55,7 +55,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java index a6d47eb184d..607d9fecd6e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -55,7 +55,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java index ccd23bc9a52..b6867bd15f5 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java @@ -125,7 +125,6 @@ public class Name { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java index dd92accf170..343c3b782ef 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -56,7 +56,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java index 71aebe6d380..cd6450bb82b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java @@ -235,7 +235,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java index 8ad961b0456..16a0936a8a4 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -108,7 +108,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java index 619410ccedf..1f9fdc39d7a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java @@ -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; /** * pet status in the store @@ -182,6 +182,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -253,7 +256,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e6294966e12..c8ed93e918b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -80,7 +80,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java index 224c95abe41..b6bf8823d34 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -55,7 +55,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java index ccead09e04b..2b31a772344 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java @@ -81,7 +81,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 365dc6b0bf7..e19ec8f1bd8 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -148,6 +148,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -167,7 +170,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 487cc1f5658..5d6d048bbaa 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -174,6 +174,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -193,7 +196,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java index 3928bcb1fde..061c87d0d06 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java @@ -237,7 +237,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java index 7f4526ae0ba..70afa100804 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java @@ -48,7 +48,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; public static final String SERIALIZED_NAME_NAME_STRING = "name_string"; @SerializedName(SERIALIZED_NAME_NAME_STRING) @@ -68,11 +68,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; 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; public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string"; @SerializedName(SERIALIZED_NAME_PREFIX_STRING) @@ -92,11 +92,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; 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; public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string"; @SerializedName(SERIALIZED_NAME_NAMESPACE_STRING) @@ -116,11 +116,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; 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; public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string"; @SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING) @@ -140,11 +140,11 @@ 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; 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; public XmlItem() { } @@ -858,7 +858,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/build.gradle b/samples/client/petstore/java/vertx-no-nullable/build.gradle index b93c988fcf6..e5042dc3c9d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/build.gradle +++ b/samples/client/petstore/java/vertx-no-nullable/build.gradle @@ -32,7 +32,7 @@ ext { swagger_annotations_version = "1.5.21" jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" - vertx_version = "3.4.2" + vertx_version = "3.5.2" junit_version = "4.13.2" jakarta_annotation_version = "1.3.5" } diff --git a/samples/client/petstore/java/vertx-no-nullable/pom.xml b/samples/client/petstore/java/vertx-no-nullable/pom.xml index e22b0ef38b6..520705c20e7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/pom.xml +++ b/samples/client/petstore/java/vertx-no-nullable/pom.xml @@ -264,7 +264,7 @@ UTF-8 - 3.4.2 + 3.5.2 1.6.6 2.13.4 2.13.4.2 diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index a68ffae2eaf..d1b32ac9653 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -65,7 +65,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index e41df9071f4..8fe930dfe2b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -66,7 +66,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7b7e04b01c5..773db816ab8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -65,7 +65,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 656bc5ced98..46ec07ac55b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -430,7 +430,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 38420a93f1a..0e5d01114b1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -65,7 +65,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index c9dafbb1f03..792fc1bbbe9 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -66,7 +66,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 996c6413244..3f540e7de47 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -65,7 +65,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index d7e667ed8d1..7231ea54b16 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -65,7 +65,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index 6c603bf62cf..a40c65533eb 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -109,7 +106,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 37fe0aed3eb..e68f1d1d56a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 39e27dda318..b6189104c30 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index dbfe323fd6c..52d07003963 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -37,13 +37,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -149,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index 7928f0f2d61..e80a952e274 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -112,6 +112,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b..e357e3111ca 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -102,7 +102,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index 8f0460343a9..ed4f3970651 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index 97ffcf45b25..a0a6af014cd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -77,6 +76,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java index 89e6e65c05e..7c404d48482 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java index a78b9d41507..a599f6689ed 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 9870d339058..f5db7231aef 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java index 314945b1bbb..764697f4191 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 5de0e902a04..f77566c7746 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa8167..2978c34e2cc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index 72549699100..13007002025 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -108,7 +108,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -172,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 7ef8de6dfc8..0b2ba27fcb6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -328,7 +328,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bd970475770..a338a0598c8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -103,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index fd10bc46a58..ce7dc954214 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -468,7 +468,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b9156..cdb08919cbf 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index 045d7b8a085..4070e6e0d39 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -221,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b782bb90c22..ad65e2d8fc5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -135,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a161..28ff32d43f0 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0ada..7cd7d657857 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d2..51a513be4a1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,7 +63,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71e..4d903ec4d45 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819..eabe6a173bb 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java index 07a612c1f00..9af78b50a14 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index c57472af9f0..b8453c0e955 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java index 3d0061c01c9..73e649ff1fa 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index 445248fface..3a35d693a21 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 403bb06d3e9..3693c1e2cdc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -56,7 +56,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -270,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 6d9dad261bd..9f25b2a6d30 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0de3b216df4..bedacb16913 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index ef8add1aada..cf6ef04de76 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 7b8352d3c3b..e18abf20e32 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -167,6 +167,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -190,7 +193,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index af0b85f4118..45ca7506a72 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -197,6 +197,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -220,7 +223,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java index 95032c71bc0..b29fba7c1b6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index bc5780cb632..cf5cce31bc5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -75,7 +75,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -90,10 +90,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -108,10 +108,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -126,10 +126,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -144,10 +144,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -977,7 +977,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index 0c19093b3d5..269c0b60e85 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -32,7 +32,7 @@ ext { swagger_annotations_version = "1.5.21" jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" - vertx_version = "3.4.2" + vertx_version = "3.5.2" junit_version = "4.13.2" jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index cb6fb45c527..a89e2636f1e 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -269,7 +269,7 @@ UTF-8 - 3.4.2 + 3.5.2 1.6.6 2.13.4 2.13.4.2 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 a68ffae2eaf..d1b32ac9653 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 e41df9071f4..8fe930dfe2b 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b7e04b01c5..773db816ab8 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 656bc5ced98..46ec07ac55b 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 @@ -430,7 +430,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { 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 38420a93f1a..0e5d01114b1 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 c9dafbb1f03..792fc1bbbe9 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 @@ -66,7 +66,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 996c6413244..3f540e7de47 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 d7e667ed8d1..7231ea54b16 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 @@ -65,7 +65,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 6c603bf62cf..a40c65533eb 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 @@ -23,9 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BigCat; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -109,7 +106,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 37fe0aed3eb..e68f1d1d56a 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 39e27dda318..b6189104c30 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 @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 dbfe323fd6c..52d07003963 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 @@ -37,13 +37,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -149,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java index 7928f0f2d61..e80a952e274 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java @@ -112,6 +112,17 @@ public class BigCat extends Cat { this.kind = kind; } + @Override + public BigCat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public BigCat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b..e357e3111ca 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -102,7 +102,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { 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 8f0460343a9..ed4f3970651 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 @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 97ffcf45b25..a0a6af014cd 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 @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.BigCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -77,6 +76,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 89e6e65c05e..7c404d48482 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 @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 a78b9d41507..a599f6689ed 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 @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 9870d339058..f5db7231aef 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 @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 314945b1bbb..764697f4191 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 @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { 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 5de0e902a04..f77566c7746 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 @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 55d3afa8167..2978c34e2cc 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 @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 72549699100..13007002025 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 @@ -108,7 +108,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -172,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 7ef8de6dfc8..0b2ba27fcb6 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 @@ -328,7 +328,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 bd970475770..a338a0598c8 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 @@ -39,7 +39,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -103,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { 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 fd10bc46a58..ce7dc954214 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 @@ -468,7 +468,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { 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 2b2c88b9156..cdb08919cbf 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 @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(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 045d7b8a085..4070e6e0d39 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 @@ -221,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 b782bb90c22..ad65e2d8fc5 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 @@ -135,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 e376774a161..28ff32d43f0 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 @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4082ed0ada..7cd7d657857 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 @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d2..51a513be4a1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,7 +63,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71e..4d903ec4d45 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 b1cc1b13819..eabe6a173bb 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 @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 07a612c1f00..9af78b50a14 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 @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(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 c57472af9f0..b8453c0e955 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 @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 3d0061c01c9..73e649ff1fa 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 @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 445248fface..3a35d693a21 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 @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { 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 403bb06d3e9..3693c1e2cdc 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 @@ -56,7 +56,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -270,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d9dad261bd..9f25b2a6d30 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 @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 0de3b216df4..bedacb16913 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 @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ef8add1aada..cf6ef04de76 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 @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 7b8352d3c3b..e18abf20e32 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 @@ -167,6 +167,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -190,7 +193,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 af0b85f4118..45ca7506a72 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 @@ -197,6 +197,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -220,7 +223,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { 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 95032c71bc0..b29fba7c1b6 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 @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { 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 bc5780cb632..cf5cce31bc5 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 @@ -75,7 +75,7 @@ public class XmlItem { private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; private String nameString; @@ -90,10 +90,10 @@ public class XmlItem { private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = new ArrayList<>(); + private List nameArray; public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; private String prefixString; @@ -108,10 +108,10 @@ public class XmlItem { private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = new ArrayList<>(); + private List prefixArray; public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; private String namespaceString; @@ -126,10 +126,10 @@ public class XmlItem { private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; private String prefixNsString; @@ -144,10 +144,10 @@ public class XmlItem { private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; public XmlItem() { } @@ -977,7 +977,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml index 2828944e554..97b8e4c677a 100644 --- a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml @@ -1507,6 +1507,9 @@ components: - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' propertyName: className properties: className: diff --git a/samples/client/petstore/java/webclient-jakarta/build.gradle b/samples/client/petstore/java/webclient-jakarta/build.gradle index 43c4dcb03aa..fe5ded3028d 100644 --- a/samples/client/petstore/java/webclient-jakarta/build.gradle +++ b/samples/client/petstore/java/webclient-jakarta/build.gradle @@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } // Rename the aar correctly @@ -66,7 +66,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 publishing { publications { @@ -91,17 +91,17 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } @@ -112,20 +112,17 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.3" - spring_boot_version = "2.6.6" + spring_boot_version = "3.0.1" + jakarta_annotation_version = "2.1.1" + reactor_version = "3.5.1" + reactor_netty_version = "1.1.1" jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" jackson_databind_nullable_version = "0.2.6" - jakarta_annotation_version = "1.3.5" - reactor_version = "3.4.3" - reactor_netty_version = "1.0.4" - jodatime_version = "2.9.9" junit_version = "4.13.2" } dependencies { - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.projectreactor:reactor-core:$reactor_version" implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" diff --git a/samples/client/petstore/java/webclient-jakarta/docs/AllOfWithSingleRef.md b/samples/client/petstore/java/webclient-jakarta/docs/AllOfWithSingleRef.md index 0a9e61bc682..4146d56a372 100644 --- a/samples/client/petstore/java/webclient-jakarta/docs/AllOfWithSingleRef.md +++ b/samples/client/petstore/java/webclient-jakarta/docs/AllOfWithSingleRef.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**username** | **String** | | [optional] | -|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | diff --git a/samples/client/petstore/java/webclient-jakarta/gradlew b/samples/client/petstore/java/webclient-jakarta/gradlew old mode 100644 new mode 100755 diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 847501a73d1..93f18e0e902 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -110,7 +110,6 @@ public class AdditionalPropertiesClass { this.mapOfMapProperty = mapOfMapProperty; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 6baa5097113..0d63515ed34 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -93,7 +93,6 @@ public class AllOfWithSingleRef { this.singleRefType = singleRefType; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java index 217f8965037..c020a225e9f 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java @@ -23,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -42,8 +40,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), }) public class Animal { @@ -107,7 +105,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 85cfd25c4aa..642275fbb2e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 1c03075765d..aa31f56852a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } @@ -73,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java index 4a8f95567c6..f4ad0883727 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -37,13 +37,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } @@ -149,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java index e9676526995..4ac983b4e66 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java index 762c68f3b8b..bbea9ebbafa 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java @@ -73,6 +73,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/CatAllOf.java index 1698aee5332..917ad5bc1d1 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java index 7012324ecc0..4cdee420aee 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java index 63f8e4250f9..9eb8bcb222b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java index a24c7a610a4..f8af7bb9f27 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java index f748b441c2e..218244ef557 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -64,7 +64,6 @@ public class DeprecatedObject { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java index e2d0287243f..af19ccec34d 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DogAllOf.java index caeaf3af061..fe797b69a73 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java index 5da8c06a69f..a1af0e7e51a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -108,7 +108,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } @@ -172,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java index dd09eef4554..7f09f74f272 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java @@ -433,7 +433,6 @@ public class EnumTest { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 318e5e3acb6..b2adc6547c1 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -39,7 +39,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } @@ -103,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java index 6b1b4b846ce..4c74d8b69af 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java @@ -62,7 +62,6 @@ public class Foo { this.bar = bar; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 2b593f7aedd..485a558db54 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -64,7 +64,6 @@ public class FooGetDefaultResponse { this.string = string; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java index f0dbe431033..b223a7bbea0 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java @@ -528,7 +528,6 @@ public class FormatTest { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e65f75da939..8718094f4a2 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 8ac56f5460b..b56b25c728e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -74,7 +74,6 @@ public class HealthCheckResult { this.nullableMessage = JsonNullable.of(nullableMessage); } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java index 1147b6b54a9..8b97703abaf 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java @@ -221,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7761b5cc7b4..eb9651ec992 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -135,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java index da6e0dc6589..b6a94dc2fa3 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index a8ff696e9ce..bba7c3d6baf 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java index 7d79db6626a..d901997d0bb 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,7 +63,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java index 6e59aee06de..31e36d53de5 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java index 0f151557e3c..fb6d9baaf11 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java index 6f935862f75..94ecd4aaa30 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java index 2b46ef97b0a..fc22dc1d0aa 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java @@ -78,7 +78,7 @@ public class NullableClass extends HashMap { private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; private JsonNullable> objectNullableProp = JsonNullable.>undefined(); @@ -548,7 +548,6 @@ public class NullableClass extends HashMap { this.objectItemsNullable = objectItemsNullable; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java index 4dc4e082cc5..400a8653fd1 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 4939749b0b7..56f1f5a4c4a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -48,7 +48,7 @@ public class ObjectWithDeprecatedFields { private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields() { } @@ -170,7 +170,6 @@ public class ObjectWithDeprecatedFields { this.bars = bars; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java index b18ac238504..556f9281323 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java index 5449db47823..48a7977e139 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 12a811c517b..ab43e36082a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -63,7 +63,6 @@ public class OuterObjectWithEnumProperty { this.value = value; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java index 764c15ca630..c818b3cc8a7 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java @@ -56,7 +56,7 @@ public class Pet { private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -270,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e5707b761ec..c7bf2be1cc1 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java index f7636280e61..25b81d1da5a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java index 6c6b359e88f..5e613b3ae7a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/User.java index 6310afd952d..9f6ff1ca527 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/User.java @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-nullable-arrays/build.gradle b/samples/client/petstore/java/webclient-nullable-arrays/build.gradle index 1b9e9ec6eeb..c3d61a33bed 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/build.gradle +++ b/samples/client/petstore/java/webclient-nullable-arrays/build.gradle @@ -66,7 +66,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -91,17 +91,17 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } @@ -112,20 +112,17 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.3" spring_boot_version = "2.6.6" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" - jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" reactor_netty_version = "1.0.4" - jodatime_version = "2.9.9" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.6" junit_version = "4.13.2" } dependencies { - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.projectreactor:reactor-core:$reactor_version" implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" diff --git a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java index 1b89cb5808e..a47c80a27fb 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java +++ b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java @@ -203,7 +203,6 @@ public class ByteArrayObject { this.intField = intField; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index 2828944e554..97b8e4c677a 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1507,6 +1507,9 @@ components: - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' propertyName: className properties: className: diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index 43c4dcb03aa..254584ee323 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -66,7 +66,7 @@ if(hasProperty('target') && target == 'android') { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -91,17 +91,17 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } @@ -112,20 +112,17 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.3" spring_boot_version = "2.6.6" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" - jackson_databind_nullable_version = "0.2.6" jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" reactor_netty_version = "1.0.4" - jodatime_version = "2.9.9" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.6" junit_version = "4.13.2" } dependencies { - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.projectreactor:reactor-core:$reactor_version" implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" diff --git a/samples/client/petstore/java/webclient/docs/AllOfWithSingleRef.md b/samples/client/petstore/java/webclient/docs/AllOfWithSingleRef.md index 0a9e61bc682..4146d56a372 100644 --- a/samples/client/petstore/java/webclient/docs/AllOfWithSingleRef.md +++ b/samples/client/petstore/java/webclient/docs/AllOfWithSingleRef.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**username** | **String** | | [optional] | -|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | 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 e21555ed0f0..e75bfc5b2b9 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 @@ -50,6 +50,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -81,6 +84,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } @@ -104,7 +110,6 @@ public class AdditionalPropertiesClass { this.mapOfMapProperty = mapOfMapProperty; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 400ef6f1d44..ff55e37f2d7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -93,7 +93,6 @@ public class AllOfWithSingleRef { this.singleRefType = singleRefType; } - @Override public boolean equals(Object o) { if (this == o) { 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 31932c6e681..fd52da7ba5e 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 @@ -23,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -42,8 +40,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), }) public class Animal { @@ -107,7 +105,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { 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 458dcd501b7..e68f1d1d56a 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 @@ -47,6 +47,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } @@ -70,7 +73,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 1bf6b6eca33..b6189104c30 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 @@ -47,6 +47,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } this.arrayNumber.add(arrayNumberItem); return this; } @@ -70,7 +73,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { 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 6fa67a39efd..52d07003963 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 @@ -55,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -86,6 +89,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -117,6 +123,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } @@ -140,7 +149,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { 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 8f0460343a9..ed4f3970651 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 @@ -212,7 +212,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { 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 e14f5458acb..e9c3b88dd90 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 @@ -73,6 +73,17 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 89e6e65c05e..7c404d48482 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 @@ -63,7 +63,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { 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 a78b9d41507..a599f6689ed 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 @@ -92,7 +92,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 9870d339058..f5db7231aef 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 @@ -62,7 +62,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 314945b1bbb..764697f4191 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 @@ -62,7 +62,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 837b1f13e7a..73cccb0d2d3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -64,7 +64,6 @@ public class DeprecatedObject { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 5de0e902a04..f77566c7746 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 @@ -73,6 +73,17 @@ public class Dog extends Animal { this.breed = breed; } + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } @Override public boolean equals(Object o) { 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 55d3afa8167..2978c34e2cc 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 @@ -63,7 +63,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { 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 4e390827d8a..13007002025 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 @@ -146,6 +146,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } this.arrayEnum.add(arrayEnumItem); return this; } @@ -169,7 +172,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { 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 17fd4e08549..dc4dbac1001 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 @@ -433,7 +433,6 @@ public class EnumTest { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } - @Override public boolean equals(Object o) { if (this == o) { 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 d6a00997d93..a338a0598c8 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 @@ -77,6 +77,9 @@ public class FileSchemaTestClass { } public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } this.files.add(filesItem); return this; } @@ -100,7 +103,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java index 08d43f2d0b4..0ae068735bd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Foo.java @@ -62,7 +62,6 @@ public class Foo { this.bar = bar; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 64290b3fa02..0626a5810e6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -64,7 +64,6 @@ public class FooGetDefaultResponse { this.string = string; } - @Override public boolean equals(Object o) { if (this == o) { 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 0be153739ce..1efd4270dd5 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 @@ -528,7 +528,6 @@ public class FormatTest { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } - @Override public boolean equals(Object o) { if (this == o) { 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 2b2c88b9156..cdb08919cbf 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 @@ -81,7 +81,6 @@ public class HasOnlyReadOnly { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java index db52cbac669..b156198397f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -74,7 +74,6 @@ public class HealthCheckResult { this.nullableMessage = JsonNullable.of(nullableMessage); } - @Override public boolean equals(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 dc7486f4194..417563b5d44 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 @@ -93,6 +93,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -124,6 +127,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } @@ -155,6 +161,9 @@ public class MapTest { } public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } this.directMap.put(key, directMapItem); return this; } @@ -186,6 +195,9 @@ public class MapTest { } public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } this.indirectMap.put(key, indirectMapItem); return this; } @@ -209,7 +221,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { 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 e7f63f4af67..e90966d8648 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 @@ -109,6 +109,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } this.map.put(key, mapItem); return this; } @@ -132,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { 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 e376774a161..28ff32d43f0 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 @@ -93,7 +93,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4082ed0ada..7cd7d657857 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 @@ -123,7 +123,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d2..51a513be4a1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -63,7 +63,6 @@ public class ModelFile { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71e..4d903ec4d45 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -63,7 +63,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { 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 b1cc1b13819..eabe6a173bb 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 @@ -63,7 +63,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { 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 07a612c1f00..9af78b50a14 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 @@ -140,7 +140,6 @@ public class Name { - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java index 15eb983d5f2..59c75af68c1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java @@ -396,6 +396,9 @@ public class NullableClass extends HashMap { } public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } this.arrayItemsNullable.add(arrayItemsNullableItem); return this; } @@ -519,6 +522,9 @@ public class NullableClass extends HashMap { } public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } this.objectItemsNullable.put(key, objectItemsNullableItem); return this; } @@ -542,7 +548,6 @@ public class NullableClass extends HashMap { this.objectItemsNullable = objectItemsNullable; } - @Override public boolean equals(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 c57472af9f0..b8453c0e955 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 @@ -63,7 +63,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 07c8d009d4f..718908a08cb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -142,6 +142,9 @@ public class ObjectWithDeprecatedFields { } public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } this.bars.add(barsItem); return this; } @@ -167,7 +170,6 @@ public class ObjectWithDeprecatedFields { this.bars = bars; } - @Override public boolean equals(Object o) { if (this == o) { 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 3d0061c01c9..73e649ff1fa 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 @@ -250,7 +250,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { 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 445248fface..3a35d693a21 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 @@ -123,7 +123,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index d45896c6839..0b8b5f66164 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -63,7 +63,6 @@ public class OuterObjectWithEnumProperty { this.value = value; } - @Override public boolean equals(Object o) { if (this == o) { 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 beca2d006a6..f6f901c99f0 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 @@ -186,6 +186,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -218,6 +221,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } this.tags.add(tagsItem); return this; } @@ -267,7 +273,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { 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 6d9dad261bd..9f25b2a6d30 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 @@ -89,7 +89,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { 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 e4ab9de6df5..8c6588d73f4 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 @@ -63,7 +63,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { 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 ef8add1aada..cf6ef04de76 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 @@ -92,7 +92,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { 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 95032c71bc0..b29fba7c1b6 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 @@ -272,7 +272,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/javascript-apollo/src/api/FakeApi.js b/samples/client/petstore/javascript-apollo/src/api/FakeApi.js index c29506203b1..e1302f477b7 100644 --- a/samples/client/petstore/javascript-apollo/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-apollo/src/api/FakeApi.js @@ -74,8 +74,8 @@ export default class FakeApi extends ApiClient { * test http signature authentication * @param {module:model/Pet} pet Pet object that needs to be added to the store * @param {Object} opts Optional parameters - * @param {String} opts.query1 query parameter - * @param {String} opts.header1 header parameter + * @param {String} [query1] query parameter + * @param {String} [header1] header parameter * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -114,7 +114,7 @@ export default class FakeApi extends ApiClient { /** * Test serialization of outer boolean types * @param {Object} opts Optional parameters - * @param {Boolean} opts.body Input boolean as post body + * @param {Boolean} [body] Input boolean as post body * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -147,7 +147,7 @@ export default class FakeApi extends ApiClient { /** * Test serialization of object with outer number type * @param {Object} opts Optional parameters - * @param {module:model/OuterComposite} opts.outerComposite Input composite as post body + * @param {module:model/OuterComposite} [outerComposite] Input composite as post body * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -180,7 +180,7 @@ export default class FakeApi extends ApiClient { /** * Test serialization of outer number types * @param {Object} opts Optional parameters - * @param {Number} opts.body Input number as post body + * @param {Number} [body] Input number as post body * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -213,7 +213,7 @@ export default class FakeApi extends ApiClient { /** * Test serialization of outer string types * @param {Object} opts Optional parameters - * @param {String} opts.body Input string as post body + * @param {String} [body] Input string as post body * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -432,16 +432,16 @@ export default class FakeApi extends ApiClient { * @param {String} patternWithoutDelimiter None * @param {Blob} _byte None * @param {Object} opts Optional parameters - * @param {Number} opts.integer None - * @param {Number} opts.int32 None - * @param {Number} opts.int64 None - * @param {Number} opts._float None - * @param {String} opts.string None - * @param {File} opts.binary None - * @param {Date} opts.date None - * @param {Date} opts.dateTime None - * @param {String} opts.password None - * @param {String} opts.callback None + * @param {Number} [integer] None + * @param {Number} [int32] None + * @param {Number} [int64] None + * @param {Number} [_float] None + * @param {String} [string] None + * @param {File} [binary] None + * @param {Date} [date] None + * @param {Date} [dateTime] None + * @param {String} [password] None + * @param {String} [callback] None * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -505,15 +505,15 @@ export default class FakeApi extends ApiClient { * To test enum parameters * To test enum parameters * @param {Object} opts Optional parameters - * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') - * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') - * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) - * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumQueryModelArray - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} [enumHeaderStringArray] Header parameter enum test (string array) + * @param {module:model/String} [enumHeaderString = '-efg'] Header parameter enum test (string) + * @param {Array.} [enumQueryStringArray] Query parameter enum test (string array) + * @param {module:model/String} [enumQueryString = '-efg'] Query parameter enum test (string) + * @param {module:model/Number} [enumQueryInteger] Query parameter enum test (double) + * @param {module:model/Number} [enumQueryDouble] Query parameter enum test (double) + * @param {Array.} [enumQueryModelArray] + * @param {Array.} [enumFormStringArray = '$'] Form parameter enum test (string array) + * @param {module:model/String} [enumFormString = '-efg'] Form parameter enum test (string) * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -559,9 +559,9 @@ export default class FakeApi extends ApiClient { * @param {Boolean} requiredBooleanGroup Required Boolean in group parameters * @param {Number} requiredInt64Group Required Integer in group parameters * @param {Object} opts Optional parameters - * @param {Number} opts.stringGroup String in group parameters - * @param {Boolean} opts.booleanGroup Boolean in group parameters - * @param {Number} opts.int64Group Integer in group parameters + * @param {Number} [stringGroup] String in group parameters + * @param {Boolean} [booleanGroup] Boolean in group parameters + * @param {Number} [int64Group] Integer in group parameters * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -697,7 +697,7 @@ export default class FakeApi extends ApiClient { * @param {Array.} context * @param {String} allowEmpty * @param {Object} opts Optional parameters - * @param {Object.} opts.language + * @param {Object.} [language] * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ diff --git a/samples/client/petstore/javascript-apollo/src/api/PetApi.js b/samples/client/petstore/javascript-apollo/src/api/PetApi.js index d1e65785eb2..ce40188aa76 100644 --- a/samples/client/petstore/javascript-apollo/src/api/PetApi.js +++ b/samples/client/petstore/javascript-apollo/src/api/PetApi.js @@ -85,7 +85,7 @@ export default class PetApi extends ApiClient { * * @param {Number} petId Pet id to delete * @param {Object} opts Optional parameters - * @param {String} opts.apiKey + * @param {String} [apiKey] * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -283,8 +283,8 @@ export default class PetApi extends ApiClient { * * @param {Number} petId ID of pet that needs to be updated * @param {Object} opts Optional parameters - * @param {String} opts.name Updated name of the pet - * @param {String} opts.status Updated status of the pet + * @param {String} [name] Updated name of the pet + * @param {String} [status] Updated status of the pet * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -326,8 +326,8 @@ export default class PetApi extends ApiClient { * * @param {Number} petId ID of pet to update * @param {Object} opts Optional parameters - * @param {String} opts.additionalMetadata Additional data to pass to server - * @param {File} opts.file file to upload + * @param {String} [additionalMetadata] Additional data to pass to server + * @param {File} [file] file to upload * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ @@ -370,7 +370,7 @@ export default class PetApi extends ApiClient { * @param {Number} petId ID of pet to update * @param {File} requiredFile file to upload * @param {Object} opts Optional parameters - * @param {String} opts.additionalMetadata Additional data to pass to server + * @param {String} [additionalMetadata] Additional data to pass to server * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277} * @return {Promise} */ diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index d19a521f8a4..b80b6c6e81f 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -89,8 +89,8 @@ export default class FakeApi { * test http signature authentication * @param {module:model/Pet} pet Pet object that needs to be added to the store * @param {Object} opts Optional parameters - * @param {String} opts.query1 query parameter - * @param {String} opts.header1 header parameter + * @param {String} [query1] query parameter + * @param {String} [header1] header parameter * @param {module:api/FakeApi~fakeHttpSignatureTestCallback} callback The callback function, accepting three arguments: error, data, response */ fakeHttpSignatureTest(pet, opts, callback) { @@ -134,7 +134,7 @@ export default class FakeApi { /** * Test serialization of outer boolean types * @param {Object} opts Optional parameters - * @param {Boolean} opts.body Input boolean as post body + * @param {Boolean} [body] Input boolean as post body * @param {module:api/FakeApi~fakeOuterBooleanSerializeCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Boolean} */ @@ -173,7 +173,7 @@ export default class FakeApi { /** * Test serialization of object with outer number type * @param {Object} opts Optional parameters - * @param {module:model/OuterComposite} opts.outerComposite Input composite as post body + * @param {module:model/OuterComposite} [outerComposite] Input composite as post body * @param {module:api/FakeApi~fakeOuterCompositeSerializeCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/OuterComposite} */ @@ -212,7 +212,7 @@ export default class FakeApi { /** * Test serialization of outer number types * @param {Object} opts Optional parameters - * @param {Number} opts.body Input number as post body + * @param {Number} [body] Input number as post body * @param {module:api/FakeApi~fakeOuterNumberSerializeCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Number} */ @@ -251,7 +251,7 @@ export default class FakeApi { /** * Test serialization of outer string types * @param {Object} opts Optional parameters - * @param {String} opts.body Input string as post body + * @param {String} [body] Input string as post body * @param {module:api/FakeApi~fakeOuterStringSerializeCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link String} */ @@ -503,16 +503,16 @@ export default class FakeApi { * @param {String} patternWithoutDelimiter None * @param {Blob} _byte None * @param {Object} opts Optional parameters - * @param {Number} opts.integer None - * @param {Number} opts.int32 None - * @param {Number} opts.int64 None - * @param {Number} opts._float None - * @param {String} opts.string None - * @param {File} opts.binary None - * @param {Date} opts.date None - * @param {Date} opts.dateTime None - * @param {String} opts.password None - * @param {String} opts.callback None + * @param {Number} [integer] None + * @param {Number} [int32] None + * @param {Number} [int64] None + * @param {Number} [_float] None + * @param {String} [string] None + * @param {File} [binary] None + * @param {Date} [date] None + * @param {Date} [dateTime] None + * @param {String} [password] None + * @param {String} [callback] None * @param {module:api/FakeApi~testEndpointParametersCallback} callback The callback function, accepting three arguments: error, data, response */ testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, opts, callback) { @@ -581,15 +581,15 @@ export default class FakeApi { * To test enum parameters * To test enum parameters * @param {Object} opts Optional parameters - * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') - * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') - * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) - * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumQueryModelArray - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} [enumHeaderStringArray] Header parameter enum test (string array) + * @param {module:model/String} [enumHeaderString = '-efg')] Header parameter enum test (string) + * @param {Array.} [enumQueryStringArray] Query parameter enum test (string array) + * @param {module:model/String} [enumQueryString = '-efg')] Query parameter enum test (string) + * @param {module:model/Number} [enumQueryInteger] Query parameter enum test (double) + * @param {module:model/Number} [enumQueryDouble] Query parameter enum test (double) + * @param {Array.} [enumQueryModelArray] + * @param {Array.} [enumFormStringArray = '$')] Form parameter enum test (string array) + * @param {module:model/String} [enumFormString = '-efg')] Form parameter enum test (string) * @param {module:api/FakeApi~testEnumParametersCallback} callback The callback function, accepting three arguments: error, data, response */ testEnumParameters(opts, callback) { @@ -640,9 +640,9 @@ export default class FakeApi { * @param {Boolean} requiredBooleanGroup Required Boolean in group parameters * @param {Number} requiredInt64Group Required Integer in group parameters * @param {Object} opts Optional parameters - * @param {Number} opts.stringGroup String in group parameters - * @param {Boolean} opts.booleanGroup Boolean in group parameters - * @param {Number} opts.int64Group Integer in group parameters + * @param {Number} [stringGroup] String in group parameters + * @param {Boolean} [booleanGroup] Boolean in group parameters + * @param {Number} [int64Group] Integer in group parameters * @param {module:api/FakeApi~testGroupParametersCallback} callback The callback function, accepting three arguments: error, data, response */ testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts, callback) { @@ -793,7 +793,7 @@ export default class FakeApi { * @param {Array.} context * @param {String} allowEmpty * @param {Object} opts Optional parameters - * @param {Object.} opts.language + * @param {Object.} [language] * @param {module:api/FakeApi~testQueryParameterCollectionFormatCallback} callback The callback function, accepting three arguments: error, data, response */ testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts, callback) { diff --git a/samples/client/petstore/javascript-es6/src/api/PetApi.js b/samples/client/petstore/javascript-es6/src/api/PetApi.js index 6aba5f184db..8b0bdf9333d 100644 --- a/samples/client/petstore/javascript-es6/src/api/PetApi.js +++ b/samples/client/petstore/javascript-es6/src/api/PetApi.js @@ -99,7 +99,7 @@ export default class PetApi { * * @param {Number} petId Pet id to delete * @param {Object} opts Optional parameters - * @param {String} opts.apiKey + * @param {String} [apiKey] * @param {module:api/PetApi~deletePetCallback} callback The callback function, accepting three arguments: error, data, response */ deletePet(petId, opts, callback) { @@ -325,8 +325,8 @@ export default class PetApi { * * @param {Number} petId ID of pet that needs to be updated * @param {Object} opts Optional parameters - * @param {String} opts.name Updated name of the pet - * @param {String} opts.status Updated status of the pet + * @param {String} [name] Updated name of the pet + * @param {String} [status] Updated status of the pet * @param {module:api/PetApi~updatePetWithFormCallback} callback The callback function, accepting three arguments: error, data, response */ updatePetWithForm(petId, opts, callback) { @@ -373,8 +373,8 @@ export default class PetApi { * * @param {Number} petId ID of pet to update * @param {Object} opts Optional parameters - * @param {String} opts.additionalMetadata Additional data to pass to server - * @param {File} opts.file file to upload + * @param {String} [additionalMetadata] Additional data to pass to server + * @param {File} [file] file to upload * @param {module:api/PetApi~uploadFileCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/ApiResponse} */ @@ -423,7 +423,7 @@ export default class PetApi { * @param {Number} petId ID of pet to update * @param {File} requiredFile file to upload * @param {Object} opts Optional parameters - * @param {String} opts.additionalMetadata Additional data to pass to server + * @param {String} [additionalMetadata] Additional data to pass to server * @param {module:api/PetApi~uploadFileWithRequiredFileCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/ApiResponse} */ 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 3fb9c81307d..d173cf111a4 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -85,8 +85,8 @@ export default class FakeApi { * test http signature authentication * @param {module:model/Pet} pet Pet object that needs to be added to the store * @param {Object} opts Optional parameters - * @param {String} opts.query1 query parameter - * @param {String} opts.header1 header parameter + * @param {String} [query1] query parameter + * @param {String} [header1] header parameter * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ fakeHttpSignatureTestWithHttpInfo(pet, opts) { @@ -138,7 +138,7 @@ export default class FakeApi { /** * Test serialization of outer boolean types * @param {Object} opts Optional parameters - * @param {Boolean} opts.body Input boolean as post body + * @param {Boolean} [body] Input boolean as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Boolean} and HTTP response */ fakeOuterBooleanSerializeWithHttpInfo(opts) { @@ -182,7 +182,7 @@ export default class FakeApi { /** * Test serialization of object with outer number type * @param {Object} opts Optional parameters - * @param {module:model/OuterComposite} opts.outerComposite Input composite as post body + * @param {module:model/OuterComposite} [outerComposite] Input composite as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterComposite} and HTTP response */ fakeOuterCompositeSerializeWithHttpInfo(opts) { @@ -226,7 +226,7 @@ export default class FakeApi { /** * Test serialization of outer number types * @param {Object} opts Optional parameters - * @param {Number} opts.body Input number as post body + * @param {Number} [body] Input number as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Number} and HTTP response */ fakeOuterNumberSerializeWithHttpInfo(opts) { @@ -270,7 +270,7 @@ export default class FakeApi { /** * Test serialization of outer string types * @param {Object} opts Optional parameters - * @param {String} opts.body Input string as post body + * @param {String} [body] Input string as post body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link String} and HTTP response */ fakeOuterStringSerializeWithHttpInfo(opts) { @@ -551,16 +551,16 @@ export default class FakeApi { * @param {String} patternWithoutDelimiter None * @param {Blob} _byte None * @param {Object} opts Optional parameters - * @param {Number} opts.integer None - * @param {Number} opts.int32 None - * @param {Number} opts.int64 None - * @param {Number} opts._float None - * @param {String} opts.string None - * @param {File} opts.binary None - * @param {Date} opts.date None - * @param {Date} opts.dateTime None - * @param {String} opts.password None - * @param {String} opts.callback None + * @param {Number} [integer] None + * @param {Number} [int32] None + * @param {Number} [int64] None + * @param {Number} [_float] None + * @param {String} [string] None + * @param {File} [binary] None + * @param {Date} [date] None + * @param {Date} [dateTime] None + * @param {String} [password] None + * @param {String} [callback] None * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, opts) { @@ -649,15 +649,15 @@ export default class FakeApi { * To test enum parameters * To test enum parameters * @param {Object} opts Optional parameters - * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') - * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') - * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) - * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumQueryModelArray - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} [enumHeaderStringArray] Header parameter enum test (string array) + * @param {module:model/String} [enumHeaderString = '-efg')] Header parameter enum test (string) + * @param {Array.} [enumQueryStringArray] Query parameter enum test (string array) + * @param {module:model/String} [enumQueryString = '-efg')] Query parameter enum test (string) + * @param {module:model/Number} [enumQueryInteger] Query parameter enum test (double) + * @param {module:model/Number} [enumQueryDouble] Query parameter enum test (double) + * @param {Array.} [enumQueryModelArray] + * @param {Array.} [enumFormStringArray = '$')] Form parameter enum test (string array) + * @param {module:model/String} [enumFormString = '-efg')] Form parameter enum test (string) * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ testEnumParametersWithHttpInfo(opts) { @@ -723,9 +723,9 @@ export default class FakeApi { * @param {Boolean} requiredBooleanGroup Required Boolean in group parameters * @param {Number} requiredInt64Group Required Integer in group parameters * @param {Object} opts Optional parameters - * @param {Number} opts.stringGroup String in group parameters - * @param {Boolean} opts.booleanGroup Boolean in group parameters - * @param {Number} opts.int64Group Integer in group parameters + * @param {Number} [stringGroup] String in group parameters + * @param {Boolean} [booleanGroup] Boolean in group parameters + * @param {Number} [int64Group] Integer in group parameters * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts) { @@ -901,7 +901,7 @@ export default class FakeApi { * @param {Array.} context * @param {String} allowEmpty * @param {Object} opts Optional parameters - * @param {Object.} opts.language + * @param {Object.} [language] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, opts) { diff --git a/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js b/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js index 85f1054fdf4..6c372aed8dc 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js @@ -98,7 +98,7 @@ export default class PetApi { * * @param {Number} petId Pet id to delete * @param {Object} opts Optional parameters - * @param {String} opts.apiKey + * @param {String} [apiKey] * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ deletePetWithHttpInfo(petId, opts) { @@ -353,8 +353,8 @@ export default class PetApi { * * @param {Number} petId ID of pet that needs to be updated * @param {Object} opts Optional parameters - * @param {String} opts.name Updated name of the pet - * @param {String} opts.status Updated status of the pet + * @param {String} [name] Updated name of the pet + * @param {String} [status] Updated status of the pet * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ updatePetWithFormWithHttpInfo(petId, opts) { @@ -410,8 +410,8 @@ export default class PetApi { * * @param {Number} petId ID of pet to update * @param {Object} opts Optional parameters - * @param {String} opts.additionalMetadata Additional data to pass to server - * @param {File} opts.file file to upload + * @param {String} [additionalMetadata] Additional data to pass to server + * @param {File} [file] file to upload * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiResponse} and HTTP response */ uploadFileWithHttpInfo(petId, opts) { @@ -468,7 +468,7 @@ export default class PetApi { * @param {Number} petId ID of pet to update * @param {File} requiredFile file to upload * @param {Object} opts Optional parameters - * @param {String} opts.additionalMetadata Additional data to pass to server + * @param {String} [additionalMetadata] Additional data to pass to server * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiResponse} and HTTP response */ uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, opts) { diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 757080d7ed1..ea4b7b65935 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -172,7 +172,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 90aff170761..047c68d10ce 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -170,7 +170,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -189,7 +189,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 757080d7ed1..ea4b7b65935 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -172,7 +172,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 757080d7ed1..ea4b7b65935 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -172,7 +172,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 90aff170761..047c68d10ce 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -170,7 +170,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -189,7 +189,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 757080d7ed1..ea4b7b65935 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -172,7 +172,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 757080d7ed1..ea4b7b65935 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -172,7 +172,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 150ae2c96a1..0f1ca0fcb9c 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -190,7 +190,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -209,7 +209,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 40f766cd0a3..5eb13189410 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -190,7 +190,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -209,7 +209,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index cfa514eddfa..235c92379b5 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -196,7 +196,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -215,7 +215,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index de295015574..67676016c1f 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -193,7 +193,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -223,7 +223,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie }) } - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9101fb150a8..81f05a77af3 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -210,7 +210,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9101fb150a8..81f05a77af3 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -210,7 +210,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 504d6920a4f..16c2bf9bc65 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -191,7 +191,7 @@ internal open class ApiClient(val baseUrl: String, val client: OkHttpClient = de val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -210,7 +210,7 @@ internal open class ApiClient(val baseUrl: String, val client: OkHttpClient = de val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9101fb150a8..81f05a77af3 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -210,7 +210,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 6985de61199..34db45767ad 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -189,7 +189,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -208,7 +208,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { 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 9101fb150a8..81f05a77af3 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 @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -210,7 +210,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { 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 d26ef5fe23f..2592a3baad3 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 @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -210,7 +210,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index ca3a9037de5..6459e6aff54 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -172,7 +172,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { 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 9101fb150a8..81f05a77af3 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 @@ -191,7 +191,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val contentType = if (headers[ContentType] != null) { // TODO: support multiple contentType options here. - (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + (headers[ContentType] as String).substringBefore(";").lowercase(Locale.US) } else { null } @@ -210,7 +210,7 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.US) // TODO: handle specific mapping types. e.g. Map> return when { diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/AllOfWithSingleRef.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/AllOfWithSingleRef.md index a8da431674c..d8a2b54b5a0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/AllOfWithSingleRef.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/AllOfWithSingleRef.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **username** | **string** | | [optional] -**single_ref_type** | [**SingleRefType**](SingleRefType.md) | | [optional] +**single_ref_type** | [**\OpenAPI\Client\Model\SingleRefType**](SingleRefType.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php index 6b77e18b3e5..d280974683b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AllOfWithSingleRef.php @@ -58,7 +58,7 @@ class AllOfWithSingleRef implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'username' => 'string', - 'single_ref_type' => 'SingleRefType' + 'single_ref_type' => '\OpenAPI\Client\Model\SingleRefType' ]; /** @@ -326,7 +326,7 @@ class AllOfWithSingleRef implements ModelInterface, ArrayAccess, \JsonSerializab /** * Gets single_ref_type * - * @return SingleRefType|null + * @return \OpenAPI\Client\Model\SingleRefType|null */ public function getSingleRefType() { @@ -336,7 +336,7 @@ class AllOfWithSingleRef implements ModelInterface, ArrayAccess, \JsonSerializab /** * Sets single_ref_type * - * @param SingleRefType|null $single_ref_type single_ref_type + * @param \OpenAPI\Client\Model\SingleRefType|null $single_ref_type single_ref_type * * @return self */ diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/models/all_of_with_single_ref.rb b/samples/client/petstore/ruby-autoload/lib/petstore/models/all_of_with_single_ref.rb index c7e611e2f52..7fa9cc1beac 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/models/all_of_with_single_ref.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/models/all_of_with_single_ref.rb @@ -19,6 +19,28 @@ module Petstore attr_accessor :single_ref_type + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/samples/client/petstore/ruby-autoload/spec/api/another_fake_api_spec.rb b/samples/client/petstore/ruby-autoload/spec/api/another_fake_api_spec.rb index 523b4b9fc49..1343b2a9cc6 100644 --- a/samples/client/petstore/ruby-autoload/spec/api/another_fake_api_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/api/another_fake_api_spec.rb @@ -40,7 +40,7 @@ describe 'AnotherFakeApi' do # @return [Client] describe 'call_123_test_special_tags test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/api/default_api_spec.rb b/samples/client/petstore/ruby-autoload/spec/api/default_api_spec.rb index 4c860076c0f..f453852b8c0 100644 --- a/samples/client/petstore/ruby-autoload/spec/api/default_api_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/api/default_api_spec.rb @@ -37,7 +37,7 @@ describe 'DefaultApi' do # @return [FooGetDefaultResponse] describe 'foo_get test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/api/fake_api_spec.rb b/samples/client/petstore/ruby-autoload/spec/api/fake_api_spec.rb index dc56a801e61..45df141292b 100644 --- a/samples/client/petstore/ruby-autoload/spec/api/fake_api_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/api/fake_api_spec.rb @@ -38,7 +38,7 @@ describe 'FakeApi' do # @return [HealthCheckResult] describe 'fake_health_get test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -51,7 +51,7 @@ describe 'FakeApi' do # @return [nil] describe 'fake_http_signature_test test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -62,7 +62,7 @@ describe 'FakeApi' do # @return [Boolean] describe 'fake_outer_boolean_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -73,7 +73,7 @@ describe 'FakeApi' do # @return [OuterComposite] describe 'fake_outer_composite_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -84,7 +84,7 @@ describe 'FakeApi' do # @return [Float] describe 'fake_outer_number_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -95,7 +95,7 @@ describe 'FakeApi' do # @return [String] describe 'fake_outer_string_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -106,7 +106,7 @@ describe 'FakeApi' do # @return [OuterObjectWithEnumProperty] describe 'fake_property_enum_integer_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -117,29 +117,29 @@ describe 'FakeApi' do # @return [nil] describe 'test_body_with_binary test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_body_with_file_schema # For this test, the body for this request must reference a schema named `File`. - # @param file_schema_test_class + # @param file_schema_test_class # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_file_schema test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_body_with_query_params - # @param query - # @param user + # @param query + # @param user # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_query_params test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -151,13 +151,13 @@ describe 'FakeApi' do # @return [Client] describe 'test_client_model test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_endpoint_parameters - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # @param number None # @param double None # @param pattern_without_delimiter None @@ -176,7 +176,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_endpoint_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -190,13 +190,13 @@ describe 'FakeApi' do # @option opts [String] :enum_query_string Query parameter enum test (string) # @option opts [Integer] :enum_query_integer Query parameter enum test (double) # @option opts [Float] :enum_query_double Query parameter enum test (double) - # @option opts [Array] :enum_query_model_array + # @option opts [Array] :enum_query_model_array # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) # @option opts [String] :enum_form_string Form parameter enum test (string) # @return [nil] describe 'test_enum_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -213,49 +213,49 @@ describe 'FakeApi' do # @return [nil] describe 'test_group_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_inline_additional_properties # test inline additionalProperties - # + # # @param request_body request body # @param [Hash] opts the optional parameters # @return [nil] describe 'test_inline_additional_properties test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_json_form_data # test json serialization of form data - # + # # @param param field1 # @param param2 field2 # @param [Hash] opts the optional parameters # @return [nil] describe 'test_json_form_data test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ 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 allow_empty + # @param pipe + # @param ioutil + # @param http + # @param url + # @param context + # @param allow_empty # @param [Hash] opts the optional parameters - # @option opts [Hash] :language + # @option opts [Hash] :language # @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 + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/api/fake_classname_tags123_api_spec.rb b/samples/client/petstore/ruby-autoload/spec/api/fake_classname_tags123_api_spec.rb index 1f0665451e1..8daabe80f4e 100644 --- a/samples/client/petstore/ruby-autoload/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/api/fake_classname_tags123_api_spec.rb @@ -40,7 +40,7 @@ describe 'FakeClassnameTags123Api' do # @return [Client] describe 'test_classname test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/api/pet_api_spec.rb b/samples/client/petstore/ruby-autoload/spec/api/pet_api_spec.rb index b4747708710..ab4a3e7122f 100644 --- a/samples/client/petstore/ruby-autoload/spec/api/pet_api_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/api/pet_api_spec.rb @@ -34,26 +34,26 @@ describe 'PetApi' do # unit tests for add_pet # Add a new pet to the store - # + # # @param pet Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] describe 'add_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for delete_pet # Deletes a pet - # + # # @param pet_id Pet id to delete # @param [Hash] opts the optional parameters - # @option opts [String] :api_key + # @option opts [String] :api_key # @return [nil] describe 'delete_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -65,7 +65,7 @@ describe 'PetApi' do # @return [Array] describe 'find_pets_by_status test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -77,7 +77,7 @@ describe 'PetApi' do # @return [Array] describe 'find_pets_by_tags test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -89,25 +89,25 @@ describe 'PetApi' do # @return [Pet] describe 'get_pet_by_id test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for update_pet # Update an existing pet - # + # # @param pet Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] describe 'update_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for update_pet_with_form # Updates a pet in the store with form data - # + # # @param pet_id ID of pet that needs to be updated # @param [Hash] opts the optional parameters # @option opts [String] :name Updated name of the pet @@ -115,13 +115,13 @@ describe 'PetApi' do # @return [nil] describe 'update_pet_with_form test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for upload_file # uploads an image - # + # # @param pet_id ID of pet to update # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server @@ -129,13 +129,13 @@ describe 'PetApi' do # @return [ApiResponse] describe 'upload_file test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for upload_file_with_required_file # uploads an image (required) - # + # # @param pet_id ID of pet to update # @param required_file file to upload # @param [Hash] opts the optional parameters @@ -143,7 +143,7 @@ describe 'PetApi' do # @return [ApiResponse] describe 'upload_file_with_required_file test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/api/store_api_spec.rb b/samples/client/petstore/ruby-autoload/spec/api/store_api_spec.rb index bc9e4b294ce..5c06e5ca102 100644 --- a/samples/client/petstore/ruby-autoload/spec/api/store_api_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/api/store_api_spec.rb @@ -40,7 +40,7 @@ describe 'StoreApi' do # @return [nil] describe 'delete_order test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -51,7 +51,7 @@ describe 'StoreApi' do # @return [Hash] describe 'get_inventory test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -63,19 +63,19 @@ describe 'StoreApi' do # @return [Order] describe 'get_order_by_id test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for place_order # Place an order for a pet - # + # # @param order order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] describe 'place_order test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/api/user_api_spec.rb b/samples/client/petstore/ruby-autoload/spec/api/user_api_spec.rb index e3eae5db7d2..52d89014771 100644 --- a/samples/client/petstore/ruby-autoload/spec/api/user_api_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/api/user_api_spec.rb @@ -40,31 +40,31 @@ describe 'UserApi' do # @return [nil] describe 'create_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for create_users_with_array_input # Creates list of users with given input array - # + # # @param user List of user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_users_with_array_input test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for create_users_with_list_input # Creates list of users with given input array - # + # # @param user List of user object # @param [Hash] opts the optional parameters # @return [nil] describe 'create_users_with_list_input test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -76,43 +76,43 @@ describe 'UserApi' do # @return [nil] describe 'delete_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for get_user_by_name # Get user by user name - # + # # @param username The name that needs to be fetched. Use user1 for testing. # @param [Hash] opts the optional parameters # @return [User] describe 'get_user_by_name test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for login_user # Logs user into the system - # + # # @param username The user name for login # @param password The password for login in clear text # @param [Hash] opts the optional parameters # @return [String] describe 'login_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for logout_user # Logs out current logged in user session - # + # # @param [Hash] opts the optional parameters # @return [nil] describe 'logout_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -125,7 +125,7 @@ describe 'UserApi' do # @return [nil] describe 'update_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/additional_properties_class_spec.rb index 0daa2686986..d3438441833 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/additional_properties_class_spec.rb @@ -27,13 +27,13 @@ describe Petstore::AdditionalPropertiesClass do end describe 'test attribute "map_property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map_of_map_property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/all_of_with_single_ref_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/all_of_with_single_ref_spec.rb index 3b52a10b6a7..6d4e3c88bfa 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/all_of_with_single_ref_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/all_of_with_single_ref_spec.rb @@ -27,13 +27,13 @@ describe Petstore::AllOfWithSingleRef do end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "single_ref_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/animal_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/animal_spec.rb index ef60372f48d..ae94f3ac820 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/animal_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/animal_spec.rb @@ -27,13 +27,13 @@ describe Petstore::Animal do end describe 'test attribute "class_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "color"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/api_response_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/api_response_spec.rb index 3b9a30ae8ab..bd991b2ae5f 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/api_response_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/api_response_spec.rb @@ -27,19 +27,19 @@ describe Petstore::ApiResponse do end describe 'test attribute "code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/array_of_array_of_number_only_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/array_of_array_of_number_only_spec.rb index c99f7a21caf..ea3a61f3b81 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/array_of_array_of_number_only_spec.rb @@ -27,7 +27,7 @@ describe Petstore::ArrayOfArrayOfNumberOnly do end describe 'test attribute "array_array_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/array_of_number_only_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/array_of_number_only_spec.rb index cbc701d20dc..da9a4775f14 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/array_of_number_only_spec.rb @@ -27,7 +27,7 @@ describe Petstore::ArrayOfNumberOnly do end describe 'test attribute "array_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/array_test_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/array_test_spec.rb index adfd4d8fb42..9d443b1cade 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/array_test_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/array_test_spec.rb @@ -27,19 +27,19 @@ describe Petstore::ArrayTest do end describe 'test attribute "array_of_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_array_of_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_array_of_model"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/capitalization_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/capitalization_spec.rb index d3ff44c566e..0fd4c21411f 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/capitalization_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/capitalization_spec.rb @@ -27,37 +27,37 @@ describe Petstore::Capitalization do end describe 'test attribute "small_camel"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "capital_camel"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "small_snake"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "capital_snake"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "sca_eth_flow_points"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "att_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/cat_all_of_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/cat_all_of_spec.rb index a073f30b28d..bfc0b0284fc 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/cat_all_of_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/cat_all_of_spec.rb @@ -27,7 +27,7 @@ describe Petstore::CatAllOf do end describe 'test attribute "declawed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/cat_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/cat_spec.rb index 6a51da1376b..06dc81c184c 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/cat_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/cat_spec.rb @@ -27,7 +27,7 @@ describe Petstore::Cat do end describe 'test attribute "declawed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/category_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/category_spec.rb index 3016883fe28..d701e19b29e 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/category_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/category_spec.rb @@ -27,13 +27,13 @@ describe Petstore::Category do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/class_model_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/class_model_spec.rb index 1f8377d2845..415895ec06c 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/class_model_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/class_model_spec.rb @@ -27,7 +27,7 @@ describe Petstore::ClassModel do end describe 'test attribute "_class"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/client_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/client_spec.rb index f16856f2402..09abf9c08ba 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/client_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/client_spec.rb @@ -27,7 +27,7 @@ describe Petstore::Client do end describe 'test attribute "client"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/deprecated_object_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/deprecated_object_spec.rb index 27fba88874a..ba3b7d46fe8 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/deprecated_object_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/deprecated_object_spec.rb @@ -27,7 +27,7 @@ describe Petstore::DeprecatedObject do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/dog_all_of_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/dog_all_of_spec.rb index f4324654b53..f04c14afe5f 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/dog_all_of_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/dog_all_of_spec.rb @@ -27,7 +27,7 @@ describe Petstore::DogAllOf do end describe 'test attribute "breed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/dog_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/dog_spec.rb index 9c335f7cc29..782e471b0a3 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/dog_spec.rb @@ -27,7 +27,7 @@ describe Petstore::Dog do end describe 'test attribute "breed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/enum_arrays_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/enum_arrays_spec.rb index 77dfa197024..badee6e1398 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/enum_arrays_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/enum_arrays_spec.rb @@ -27,7 +27,7 @@ describe Petstore::EnumArrays do end describe 'test attribute "just_symbol"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', [">=", "$"]) # validator.allowable_values.each do |value| # expect { instance.just_symbol = value }.not_to raise_error @@ -37,7 +37,7 @@ describe Petstore::EnumArrays do describe 'test attribute "array_enum"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["fish", "crab"]) # validator.allowable_values.each do |value| # expect { instance.array_enum = value }.not_to raise_error diff --git a/samples/client/petstore/ruby-autoload/spec/models/enum_test_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/enum_test_spec.rb index 67553e59b3e..4872de907ad 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/enum_test_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/enum_test_spec.rb @@ -27,7 +27,7 @@ describe Petstore::EnumTest do end describe 'test attribute "enum_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) # validator.allowable_values.each do |value| # expect { instance.enum_string = value }.not_to raise_error @@ -37,7 +37,7 @@ describe Petstore::EnumTest do describe 'test attribute "enum_string_required"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) # validator.allowable_values.each do |value| # expect { instance.enum_string_required = value }.not_to raise_error @@ -47,7 +47,7 @@ describe Petstore::EnumTest do describe 'test attribute "enum_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [1, -1]) # validator.allowable_values.each do |value| # expect { instance.enum_integer = value }.not_to raise_error @@ -57,7 +57,7 @@ describe Petstore::EnumTest do describe 'test attribute "enum_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', [1.1, -1.2]) # validator.allowable_values.each do |value| # expect { instance.enum_number = value }.not_to raise_error @@ -67,25 +67,25 @@ describe Petstore::EnumTest do describe 'test attribute "outer_enum"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_default_value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_integer_default_value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/file_schema_test_class_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/file_schema_test_class_spec.rb index c8a0f8800a9..38c34f9c50c 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/file_schema_test_class_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/file_schema_test_class_spec.rb @@ -27,13 +27,13 @@ describe Petstore::FileSchemaTestClass do end describe 'test attribute "file"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "files"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/file_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/file_spec.rb index 688c38eb449..7d857e0f835 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/file_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/file_spec.rb @@ -27,7 +27,7 @@ describe Petstore::File do end describe 'test attribute "source_uri"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/foo_get_default_response_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/foo_get_default_response_spec.rb index b5b0355778f..d6f85f77b51 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/foo_get_default_response_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/foo_get_default_response_spec.rb @@ -27,7 +27,7 @@ describe Petstore::FooGetDefaultResponse do end describe 'test attribute "string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/foo_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/foo_spec.rb index c2b4a79654c..a6021d760b4 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/foo_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/foo_spec.rb @@ -27,7 +27,7 @@ describe Petstore::Foo do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/format_test_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/format_test_spec.rb index cebdbafff35..f1c2847da93 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/format_test_spec.rb @@ -27,97 +27,97 @@ describe Petstore::FormatTest do end describe 'test attribute "integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "int32"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "int64"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "float"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "double"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "decimal"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "byte"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "binary"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pattern_with_digits"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pattern_with_digits_and_delimiter"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/has_only_read_only_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/has_only_read_only_spec.rb index eb5e2feb64d..0a0abcf5047 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/has_only_read_only_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/has_only_read_only_spec.rb @@ -27,13 +27,13 @@ describe Petstore::HasOnlyReadOnly do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "foo"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/health_check_result_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/health_check_result_spec.rb index 7b8436db22d..6145f63bef8 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/health_check_result_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/health_check_result_spec.rb @@ -27,7 +27,7 @@ describe Petstore::HealthCheckResult do end describe 'test attribute "nullable_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/list_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/list_spec.rb index 3571c832e2e..7c8d0e30b9f 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/list_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/list_spec.rb @@ -27,7 +27,7 @@ describe Petstore::List do end describe 'test attribute "_123_list"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/map_test_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/map_test_spec.rb index e4b2bcc242e..3fa64927bc8 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/map_test_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/map_test_spec.rb @@ -27,13 +27,13 @@ describe Petstore::MapTest do end describe 'test attribute "map_map_of_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map_of_enum_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Hash', ["UPPER", "lower"]) # validator.allowable_values.each do |value| # expect { instance.map_of_enum_string = value }.not_to raise_error @@ -43,13 +43,13 @@ describe Petstore::MapTest do describe 'test attribute "direct_map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "indirect_map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/mixed_properties_and_additional_properties_class_spec.rb index 2bf4ef5f9db..b9286126813 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -27,19 +27,19 @@ describe Petstore::MixedPropertiesAndAdditionalPropertiesClass do end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/model200_response_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/model200_response_spec.rb index 7c9a78a286e..b8ca5a4d37a 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/model200_response_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/model200_response_spec.rb @@ -27,13 +27,13 @@ describe Petstore::Model200Response do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_class"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/model_return_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/model_return_spec.rb index 7cd06ed6928..0c02c25d336 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/model_return_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/model_return_spec.rb @@ -27,7 +27,7 @@ describe Petstore::ModelReturn do end describe 'test attribute "_return"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/name_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/name_spec.rb index 946443e9792..d7c62387e6b 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/name_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/name_spec.rb @@ -27,25 +27,25 @@ describe Petstore::Name do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "snake_case"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_123_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/nullable_class_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/nullable_class_spec.rb index 8c0d004a668..5fb93182e06 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/nullable_class_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/nullable_class_spec.rb @@ -27,73 +27,73 @@ describe Petstore::NullableClass do end describe 'test attribute "integer_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "number_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "boolean_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "string_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "datetime_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_and_items_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_items_nullable"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_and_items_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_items_nullable"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/number_only_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/number_only_spec.rb index f4354dd575e..7c98ce3f404 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/number_only_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/number_only_spec.rb @@ -27,7 +27,7 @@ describe Petstore::NumberOnly do end describe 'test attribute "just_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/object_with_deprecated_fields_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/object_with_deprecated_fields_spec.rb index ffd1a0ae4c3..ea6fa4915b5 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/object_with_deprecated_fields_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/object_with_deprecated_fields_spec.rb @@ -27,25 +27,25 @@ describe Petstore::ObjectWithDeprecatedFields do end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "deprecated_ref"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "bars"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/order_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/order_spec.rb index 99084704e42..6de4d11801d 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/order_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/order_spec.rb @@ -27,31 +27,31 @@ describe Petstore::Order do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pet_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "quantity"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "ship_date"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) # validator.allowable_values.each do |value| # expect { instance.status = value }.not_to raise_error @@ -61,7 +61,7 @@ describe Petstore::Order do describe 'test attribute "complete"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/outer_composite_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/outer_composite_spec.rb index 766ca57e636..eda7fd2942f 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/outer_composite_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/outer_composite_spec.rb @@ -27,19 +27,19 @@ describe Petstore::OuterComposite do end describe 'test attribute "my_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "my_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "my_boolean"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/outer_object_with_enum_property_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/outer_object_with_enum_property_spec.rb index 0f88c5a547d..a2ee31a7fd7 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/outer_object_with_enum_property_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/outer_object_with_enum_property_spec.rb @@ -27,7 +27,7 @@ describe Petstore::OuterObjectWithEnumProperty do end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/pet_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/pet_spec.rb index fb948ec3ec0..930130c85c4 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/pet_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/pet_spec.rb @@ -27,37 +27,37 @@ describe Petstore::Pet do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "category"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "photo_urls"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tags"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["available", "pending", "sold"]) # validator.allowable_values.each do |value| # expect { instance.status = value }.not_to raise_error diff --git a/samples/client/petstore/ruby-autoload/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/read_only_first_spec.rb index 657a2b695aa..6f24ff8b8a3 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/read_only_first_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/read_only_first_spec.rb @@ -27,13 +27,13 @@ describe Petstore::ReadOnlyFirst do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "baz"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/special_model_name_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/special_model_name_spec.rb index 38542aef0e2..a3bedaa162d 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/special_model_name_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/special_model_name_spec.rb @@ -27,7 +27,7 @@ describe Petstore::SpecialModelName do end describe 'test attribute "special_property_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/tag_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/tag_spec.rb index c73c1fbab18..4da8e4d48f7 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/tag_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/tag_spec.rb @@ -27,13 +27,13 @@ describe Petstore::Tag do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-autoload/spec/models/user_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/user_spec.rb index 8eb9cd582ae..ec6864f1c8c 100644 --- a/samples/client/petstore/ruby-autoload/spec/models/user_spec.rb +++ b/samples/client/petstore/ruby-autoload/spec/models/user_spec.rb @@ -27,49 +27,49 @@ describe Petstore::User do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "first_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "last_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "email"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "phone"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "user_status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/all_of_with_single_ref.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/all_of_with_single_ref.rb index c7e611e2f52..7fa9cc1beac 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/all_of_with_single_ref.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/all_of_with_single_ref.rb @@ -19,6 +19,28 @@ module Petstore attr_accessor :single_ref_type + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb index bf187f0971f..c4ae33b8e94 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb @@ -40,7 +40,7 @@ describe 'AnotherFakeApi' do # @return [Client] describe 'call_123_test_special_tags test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/api/default_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/default_api_spec.rb index fd58eaa21a6..a4c4123b2f4 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/default_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/default_api_spec.rb @@ -37,7 +37,7 @@ describe 'DefaultApi' do # @return [InlineResponseDefault] describe 'foo_get test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb index 7374568eaf0..659c054e04d 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -38,7 +38,7 @@ describe 'FakeApi' do # @return [HealthCheckResult] describe 'fake_health_get test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -51,7 +51,7 @@ describe 'FakeApi' do # @return [nil] describe 'fake_http_signature_test test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -62,7 +62,7 @@ describe 'FakeApi' do # @return [Boolean] describe 'fake_outer_boolean_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -73,7 +73,7 @@ describe 'FakeApi' do # @return [OuterComposite] describe 'fake_outer_composite_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -84,7 +84,7 @@ describe 'FakeApi' do # @return [Float] describe 'fake_outer_number_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -95,29 +95,29 @@ describe 'FakeApi' do # @return [String] describe 'fake_outer_string_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_body_with_file_schema # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class + # @param file_schema_test_class # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_file_schema test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_body_with_query_params - # @param query - # @param user + # @param query + # @param user # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_query_params test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -129,13 +129,13 @@ describe 'FakeApi' do # @return [Client] describe 'test_client_model test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_endpoint_parameters - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # @param number None # @param double None # @param pattern_without_delimiter None @@ -154,7 +154,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_endpoint_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -173,7 +173,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_enum_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -190,7 +190,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_group_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -201,7 +201,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_inline_additional_properties test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -213,22 +213,22 @@ describe 'FakeApi' do # @return [nil] describe 'test_json_form_data test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ 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 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 + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb index 1db2b3c9ef5..e102683e57e 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb @@ -40,7 +40,7 @@ describe 'FakeClassnameTags123Api' do # @return [Client] describe 'test_classname test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb index 26ca32b2f75..f20fc2c623b 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb @@ -39,7 +39,7 @@ describe 'PetApi' do # @return [nil] describe 'add_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -47,11 +47,11 @@ describe 'PetApi' do # Deletes a pet # @param pet_id Pet id to delete # @param [Hash] opts the optional parameters - # @option opts [String] :api_key + # @option opts [String] :api_key # @return [nil] describe 'delete_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -63,7 +63,7 @@ describe 'PetApi' do # @return [Array] describe 'find_pets_by_status test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -75,7 +75,7 @@ describe 'PetApi' do # @return [Array] describe 'find_pets_by_tags test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -87,7 +87,7 @@ describe 'PetApi' do # @return [Pet] describe 'get_pet_by_id test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -98,7 +98,7 @@ describe 'PetApi' do # @return [nil] describe 'update_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -111,7 +111,7 @@ describe 'PetApi' do # @return [nil] describe 'update_pet_with_form test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -124,7 +124,7 @@ describe 'PetApi' do # @return [ApiResponse] describe 'upload_file test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -137,7 +137,7 @@ describe 'PetApi' do # @return [ApiResponse] describe 'upload_file_with_required_file test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb index 97c3d704de0..7ef3b058dd7 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb @@ -40,7 +40,7 @@ describe 'StoreApi' do # @return [nil] describe 'delete_order test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -51,7 +51,7 @@ describe 'StoreApi' do # @return [Hash] describe 'get_inventory test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -63,7 +63,7 @@ describe 'StoreApi' do # @return [Order] describe 'get_order_by_id test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -74,7 +74,7 @@ describe 'StoreApi' do # @return [Order] describe 'place_order test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb index 39178c5a5ac..d534f519861 100644 --- a/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb @@ -40,7 +40,7 @@ describe 'UserApi' do # @return [nil] describe 'create_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -51,7 +51,7 @@ describe 'UserApi' do # @return [nil] describe 'create_users_with_array_input test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -62,7 +62,7 @@ describe 'UserApi' do # @return [nil] describe 'create_users_with_list_input test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -74,7 +74,7 @@ describe 'UserApi' do # @return [nil] describe 'delete_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -85,7 +85,7 @@ describe 'UserApi' do # @return [User] describe 'get_user_by_name test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -97,7 +97,7 @@ describe 'UserApi' do # @return [String] describe 'login_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -107,7 +107,7 @@ describe 'UserApi' do # @return [nil] describe 'logout_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -120,7 +120,7 @@ describe 'UserApi' do # @return [nil] describe 'update_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb index 93a5b0d5fb4..2cfb6c67149 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb @@ -34,13 +34,13 @@ describe 'AdditionalPropertiesClass' do end describe 'test attribute "map_property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map_of_map_property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/all_of_with_single_ref_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/all_of_with_single_ref_spec.rb index 61fe40343c7..532fe2f6a92 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/all_of_with_single_ref_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/all_of_with_single_ref_spec.rb @@ -27,13 +27,13 @@ describe Petstore::AllOfWithSingleRef do end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "single_ref_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb index 8b3e9adc537..2bb034b310f 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb @@ -34,13 +34,13 @@ describe 'Animal' do end describe 'test attribute "class_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "color"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb index 628f1c4d7c1..267301460d9 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb @@ -34,19 +34,19 @@ describe 'ApiResponse' do end describe 'test attribute "code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb index ea41c9a4b38..78f4a08761a 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb @@ -34,7 +34,7 @@ describe 'ArrayOfArrayOfNumberOnly' do end describe 'test attribute "array_array_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb index ba90932a797..3e2ea611eca 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb @@ -34,7 +34,7 @@ describe 'ArrayOfNumberOnly' do end describe 'test attribute "array_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb index 6ff7397ad43..4633c0d8f3d 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb @@ -34,19 +34,19 @@ describe 'ArrayTest' do end describe 'test attribute "array_of_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_array_of_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_array_of_model"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb index 451c59af970..025a0c5b09c 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb @@ -34,37 +34,37 @@ describe 'Capitalization' do end describe 'test attribute "small_camel"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "capital_camel"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "small_snake"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "capital_snake"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "sca_eth_flow_points"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "att_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb index 926ce8a2a37..9530b974cbd 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb @@ -34,7 +34,7 @@ describe 'CatAllOf' do end describe 'test attribute "declawed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb index 3efb677ce64..3007a05924f 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb @@ -34,7 +34,7 @@ describe 'Cat' do end describe 'test attribute "declawed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb index 82ecd78d966..aa9fb18d97f 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb @@ -34,13 +34,13 @@ describe 'Category' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb index 761e8933127..e5cadd24dad 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb @@ -34,7 +34,7 @@ describe 'ClassModel' do end describe 'test attribute "_class"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb index 4bf1ce0622b..ef798f27dad 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb @@ -34,7 +34,7 @@ describe 'Client' do end describe 'test attribute "client"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/deprecated_object_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/deprecated_object_spec.rb index 46f40e5c270..244cae37464 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/deprecated_object_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/deprecated_object_spec.rb @@ -27,7 +27,7 @@ describe Petstore::DeprecatedObject do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb index 5596927d423..fe263db11c0 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb @@ -34,7 +34,7 @@ describe 'DogAllOf' do end describe 'test attribute "breed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb index b82df3e9d72..4263bda06f1 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb @@ -34,7 +34,7 @@ describe 'Dog' do end describe 'test attribute "breed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb index ac75c92581d..a839505446d 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb @@ -34,7 +34,7 @@ describe 'EnumArrays' do end describe 'test attribute "just_symbol"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', [">=", "$"]) # validator.allowable_values.each do |value| # expect { @instance.just_symbol = value }.not_to raise_error @@ -44,7 +44,7 @@ describe 'EnumArrays' do describe 'test attribute "array_enum"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["fish", "crab"]) # validator.allowable_values.each do |value| # expect { @instance.array_enum = value }.not_to raise_error diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb index 7f4c9c97e87..0235c261aa4 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb @@ -34,7 +34,7 @@ describe 'EnumTest' do end describe 'test attribute "enum_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) # validator.allowable_values.each do |value| # expect { @instance.enum_string = value }.not_to raise_error @@ -44,7 +44,7 @@ describe 'EnumTest' do describe 'test attribute "enum_string_required"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) # validator.allowable_values.each do |value| # expect { @instance.enum_string_required = value }.not_to raise_error @@ -54,7 +54,7 @@ describe 'EnumTest' do describe 'test attribute "enum_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [1, -1]) # validator.allowable_values.each do |value| # expect { @instance.enum_integer = value }.not_to raise_error @@ -64,7 +64,7 @@ describe 'EnumTest' do describe 'test attribute "enum_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', [1.1, -1.2]) # validator.allowable_values.each do |value| # expect { @instance.enum_number = value }.not_to raise_error @@ -74,25 +74,25 @@ describe 'EnumTest' do describe 'test attribute "outer_enum"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_default_value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_integer_default_value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb index 8a8d92658c9..4c8d3f9d80a 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb @@ -34,13 +34,13 @@ describe 'FileSchemaTestClass' do end describe 'test attribute "file"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "files"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb index b9d1499766e..0afb47c7a96 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb @@ -34,7 +34,7 @@ describe 'File' do end describe 'test attribute "source_uri"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/foo_get_default_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/foo_get_default_response_spec.rb index 98a41243fe1..3ce38971bc3 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/foo_get_default_response_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/foo_get_default_response_spec.rb @@ -27,7 +27,7 @@ describe Petstore::FooGetDefaultResponse do end describe 'test attribute "string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/foo_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/foo_spec.rb index 46f8aa8a1d9..fc54b3ac92f 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/foo_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/foo_spec.rb @@ -34,7 +34,7 @@ describe 'Foo' do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb index 72fe239f298..a2cda082f02 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb @@ -34,91 +34,91 @@ describe 'FormatTest' do end describe 'test attribute "integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "int32"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "int64"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "float"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "double"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "byte"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "binary"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pattern_with_digits"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pattern_with_digits_and_delimiter"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb index 9efa03a22fe..5630b1cf97d 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb @@ -34,13 +34,13 @@ describe 'HasOnlyReadOnly' do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "foo"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb index e90a77ec8a7..797ee9704d3 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb @@ -34,7 +34,7 @@ describe 'HealthCheckResult' do end describe 'test attribute "nullable_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb index db397aa108f..88716e86942 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb @@ -34,7 +34,7 @@ describe 'List' do end describe 'test attribute "_123_list"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb index f7ff6788b09..012b9cc251f 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb @@ -34,13 +34,13 @@ describe 'MapTest' do end describe 'test attribute "map_map_of_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map_of_enum_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Hash', ["UPPER", "lower"]) # validator.allowable_values.each do |value| # expect { @instance.map_of_enum_string = value }.not_to raise_error @@ -50,13 +50,13 @@ describe 'MapTest' do describe 'test attribute "direct_map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "indirect_map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb index 0e88f472524..f58460e50e0 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -34,19 +34,19 @@ describe 'MixedPropertiesAndAdditionalPropertiesClass' do end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb index 133f6b94c14..245390ee6c0 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb @@ -34,13 +34,13 @@ describe 'Model200Response' do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_class"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb index 57d400eb116..5881f54839a 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb @@ -34,7 +34,7 @@ describe 'ModelReturn' do end describe 'test attribute "_return"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb index c882db4f221..1edec1a9463 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb @@ -34,25 +34,25 @@ describe 'Name' do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "snake_case"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_123_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb index f1301d0a83d..5507799a0aa 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb @@ -34,73 +34,73 @@ describe 'NullableClass' do end describe 'test attribute "integer_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "number_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "boolean_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "string_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "datetime_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_and_items_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_items_nullable"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_and_items_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_items_nullable"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb index 0963591fcc1..2ecc4260dda 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb @@ -34,7 +34,7 @@ describe 'NumberOnly' do end describe 'test attribute "just_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/object_with_deprecated_fields_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/object_with_deprecated_fields_spec.rb index 5647b98bdc2..d6372aa68b5 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/object_with_deprecated_fields_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/object_with_deprecated_fields_spec.rb @@ -27,25 +27,25 @@ describe Petstore::ObjectWithDeprecatedFields do end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "deprecated_ref"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "bars"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb index 3f1d973b275..e7a9dea74da 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb @@ -34,31 +34,31 @@ describe 'Order' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pet_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "quantity"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "ship_date"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) # validator.allowable_values.each do |value| # expect { @instance.status = value }.not_to raise_error @@ -68,7 +68,7 @@ describe 'Order' do describe 'test attribute "complete"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb index bb36f488959..ad4053e2c4a 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb @@ -34,19 +34,19 @@ describe 'OuterComposite' do end describe 'test attribute "my_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "my_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "my_boolean"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/outer_object_with_enum_property_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_object_with_enum_property_spec.rb index 561ef7172b8..1a590a78b29 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/outer_object_with_enum_property_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/outer_object_with_enum_property_spec.rb @@ -27,7 +27,7 @@ describe Petstore::OuterObjectWithEnumProperty do end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb index dc0a0898c9f..f8a46865240 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb @@ -34,37 +34,37 @@ describe 'Pet' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "category"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "photo_urls"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tags"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["available", "pending", "sold"]) # validator.allowable_values.each do |value| # expect { @instance.status = value }.not_to raise_error diff --git a/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb index 8d60e443313..036dd5581ee 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb @@ -34,13 +34,13 @@ describe 'ReadOnlyFirst' do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "baz"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb index b548f7f0951..78555f967cc 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb @@ -34,7 +34,7 @@ describe 'SpecialModelName' do end describe 'test attribute "special_property_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb index 3a745439040..e791cb35e14 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb @@ -34,13 +34,13 @@ describe 'Tag' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb index 2eb31e993a0..9d162c5d999 100644 --- a/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb @@ -34,49 +34,49 @@ describe 'User' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "first_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "last_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "email"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "phone"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "user_status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/all_of_with_single_ref.rb b/samples/client/petstore/ruby/lib/petstore/models/all_of_with_single_ref.rb index c7e611e2f52..7fa9cc1beac 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/all_of_with_single_ref.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/all_of_with_single_ref.rb @@ -19,6 +19,28 @@ module Petstore attr_accessor :single_ref_type + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { 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 bf187f0971f..c4ae33b8e94 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 @@ -40,7 +40,7 @@ describe 'AnotherFakeApi' do # @return [Client] describe 'call_123_test_special_tags test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/api/default_api_spec.rb b/samples/client/petstore/ruby/spec/api/default_api_spec.rb index fd58eaa21a6..a4c4123b2f4 100644 --- a/samples/client/petstore/ruby/spec/api/default_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/default_api_spec.rb @@ -37,7 +37,7 @@ describe 'DefaultApi' do # @return [InlineResponseDefault] describe 'foo_get test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end 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 7374568eaf0..659c054e04d 100644 --- a/samples/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -38,7 +38,7 @@ describe 'FakeApi' do # @return [HealthCheckResult] describe 'fake_health_get test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -51,7 +51,7 @@ describe 'FakeApi' do # @return [nil] describe 'fake_http_signature_test test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -62,7 +62,7 @@ describe 'FakeApi' do # @return [Boolean] describe 'fake_outer_boolean_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -73,7 +73,7 @@ describe 'FakeApi' do # @return [OuterComposite] describe 'fake_outer_composite_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -84,7 +84,7 @@ describe 'FakeApi' do # @return [Float] describe 'fake_outer_number_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -95,29 +95,29 @@ describe 'FakeApi' do # @return [String] describe 'fake_outer_string_serialize test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_body_with_file_schema # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class + # @param file_schema_test_class # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_file_schema test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_body_with_query_params - # @param query - # @param user + # @param query + # @param user # @param [Hash] opts the optional parameters # @return [nil] describe 'test_body_with_query_params test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -129,13 +129,13 @@ describe 'FakeApi' do # @return [Client] describe 'test_client_model test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end # unit tests for test_endpoint_parameters - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # @param number None # @param double None # @param pattern_without_delimiter None @@ -154,7 +154,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_endpoint_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -173,7 +173,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_enum_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -190,7 +190,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_group_parameters test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -201,7 +201,7 @@ describe 'FakeApi' do # @return [nil] describe 'test_inline_additional_properties test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -213,22 +213,22 @@ describe 'FakeApi' do # @return [nil] describe 'test_json_form_data test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ 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 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 + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ 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 1db2b3c9ef5..e102683e57e 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 @@ -40,7 +40,7 @@ describe 'FakeClassnameTags123Api' do # @return [Client] describe 'test_classname test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end 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 26ca32b2f75..f20fc2c623b 100644 --- a/samples/client/petstore/ruby/spec/api/pet_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/pet_api_spec.rb @@ -39,7 +39,7 @@ describe 'PetApi' do # @return [nil] describe 'add_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -47,11 +47,11 @@ describe 'PetApi' do # Deletes a pet # @param pet_id Pet id to delete # @param [Hash] opts the optional parameters - # @option opts [String] :api_key + # @option opts [String] :api_key # @return [nil] describe 'delete_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -63,7 +63,7 @@ describe 'PetApi' do # @return [Array] describe 'find_pets_by_status test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -75,7 +75,7 @@ describe 'PetApi' do # @return [Array] describe 'find_pets_by_tags test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -87,7 +87,7 @@ describe 'PetApi' do # @return [Pet] describe 'get_pet_by_id test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -98,7 +98,7 @@ describe 'PetApi' do # @return [nil] describe 'update_pet test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -111,7 +111,7 @@ describe 'PetApi' do # @return [nil] describe 'update_pet_with_form test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -124,7 +124,7 @@ describe 'PetApi' do # @return [ApiResponse] describe 'upload_file test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -137,7 +137,7 @@ describe 'PetApi' do # @return [ApiResponse] describe 'upload_file_with_required_file test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end 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 97c3d704de0..7ef3b058dd7 100644 --- a/samples/client/petstore/ruby/spec/api/store_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/store_api_spec.rb @@ -40,7 +40,7 @@ describe 'StoreApi' do # @return [nil] describe 'delete_order test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -51,7 +51,7 @@ describe 'StoreApi' do # @return [Hash] describe 'get_inventory test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -63,7 +63,7 @@ describe 'StoreApi' do # @return [Order] describe 'get_order_by_id test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -74,7 +74,7 @@ describe 'StoreApi' do # @return [Order] describe 'place_order test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end 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 39178c5a5ac..d534f519861 100644 --- a/samples/client/petstore/ruby/spec/api/user_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/user_api_spec.rb @@ -40,7 +40,7 @@ describe 'UserApi' do # @return [nil] describe 'create_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -51,7 +51,7 @@ describe 'UserApi' do # @return [nil] describe 'create_users_with_array_input test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -62,7 +62,7 @@ describe 'UserApi' do # @return [nil] describe 'create_users_with_list_input test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -74,7 +74,7 @@ describe 'UserApi' do # @return [nil] describe 'delete_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -85,7 +85,7 @@ describe 'UserApi' do # @return [User] describe 'get_user_by_name test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -97,7 +97,7 @@ describe 'UserApi' do # @return [String] describe 'login_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -107,7 +107,7 @@ describe 'UserApi' do # @return [nil] describe 'logout_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -120,7 +120,7 @@ describe 'UserApi' do # @return [nil] describe 'update_user test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end 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 93a5b0d5fb4..2cfb6c67149 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 @@ -34,13 +34,13 @@ describe 'AdditionalPropertiesClass' do end describe 'test attribute "map_property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map_of_map_property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/all_of_with_single_ref_spec.rb b/samples/client/petstore/ruby/spec/models/all_of_with_single_ref_spec.rb index 61fe40343c7..532fe2f6a92 100644 --- a/samples/client/petstore/ruby/spec/models/all_of_with_single_ref_spec.rb +++ b/samples/client/petstore/ruby/spec/models/all_of_with_single_ref_spec.rb @@ -27,13 +27,13 @@ describe Petstore::AllOfWithSingleRef do end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "single_ref_type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/animal_spec.rb b/samples/client/petstore/ruby/spec/models/animal_spec.rb index 8b3e9adc537..2bb034b310f 100644 --- a/samples/client/petstore/ruby/spec/models/animal_spec.rb +++ b/samples/client/petstore/ruby/spec/models/animal_spec.rb @@ -34,13 +34,13 @@ describe 'Animal' do end describe 'test attribute "class_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "color"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/api_response_spec.rb b/samples/client/petstore/ruby/spec/models/api_response_spec.rb index 628f1c4d7c1..267301460d9 100644 --- a/samples/client/petstore/ruby/spec/models/api_response_spec.rb +++ b/samples/client/petstore/ruby/spec/models/api_response_spec.rb @@ -34,19 +34,19 @@ describe 'ApiResponse' do end describe 'test attribute "code"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "type"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb b/samples/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb index ea41c9a4b38..78f4a08761a 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 @@ -34,7 +34,7 @@ describe 'ArrayOfArrayOfNumberOnly' do end describe 'test attribute "array_array_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/array_of_number_only_spec.rb b/samples/client/petstore/ruby/spec/models/array_of_number_only_spec.rb index ba90932a797..3e2ea611eca 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 @@ -34,7 +34,7 @@ describe 'ArrayOfNumberOnly' do end describe 'test attribute "array_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/array_test_spec.rb b/samples/client/petstore/ruby/spec/models/array_test_spec.rb index 6ff7397ad43..4633c0d8f3d 100644 --- a/samples/client/petstore/ruby/spec/models/array_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/array_test_spec.rb @@ -34,19 +34,19 @@ describe 'ArrayTest' do end describe 'test attribute "array_of_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_array_of_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_array_of_model"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/capitalization_spec.rb b/samples/client/petstore/ruby/spec/models/capitalization_spec.rb index 451c59af970..025a0c5b09c 100644 --- a/samples/client/petstore/ruby/spec/models/capitalization_spec.rb +++ b/samples/client/petstore/ruby/spec/models/capitalization_spec.rb @@ -34,37 +34,37 @@ describe 'Capitalization' do end describe 'test attribute "small_camel"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "capital_camel"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "small_snake"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "capital_snake"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "sca_eth_flow_points"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "att_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/cat_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/cat_all_of_spec.rb index 926ce8a2a37..9530b974cbd 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 @@ -34,7 +34,7 @@ describe 'CatAllOf' do end describe 'test attribute "declawed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/cat_spec.rb b/samples/client/petstore/ruby/spec/models/cat_spec.rb index 3efb677ce64..3007a05924f 100644 --- a/samples/client/petstore/ruby/spec/models/cat_spec.rb +++ b/samples/client/petstore/ruby/spec/models/cat_spec.rb @@ -34,7 +34,7 @@ describe 'Cat' do end describe 'test attribute "declawed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/category_spec.rb b/samples/client/petstore/ruby/spec/models/category_spec.rb index 82ecd78d966..aa9fb18d97f 100644 --- a/samples/client/petstore/ruby/spec/models/category_spec.rb +++ b/samples/client/petstore/ruby/spec/models/category_spec.rb @@ -34,13 +34,13 @@ describe 'Category' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/class_model_spec.rb b/samples/client/petstore/ruby/spec/models/class_model_spec.rb index 761e8933127..e5cadd24dad 100644 --- a/samples/client/petstore/ruby/spec/models/class_model_spec.rb +++ b/samples/client/petstore/ruby/spec/models/class_model_spec.rb @@ -34,7 +34,7 @@ describe 'ClassModel' do end describe 'test attribute "_class"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/client_spec.rb b/samples/client/petstore/ruby/spec/models/client_spec.rb index 4bf1ce0622b..ef798f27dad 100644 --- a/samples/client/petstore/ruby/spec/models/client_spec.rb +++ b/samples/client/petstore/ruby/spec/models/client_spec.rb @@ -34,7 +34,7 @@ describe 'Client' do end describe 'test attribute "client"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/deprecated_object_spec.rb b/samples/client/petstore/ruby/spec/models/deprecated_object_spec.rb index 46f40e5c270..244cae37464 100644 --- a/samples/client/petstore/ruby/spec/models/deprecated_object_spec.rb +++ b/samples/client/petstore/ruby/spec/models/deprecated_object_spec.rb @@ -27,7 +27,7 @@ describe Petstore::DeprecatedObject do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/dog_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/dog_all_of_spec.rb index 5596927d423..fe263db11c0 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 @@ -34,7 +34,7 @@ describe 'DogAllOf' do end describe 'test attribute "breed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/dog_spec.rb b/samples/client/petstore/ruby/spec/models/dog_spec.rb index b82df3e9d72..4263bda06f1 100644 --- a/samples/client/petstore/ruby/spec/models/dog_spec.rb +++ b/samples/client/petstore/ruby/spec/models/dog_spec.rb @@ -34,7 +34,7 @@ describe 'Dog' do end describe 'test attribute "breed"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb b/samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb index ac75c92581d..a839505446d 100644 --- a/samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb +++ b/samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb @@ -34,7 +34,7 @@ describe 'EnumArrays' do end describe 'test attribute "just_symbol"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', [">=", "$"]) # validator.allowable_values.each do |value| # expect { @instance.just_symbol = value }.not_to raise_error @@ -44,7 +44,7 @@ describe 'EnumArrays' do describe 'test attribute "array_enum"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["fish", "crab"]) # validator.allowable_values.each do |value| # expect { @instance.array_enum = value }.not_to raise_error 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 7f4c9c97e87..0235c261aa4 100644 --- a/samples/client/petstore/ruby/spec/models/enum_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/enum_test_spec.rb @@ -34,7 +34,7 @@ describe 'EnumTest' do end describe 'test attribute "enum_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) # validator.allowable_values.each do |value| # expect { @instance.enum_string = value }.not_to raise_error @@ -44,7 +44,7 @@ describe 'EnumTest' do describe 'test attribute "enum_string_required"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) # validator.allowable_values.each do |value| # expect { @instance.enum_string_required = value }.not_to raise_error @@ -54,7 +54,7 @@ describe 'EnumTest' do describe 'test attribute "enum_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [1, -1]) # validator.allowable_values.each do |value| # expect { @instance.enum_integer = value }.not_to raise_error @@ -64,7 +64,7 @@ describe 'EnumTest' do describe 'test attribute "enum_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', [1.1, -1.2]) # validator.allowable_values.each do |value| # expect { @instance.enum_number = value }.not_to raise_error @@ -74,25 +74,25 @@ describe 'EnumTest' do describe 'test attribute "outer_enum"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_default_value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "outer_enum_integer_default_value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb b/samples/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb index 8a8d92658c9..4c8d3f9d80a 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 @@ -34,13 +34,13 @@ describe 'FileSchemaTestClass' do end describe 'test attribute "file"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "files"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/file_spec.rb b/samples/client/petstore/ruby/spec/models/file_spec.rb index b9d1499766e..0afb47c7a96 100644 --- a/samples/client/petstore/ruby/spec/models/file_spec.rb +++ b/samples/client/petstore/ruby/spec/models/file_spec.rb @@ -34,7 +34,7 @@ describe 'File' do end describe 'test attribute "source_uri"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/foo_get_default_response_spec.rb b/samples/client/petstore/ruby/spec/models/foo_get_default_response_spec.rb index 98a41243fe1..3ce38971bc3 100644 --- a/samples/client/petstore/ruby/spec/models/foo_get_default_response_spec.rb +++ b/samples/client/petstore/ruby/spec/models/foo_get_default_response_spec.rb @@ -27,7 +27,7 @@ describe Petstore::FooGetDefaultResponse do end describe 'test attribute "string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/foo_spec.rb b/samples/client/petstore/ruby/spec/models/foo_spec.rb index 46f8aa8a1d9..fc54b3ac92f 100644 --- a/samples/client/petstore/ruby/spec/models/foo_spec.rb +++ b/samples/client/petstore/ruby/spec/models/foo_spec.rb @@ -34,7 +34,7 @@ describe 'Foo' do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end 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 72fe239f298..a2cda082f02 100644 --- a/samples/client/petstore/ruby/spec/models/format_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/format_test_spec.rb @@ -34,91 +34,91 @@ describe 'FormatTest' do end describe 'test attribute "integer"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "int32"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "int64"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "float"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "double"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "byte"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "binary"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pattern_with_digits"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pattern_with_digits_and_delimiter"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/has_only_read_only_spec.rb b/samples/client/petstore/ruby/spec/models/has_only_read_only_spec.rb index 9efa03a22fe..5630b1cf97d 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 @@ -34,13 +34,13 @@ describe 'HasOnlyReadOnly' do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "foo"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/health_check_result_spec.rb b/samples/client/petstore/ruby/spec/models/health_check_result_spec.rb index e90a77ec8a7..797ee9704d3 100644 --- a/samples/client/petstore/ruby/spec/models/health_check_result_spec.rb +++ b/samples/client/petstore/ruby/spec/models/health_check_result_spec.rb @@ -34,7 +34,7 @@ describe 'HealthCheckResult' do end describe 'test attribute "nullable_message"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/list_spec.rb b/samples/client/petstore/ruby/spec/models/list_spec.rb index db397aa108f..88716e86942 100644 --- a/samples/client/petstore/ruby/spec/models/list_spec.rb +++ b/samples/client/petstore/ruby/spec/models/list_spec.rb @@ -34,7 +34,7 @@ describe 'List' do end describe 'test attribute "_123_list"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/map_test_spec.rb b/samples/client/petstore/ruby/spec/models/map_test_spec.rb index f7ff6788b09..012b9cc251f 100644 --- a/samples/client/petstore/ruby/spec/models/map_test_spec.rb +++ b/samples/client/petstore/ruby/spec/models/map_test_spec.rb @@ -34,13 +34,13 @@ describe 'MapTest' do end describe 'test attribute "map_map_of_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map_of_enum_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Hash', ["UPPER", "lower"]) # validator.allowable_values.each do |value| # expect { @instance.map_of_enum_string = value }.not_to raise_error @@ -50,13 +50,13 @@ describe 'MapTest' do describe 'test attribute "direct_map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "indirect_map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb index 0e88f472524..f58460e50e0 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 @@ -34,19 +34,19 @@ describe 'MixedPropertiesAndAdditionalPropertiesClass' do end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_time"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "map"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/model200_response_spec.rb b/samples/client/petstore/ruby/spec/models/model200_response_spec.rb index 133f6b94c14..245390ee6c0 100644 --- a/samples/client/petstore/ruby/spec/models/model200_response_spec.rb +++ b/samples/client/petstore/ruby/spec/models/model200_response_spec.rb @@ -34,13 +34,13 @@ describe 'Model200Response' do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_class"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/model_return_spec.rb b/samples/client/petstore/ruby/spec/models/model_return_spec.rb index 57d400eb116..5881f54839a 100644 --- a/samples/client/petstore/ruby/spec/models/model_return_spec.rb +++ b/samples/client/petstore/ruby/spec/models/model_return_spec.rb @@ -34,7 +34,7 @@ describe 'ModelReturn' do end describe 'test attribute "_return"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/name_spec.rb b/samples/client/petstore/ruby/spec/models/name_spec.rb index c882db4f221..1edec1a9463 100644 --- a/samples/client/petstore/ruby/spec/models/name_spec.rb +++ b/samples/client/petstore/ruby/spec/models/name_spec.rb @@ -34,25 +34,25 @@ describe 'Name' do end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "snake_case"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "property"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "_123_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/nullable_class_spec.rb b/samples/client/petstore/ruby/spec/models/nullable_class_spec.rb index f1301d0a83d..5507799a0aa 100644 --- a/samples/client/petstore/ruby/spec/models/nullable_class_spec.rb +++ b/samples/client/petstore/ruby/spec/models/nullable_class_spec.rb @@ -34,73 +34,73 @@ describe 'NullableClass' do end describe 'test attribute "integer_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "number_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "boolean_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "string_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "date_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "datetime_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_and_items_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "array_items_nullable"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_and_items_nullable_prop"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "object_items_nullable"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/number_only_spec.rb b/samples/client/petstore/ruby/spec/models/number_only_spec.rb index 0963591fcc1..2ecc4260dda 100644 --- a/samples/client/petstore/ruby/spec/models/number_only_spec.rb +++ b/samples/client/petstore/ruby/spec/models/number_only_spec.rb @@ -34,7 +34,7 @@ describe 'NumberOnly' do end describe 'test attribute "just_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/object_with_deprecated_fields_spec.rb b/samples/client/petstore/ruby/spec/models/object_with_deprecated_fields_spec.rb index 5647b98bdc2..d6372aa68b5 100644 --- a/samples/client/petstore/ruby/spec/models/object_with_deprecated_fields_spec.rb +++ b/samples/client/petstore/ruby/spec/models/object_with_deprecated_fields_spec.rb @@ -27,25 +27,25 @@ describe Petstore::ObjectWithDeprecatedFields do end describe 'test attribute "uuid"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "deprecated_ref"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "bars"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/order_spec.rb b/samples/client/petstore/ruby/spec/models/order_spec.rb index 3f1d973b275..e7a9dea74da 100644 --- a/samples/client/petstore/ruby/spec/models/order_spec.rb +++ b/samples/client/petstore/ruby/spec/models/order_spec.rb @@ -34,31 +34,31 @@ describe 'Order' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "pet_id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "quantity"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "ship_date"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) # validator.allowable_values.each do |value| # expect { @instance.status = value }.not_to raise_error @@ -68,7 +68,7 @@ describe 'Order' do describe 'test attribute "complete"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb b/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb index bb36f488959..ad4053e2c4a 100644 --- a/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb +++ b/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb @@ -34,19 +34,19 @@ describe 'OuterComposite' do end describe 'test attribute "my_number"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "my_string"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "my_boolean"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/outer_object_with_enum_property_spec.rb b/samples/client/petstore/ruby/spec/models/outer_object_with_enum_property_spec.rb index 561ef7172b8..1a590a78b29 100644 --- a/samples/client/petstore/ruby/spec/models/outer_object_with_enum_property_spec.rb +++ b/samples/client/petstore/ruby/spec/models/outer_object_with_enum_property_spec.rb @@ -27,7 +27,7 @@ describe Petstore::OuterObjectWithEnumProperty do end describe 'test attribute "value"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/pet_spec.rb b/samples/client/petstore/ruby/spec/models/pet_spec.rb index dc0a0898c9f..f8a46865240 100644 --- a/samples/client/petstore/ruby/spec/models/pet_spec.rb +++ b/samples/client/petstore/ruby/spec/models/pet_spec.rb @@ -34,37 +34,37 @@ describe 'Pet' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "category"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "photo_urls"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "tags"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["available", "pending", "sold"]) # validator.allowable_values.each do |value| # expect { @instance.status = value }.not_to raise_error diff --git a/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby/spec/models/read_only_first_spec.rb index 8d60e443313..036dd5581ee 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 @@ -34,13 +34,13 @@ describe 'ReadOnlyFirst' do end describe 'test attribute "bar"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "baz"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb b/samples/client/petstore/ruby/spec/models/special_model_name_spec.rb index b548f7f0951..78555f967cc 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 @@ -34,7 +34,7 @@ describe 'SpecialModelName' do end describe 'test attribute "special_property_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/tag_spec.rb b/samples/client/petstore/ruby/spec/models/tag_spec.rb index 3a745439040..e791cb35e14 100644 --- a/samples/client/petstore/ruby/spec/models/tag_spec.rb +++ b/samples/client/petstore/ruby/spec/models/tag_spec.rb @@ -34,13 +34,13 @@ describe 'Tag' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/ruby/spec/models/user_spec.rb b/samples/client/petstore/ruby/spec/models/user_spec.rb index 2eb31e993a0..9d162c5d999 100644 --- a/samples/client/petstore/ruby/spec/models/user_spec.rb +++ b/samples/client/petstore/ruby/spec/models/user_spec.rb @@ -34,49 +34,49 @@ describe 'User' do end describe 'test attribute "id"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "username"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "first_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "last_name"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "email"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "password"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "phone"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end describe 'test attribute "user_status"' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES b/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES deleted file mode 100644 index 3510d2b2d27..00000000000 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES +++ /dev/null @@ -1,16 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiClient.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiClient.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiClient.java -src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java -src/main/java/org/openapitools/configuration/ClientConfiguration.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/User.java diff --git a/samples/client/petstore/spring-cloud-async/README.md b/samples/client/petstore/spring-cloud-async/README.md deleted file mode 100644 index f176b79c8ae..00000000000 --- a/samples/client/petstore/spring-cloud-async/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# petstore-spring-cloud - -## Requirements - -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn deploy -``` - -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - org.openapitools - petstore-spring-cloud - 1.0.0 - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy -compile "org.openapitools:petstore-spring-cloud:1.0.0" -``` - -### Others - -At first generate the JAR by executing: - -mvn package - -Then manually install the following JARs: - -* target/petstore-spring-cloud-1.0.0.jar -* target/lib/*.jar diff --git a/samples/client/petstore/spring-cloud-async/pom.xml b/samples/client/petstore/spring-cloud-async/pom.xml deleted file mode 100644 index e893d0fa75f..00000000000 --- a/samples/client/petstore/spring-cloud-async/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - 4.0.0 - org.openapitools - petstore-spring-cloud - jar - petstore-spring-cloud - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 2.9.2 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.6 - - - - src/main/java - - - - - - org.springframework.cloud - spring-cloud-starter-parent - 2021.0.5 - pom - import - - - - - - - - io.springfox - springfox-swagger2 - ${springfox.version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - org.springframework.cloud - spring-cloud-starter-oauth2 - 2.2.5.RELEASE - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - org.openapitools - jackson-databind-nullable - 0.2.6 - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.data - spring-data-commons - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApiClient.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApiClient.java deleted file mode 100644 index f80fe4ddc67..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApiClient.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.api; - -import org.springframework.cloud.openfeign.FeignClient; -import org.openapitools.configuration.ClientConfiguration; - -@FeignClient(name="${pet.name:pet}", url="${pet.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) -public interface PetApiClient extends PetApi { -} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApiClient.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApiClient.java deleted file mode 100644 index 71d613a871d..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApiClient.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.api; - -import org.springframework.cloud.openfeign.FeignClient; -import org.openapitools.configuration.ClientConfiguration; - -@FeignClient(name="${store.name:store}", url="${store.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) -public interface StoreApiClient extends StoreApi { -} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApiClient.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApiClient.java deleted file mode 100644 index 1db4598108d..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApiClient.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.api; - -import org.springframework.cloud.openfeign.FeignClient; -import org.openapitools.configuration.ClientConfiguration; - -@FeignClient(name="${user.name:user}", url="${user.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) -public interface UserApiClient extends UserApi { -} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java deleted file mode 100644 index 199278dcb53..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openapitools.configuration; - -import feign.RequestInterceptor; -import feign.RequestTemplate; -import feign.Util; - - -public class ApiKeyRequestInterceptor implements RequestInterceptor { - private final String location; - private final String name; - private String value; - - public ApiKeyRequestInterceptor(String location, String name, String value) { - Util.checkNotNull(location, "location", new Object[0]); - Util.checkNotNull(name, "name", new Object[0]); - Util.checkNotNull(value, "value", new Object[0]); - this.location = location; - this.name = name; - this.value = value; - } - - @Override - public void apply(RequestTemplate requestTemplate) { - if(location.equals("header")) { - requestTemplate.header(name, value); - } else if(location.equals("query")) { - requestTemplate.query(name, value); - } - } - -} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java deleted file mode 100644 index 49f1c66c11a..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.cloud.openfeign.security.OAuth2FeignRequestInterceptor; -import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext; -import org.springframework.security.oauth2.client.OAuth2ClientContext; -import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails; - -@Configuration -@EnableConfigurationProperties -public class ClientConfiguration { - - @Bean - @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") - public OAuth2FeignRequestInterceptor petstoreAuthRequestInterceptor(OAuth2ClientContext oAuth2ClientContext) { - return new OAuth2FeignRequestInterceptor(oAuth2ClientContext, petstoreAuthResourceDetails()); - } - - @Bean - @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") - public OAuth2ClientContext oAuth2ClientContext() { - return new DefaultOAuth2ClientContext(); - } - - @Bean - @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") - @ConfigurationProperties("openapipetstore.security.petstoreAuth") - public ImplicitResourceDetails petstoreAuthResourceDetails() { - ImplicitResourceDetails details = new ImplicitResourceDetails(); - details.setUserAuthorizationUri("http://petstore.swagger.io/api/oauth/dialog"); - return details; - } - - @Value("${openapipetstore.security.apiKey.key:}") - private String apiKeyKey; - - @Bean - @ConditionalOnProperty(name = "openapipetstore.security.apiKey.key") - public ApiKeyRequestInterceptor apiKeyRequestInterceptor() { - return new ApiKeyRequestInterceptor("header", "api_key", this.apiKeyKey); - } - -} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 9f5ef4d9f1a..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A category for a pet - */ - -@ApiModel(description = "A category for a pet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @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; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 66d9df6dfd9..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,246 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.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 org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * An order for a pets from the pet store - */ - -@ApiModel(description = "An order for a pets from the pet store") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @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; - } - - /** - * Get petId - * @return petId - */ - - @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; - } - - /** - * Get quantity - * @return quantity - */ - - @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; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @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; - } - - /** - * Order Status - * @return status - */ - - @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; - } - - /** - * Get complete - * @return complete - */ - - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - 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 60af3a5b92a..ce02f3c7d4e 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 @@ -43,7 +43,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -165,6 +165,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index b30aa3fd9a2..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A tag for a pet - */ - -@ApiModel(description = "A tag for a pet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @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; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index 8d71f0fcc04..00000000000 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,253 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A User who is purchasing from the pet store - */ - -@ApiModel(description = "A User who is purchasing from the pet store") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @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; - } - - /** - * Get username - * @return username - */ - - @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; - } - - /** - * Get firstName - * @return firstName - */ - - @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; - } - - /** - * Get lastName - * @return lastName - */ - - @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; - } - - /** - * Get email - * @return email - */ - - @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; - } - - /** - * Get password - * @return password - */ - - @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; - } - - /** - * Get phone - * @return phone - */ - - @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; - } - - /** - * User Status - * @return userStatus - */ - - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java index b8d21304b6c..a8eed0033a8 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -26,23 +26,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("@type") private String atType = "Pet"; - @JsonProperty("age") private Integer age = 4; - @JsonProperty("happy") private Boolean happy = true; - @JsonProperty("price") private BigDecimal price = new BigDecimal("32000000000"); - @JsonProperty("lastFeed") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime lastFeed = OffsetDateTime.parse("1973-12-19T11:39:57Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault())); - @JsonProperty("dateOfBirth") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate dateOfBirth = LocalDate.parse("2021-01-01"); @@ -73,6 +67,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("@type") public String getAtType() { return atType; } @@ -92,6 +87,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("age") public Integer getAge() { return age; } @@ -111,6 +107,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("happy") public Boolean getHappy() { return happy; } @@ -130,6 +127,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("price") public BigDecimal getPrice() { return price; } @@ -149,6 +147,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("lastFeed") public OffsetDateTime getLastFeed() { return lastFeed; } @@ -168,6 +167,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateOfBirth") public LocalDate getDateOfBirth() { return dateOfBirth; } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java index 909b0aba4e3..4a167e1c112 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -40,6 +38,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -59,6 +58,7 @@ public class Category { */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java index 52fb11fd3cf..a6a56521498 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -25,13 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -45,6 +42,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -64,6 +62,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -83,6 +82,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java index 66d9df6dfd9..45802212a9d 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java @@ -26,16 +26,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -76,10 +72,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -93,6 +87,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -112,6 +107,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -131,6 +127,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -150,6 +147,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -169,6 +167,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -188,6 +187,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java index 60af3a5b92a..086df08a3ed 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java @@ -28,22 +28,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -82,7 +77,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -113,6 +107,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -132,6 +127,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -151,6 +147,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -165,6 +162,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -175,6 +175,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -202,6 +203,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -221,6 +223,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java index b30aa3fd9a2..b6d3df29573 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -40,6 +38,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -59,6 +58,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java index 8d71f0fcc04..a5233b08ae5 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java @@ -23,28 +23,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -58,6 +50,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -77,6 +70,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -96,6 +90,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -115,6 +110,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -134,6 +130,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -153,6 +150,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -172,6 +170,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -191,6 +190,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/FILES b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/FILES deleted file mode 100644 index 3510d2b2d27..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/FILES +++ /dev/null @@ -1,16 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiClient.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiClient.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiClient.java -src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java -src/main/java/org/openapitools/configuration/ClientConfiguration.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/User.java diff --git a/samples/client/petstore/spring-cloud-spring-pageable/README.md b/samples/client/petstore/spring-cloud-spring-pageable/README.md deleted file mode 100644 index 6d07c5eb9af..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# spring-cloud-spring-pageable - -## Requirements - -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn deploy -``` - -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - org.openapitools - spring-cloud-spring-pageable - 1.0.0 - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy -compile "org.openapitools:spring-cloud-spring-pageable:1.0.0" -``` - -### Others - -At first generate the JAR by executing: - -mvn package - -Then manually install the following JARs: - -* target/spring-cloud-spring-pageable-1.0.0.jar -* target/lib/*.jar diff --git a/samples/client/petstore/spring-cloud-spring-pageable/pom.xml b/samples/client/petstore/spring-cloud-spring-pageable/pom.xml deleted file mode 100644 index 027c3fae62c..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - 4.0.0 - org.openapitools - spring-cloud-spring-pageable - jar - spring-cloud-spring-pageable - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 2.9.2 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.6 - - - - src/main/java - - - - - - org.springframework.cloud - spring-cloud-starter-parent - 2021.0.5 - pom - import - - - - - - - - io.springfox - springfox-swagger2 - ${springfox.version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - org.springframework.cloud - spring-cloud-starter-oauth2 - 2.2.5.RELEASE - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - org.openapitools - jackson-databind-nullable - 0.2.6 - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.data - spring-data-commons - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApiClient.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApiClient.java deleted file mode 100644 index f80fe4ddc67..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApiClient.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.api; - -import org.springframework.cloud.openfeign.FeignClient; -import org.openapitools.configuration.ClientConfiguration; - -@FeignClient(name="${pet.name:pet}", url="${pet.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) -public interface PetApiClient extends PetApi { -} diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApiClient.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApiClient.java deleted file mode 100644 index 71d613a871d..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApiClient.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.api; - -import org.springframework.cloud.openfeign.FeignClient; -import org.openapitools.configuration.ClientConfiguration; - -@FeignClient(name="${store.name:store}", url="${store.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) -public interface StoreApiClient extends StoreApi { -} diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApiClient.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApiClient.java deleted file mode 100644 index 1db4598108d..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApiClient.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.api; - -import org.springframework.cloud.openfeign.FeignClient; -import org.openapitools.configuration.ClientConfiguration; - -@FeignClient(name="${user.name:user}", url="${user.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) -public interface UserApiClient extends UserApi { -} diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java deleted file mode 100644 index 199278dcb53..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openapitools.configuration; - -import feign.RequestInterceptor; -import feign.RequestTemplate; -import feign.Util; - - -public class ApiKeyRequestInterceptor implements RequestInterceptor { - private final String location; - private final String name; - private String value; - - public ApiKeyRequestInterceptor(String location, String name, String value) { - Util.checkNotNull(location, "location", new Object[0]); - Util.checkNotNull(name, "name", new Object[0]); - Util.checkNotNull(value, "value", new Object[0]); - this.location = location; - this.name = name; - this.value = value; - } - - @Override - public void apply(RequestTemplate requestTemplate) { - if(location.equals("header")) { - requestTemplate.header(name, value); - } else if(location.equals("query")) { - requestTemplate.query(name, value); - } - } - -} diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/configuration/ClientConfiguration.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/configuration/ClientConfiguration.java deleted file mode 100644 index 49f1c66c11a..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/configuration/ClientConfiguration.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.cloud.openfeign.security.OAuth2FeignRequestInterceptor; -import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext; -import org.springframework.security.oauth2.client.OAuth2ClientContext; -import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails; - -@Configuration -@EnableConfigurationProperties -public class ClientConfiguration { - - @Bean - @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") - public OAuth2FeignRequestInterceptor petstoreAuthRequestInterceptor(OAuth2ClientContext oAuth2ClientContext) { - return new OAuth2FeignRequestInterceptor(oAuth2ClientContext, petstoreAuthResourceDetails()); - } - - @Bean - @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") - public OAuth2ClientContext oAuth2ClientContext() { - return new DefaultOAuth2ClientContext(); - } - - @Bean - @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") - @ConfigurationProperties("openapipetstore.security.petstoreAuth") - public ImplicitResourceDetails petstoreAuthResourceDetails() { - ImplicitResourceDetails details = new ImplicitResourceDetails(); - details.setUserAuthorizationUri("http://petstore.swagger.io/api/oauth/dialog"); - return details; - } - - @Value("${openapipetstore.security.apiKey.key:}") - private String apiKeyKey; - - @Bean - @ConditionalOnProperty(name = "openapipetstore.security.apiKey.key") - public ApiKeyRequestInterceptor apiKeyRequestInterceptor() { - return new ApiKeyRequestInterceptor("header", "api_key", this.apiKeyKey); - } - -} diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 52fb11fd3cf..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Describes the result of uploading an image resource - */ - -@ApiModel(description = "Describes the result of uploading an image resource") -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @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; - } - - /** - * Get type - * @return type - */ - - @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; - } - - /** - * Get message - * @return message - */ - - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 60af3a5b92a..ce02f3c7d4e 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -43,7 +43,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -165,6 +165,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index 8d71f0fcc04..00000000000 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,253 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A User who is purchasing from the pet store - */ - -@ApiModel(description = "A User who is purchasing from the pet store") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @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; - } - - /** - * Get username - * @return username - */ - - @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; - } - - /** - * Get firstName - * @return firstName - */ - - @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; - } - - /** - * Get lastName - * @return lastName - */ - - @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; - } - - /** - * Get email - * @return email - */ - - @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; - } - - /** - * Get password - * @return password - */ - - @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; - } - - /** - * Get phone - * @return phone - */ - - @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; - } - - /** - * User Status - * @return userStatus - */ - - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java index 909b0aba4e3..4a167e1c112 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -40,6 +38,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -59,6 +58,7 @@ public class Category { */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index 52fb11fd3cf..a6a56521498 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -25,13 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -45,6 +42,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -64,6 +62,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -83,6 +82,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java index 66d9df6dfd9..45802212a9d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java @@ -26,16 +26,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -76,10 +72,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -93,6 +87,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -112,6 +107,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -131,6 +127,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -150,6 +147,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -169,6 +167,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -188,6 +187,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } 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 60af3a5b92a..086df08a3ed 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 @@ -28,22 +28,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -82,7 +77,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -113,6 +107,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -132,6 +127,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -151,6 +147,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -165,6 +162,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -175,6 +175,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -202,6 +203,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -221,6 +223,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java index b30aa3fd9a2..b6d3df29573 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -40,6 +38,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -59,6 +58,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java index 8d71f0fcc04..a5233b08ae5 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java @@ -23,28 +23,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -58,6 +50,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -77,6 +70,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -96,6 +90,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -115,6 +110,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -134,6 +130,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -153,6 +150,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -172,6 +170,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -191,6 +190,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/spring-http-interface-reactive/.openapi-generator/FILES b/samples/client/petstore/spring-http-interface-reactive/.openapi-generator/FILES index 1249969fa6d..4507343d0db 100644 --- a/samples/client/petstore/spring-http-interface-reactive/.openapi-generator/FILES +++ b/samples/client/petstore/spring-http-interface-reactive/.openapi-generator/FILES @@ -27,6 +27,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -49,6 +50,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 534f0d98589..a09967f1248 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -28,7 +28,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -38,7 +38,7 @@ public interface AnotherFakeApi { contentType = "application/json" ) Mono> call123testSpecialTags( - @RequestBody Mono body + @RequestBody Mono client ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java index aacfe6a8b9a..33845474de5 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -62,7 +62,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/boolean", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) Mono> fakeOuterBooleanSerialize( @RequestBody(required = false) Mono body @@ -73,17 +73,17 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @HttpExchange( method = "POST", value = "/fake/outer/composite", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) Mono> fakeOuterCompositeSerialize( - @RequestBody(required = false) Mono body + @RequestBody(required = false) Mono outerComposite ); @@ -98,7 +98,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/number", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) Mono> fakeOuterNumberSerialize( @RequestBody(required = false) Mono body @@ -116,7 +116,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/string", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) Mono> fakeOuterStringSerialize( @RequestBody(required = false) Mono body @@ -127,7 +127,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @HttpExchange( @@ -137,7 +137,7 @@ public interface FakeApi { contentType = "application/json" ) Mono> testBodyWithFileSchema( - @RequestBody Mono body + @RequestBody Mono fileSchemaTestClass ); @@ -145,7 +145,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @HttpExchange( @@ -156,7 +156,7 @@ public interface FakeApi { ) Mono> testBodyWithQueryParams( @RequestParam(value = "query", required = true) String query, - @RequestBody Mono body + @RequestBody Mono user ); @@ -164,7 +164,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -174,7 +174,7 @@ public interface FakeApi { contentType = "application/json" ) Mono> testClientModel( - @RequestBody Mono body + @RequestBody Mono client ); @@ -285,8 +285,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -296,12 +297,13 @@ public interface FakeApi { contentType = "application/json" ) Mono> testInlineAdditionalProperties( - @RequestBody Mono> param + @RequestBody Mono> requestBody ); /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -324,7 +326,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -337,7 +338,6 @@ public interface FakeApi { ) Mono> testQueryParameterCollectionFormat( @RequestParam(value = "pipe", required = true) List pipe, - @RequestParam(value = "ioutil", required = true) List ioutil, @RequestParam(value = "http", required = true) List http, @RequestParam(value = "url", required = true) List url, @RequestParam(value = "context", required = true) List context diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index fbbb53fafa4..dcfc87600bf 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -28,7 +28,7 @@ public interface FakeClassnameTags123Api { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -38,7 +38,7 @@ public interface FakeClassnameTags123Api { contentType = "application/json" ) Mono> testClassname( - @RequestBody Mono body + @RequestBody Mono client ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java index c3a0d056578..d88432283ff 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import java.util.Set; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -28,8 +29,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -40,12 +42,13 @@ public interface PetApi { contentType = "application/json" ) Mono> addPet( - @RequestBody Mono body + @RequestBody Mono pet ); /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -121,9 +124,26 @@ public interface PetApi { /** - * PUT /pet : Update an existing pet + * GET /fake/{petId}/response-object-different-names * - * @param body Pet object that needs to be added to the store (required) + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/fake/{petId}/response-object-different-names", + accept = "application/json" + ) + Mono> responseObjectDifferentNames( + @PathVariable("petId") Long petId + ); + + + /** + * PUT /pet : Update an existing pet + * + * + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -136,12 +156,13 @@ public interface PetApi { contentType = "application/json" ) Mono> updatePet( - @RequestBody Mono body + @RequestBody Mono pet ); /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -163,6 +184,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -184,6 +206,7 @@ public interface PetApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java index f8e879da8b1..c9be8ac0467 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -80,8 +80,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -89,10 +90,10 @@ public interface StoreApi { method = "POST", value = "/store/order", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> placeOrder( - @RequestBody Mono body + @RequestBody Mono order ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java index d9afad5c4e5..f6360fa06f2 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -30,51 +30,53 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> createUser( - @RequestBody Mono body + @RequestBody Mono user ); /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user/createWithArray", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> createUsersWithArrayInput( - @RequestBody Flux body + @RequestBody Flux user ); /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user/createWithList", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> createUsersWithListInput( - @RequestBody Flux body + @RequestBody Flux user ); @@ -98,6 +100,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -116,6 +119,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -135,6 +139,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -153,7 +158,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -161,11 +166,11 @@ public interface UserApi { method = "PUT", value = "/user/{username}", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> updateUser( @PathVariable("username") String username, - @RequestBody Mono body + @RequestBody Mono user ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 83b1c4518de..f9f724ee2d5 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -34,6 +33,7 @@ public class AdditionalPropertiesAnyType extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index e26bc092550..a33e9dba812 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -22,7 +22,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -35,6 +34,7 @@ public class AdditionalPropertiesArray extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5f3960d561d..c48df238f91 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -34,6 +33,7 @@ public class AdditionalPropertiesBoolean extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 169b7406f56..a70c6615754 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import jakarta.validation.constraints.NotNull; @@ -23,45 +26,34 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -82,6 +74,7 @@ public class AdditionalPropertiesClass { * @return mapString */ + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -108,6 +101,7 @@ public class AdditionalPropertiesClass { * @return mapNumber */ + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -134,6 +128,7 @@ public class AdditionalPropertiesClass { * @return mapInteger */ + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -160,6 +155,7 @@ public class AdditionalPropertiesClass { * @return mapBoolean */ + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -186,6 +182,7 @@ public class AdditionalPropertiesClass { * @return mapArrayInteger */ + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -212,6 +209,7 @@ public class AdditionalPropertiesClass { * @return mapArrayAnytype */ + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -238,6 +236,7 @@ public class AdditionalPropertiesClass { * @return mapMapString */ + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -264,6 +263,7 @@ public class AdditionalPropertiesClass { * @return mapMapAnytype */ + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -282,6 +282,7 @@ public class AdditionalPropertiesClass { * @return anytype1 */ + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -291,7 +292,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -300,11 +301,12 @@ public class AdditionalPropertiesClass { * @return anytype2 */ - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -318,6 +320,7 @@ public class AdditionalPropertiesClass { * @return anytype3 */ + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -344,13 +347,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 6c0650b76c5..8e2100e5ab1 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -34,6 +33,7 @@ public class AdditionalPropertiesInteger extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 2ad29c75e7d..fb86e5c04d4 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -22,7 +22,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -35,6 +34,7 @@ public class AdditionalPropertiesNumber extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index af2d1826f1c..b060bec7340 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -34,6 +33,7 @@ public class AdditionalPropertiesObject extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1cb12bed916..a25c047d621 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -34,6 +33,7 @@ public class AdditionalPropertiesString extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java index babc11283a2..4331b12f28c 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Animal.java @@ -7,9 +7,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import jakarta.validation.constraints.NotNull; @@ -36,10 +33,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -68,6 +63,7 @@ public class Animal { * @return className */ @NotNull + @JsonProperty("className") public String getClassName() { return className; } @@ -86,6 +82,7 @@ public class Animal { * @return color */ + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index b37936c2134..fce10900269 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -22,9 +22,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -44,6 +43,7 @@ public class ArrayOfArrayOfNumberOnly { * @return arrayArrayNumber */ + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index eb820544e7d..543e76c186e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -22,9 +22,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -44,6 +43,7 @@ public class ArrayOfNumberOnly { * @return arrayNumber */ + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 8caa5447995..c13565386f5 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -22,17 +22,14 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -52,6 +49,7 @@ public class ArrayTest { * @return arrayOfString */ + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -78,6 +76,7 @@ public class ArrayTest { * @return arrayArrayOfInteger */ + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -104,6 +103,7 @@ public class ArrayTest { * @return arrayArrayOfModel */ + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCat.java index d965e16521b..b13e3d40559 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCat.java @@ -64,7 +64,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -93,6 +92,7 @@ public class BigCat extends Cat { * @return kind */ + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java index 37e401dfd52..017c44034ae 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -61,7 +61,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -74,6 +73,7 @@ public class BigCatAllOf { * @return kind */ + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Capitalization.java index 2e4f6745fa5..7e51263a3e0 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Capitalization.java @@ -19,22 +19,16 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -47,6 +41,7 @@ public class Capitalization { * @return smallCamel */ + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -65,6 +60,7 @@ public class Capitalization { * @return capitalCamel */ + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -83,6 +79,7 @@ public class Capitalization { * @return smallSnake */ + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -101,6 +98,7 @@ public class Capitalization { * @return capitalSnake */ + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -119,6 +117,7 @@ public class Capitalization { * @return scAETHFlowPoints */ + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -137,6 +136,7 @@ public class Capitalization { * @return ATT_NAME */ + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Cat.java index 3e54e9eb258..86b03a61072 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Cat.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Cat.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import jakarta.validation.constraints.NotNull; @@ -33,7 +32,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -62,6 +60,7 @@ public class Cat extends Animal { * @return declawed */ + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/CatAllOf.java index c95d2391d81..2ea1a62e728 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/CatAllOf.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -34,6 +33,7 @@ public class CatAllOf { * @return declawed */ + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java index dcbbaf3e1e3..ad92aa2ac55 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Category.java @@ -19,10 +19,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -51,6 +49,7 @@ public class Category { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -69,6 +68,7 @@ public class Category { * @return name */ @NotNull + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ClassModel.java index b943a1fb706..6f77dbccad1 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ClassModel.java @@ -19,7 +19,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -32,6 +31,7 @@ public class ClassModel { * @return propertyClass */ + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Client.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Client.java index b4d2844d1a7..795dd87d179 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Client.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Client.java @@ -19,7 +19,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -32,6 +31,7 @@ public class Client { * @return client */ + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..00d8190f7d4 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,218 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + + private JsonNullable> nullableArray = JsonNullable.undefined(); + + + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + + private List requiredArray = new ArrayList<>(); + + + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Dog.java index c23c2b8c3d6..35620441ea9 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Dog.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Dog.java @@ -24,7 +24,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -53,6 +52,7 @@ public class Dog extends Animal { * @return breed */ + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/DogAllOf.java index 99edfab4008..e95125f5988 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/DogAllOf.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -34,6 +33,7 @@ public class DogAllOf { * @return breed */ + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java index 8440fe77122..5171f2ef55a 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -57,7 +57,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -95,9 +94,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -109,6 +107,7 @@ public class EnumArrays { * @return justSymbol */ + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,6 +134,7 @@ public class EnumArrays { * @return arrayEnum */ + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java index c3d6f8740be..029db62632d 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -60,7 +60,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -100,7 +99,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -138,7 +136,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -176,10 +173,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -208,6 +203,7 @@ public class EnumTest { * @return enumString */ + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -226,6 +222,7 @@ public class EnumTest { * @return enumStringRequired */ @NotNull + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -244,6 +241,7 @@ public class EnumTest { * @return enumInteger */ + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -262,6 +260,7 @@ public class EnumTest { * @return enumNumber */ + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -280,6 +279,7 @@ public class EnumTest { * @return outerEnum */ + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/File.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/File.java index 379835e7997..e26d5254d17 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/File.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/File.java @@ -19,7 +19,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -32,6 +31,7 @@ public class File { * @return sourceURI */ + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index b0d309b5765..9db7d300466 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -22,12 +22,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") - private List files = null; + private List files; public FileSchemaTestClass file(File file) { this.file = file; @@ -39,6 +37,7 @@ public class FileSchemaTestClass { * @return file */ + @JsonProperty("file") public File getFile() { return file; } @@ -65,6 +64,7 @@ public class FileSchemaTestClass { * @return files */ + @JsonProperty("files") public List getFiles() { return files; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java index ea6488d76b1..33e8057b49e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -27,48 +27,34 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -102,6 +88,7 @@ public class FormatTest { * @return integer */ + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -122,6 +109,7 @@ public class FormatTest { * @return int32 */ + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -140,6 +128,7 @@ public class FormatTest { * @return int64 */ + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -160,6 +149,7 @@ public class FormatTest { * @return number */ @NotNull + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -180,6 +170,7 @@ public class FormatTest { * @return _float */ + @JsonProperty("float") public Float getFloat() { return _float; } @@ -200,6 +191,7 @@ public class FormatTest { * @return _double */ + @JsonProperty("double") public Double getDouble() { return _double; } @@ -218,6 +210,7 @@ public class FormatTest { * @return string */ + @JsonProperty("string") public String getString() { return string; } @@ -236,6 +229,7 @@ public class FormatTest { * @return _byte */ @NotNull + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -254,6 +248,7 @@ public class FormatTest { * @return binary */ + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -272,6 +267,7 @@ public class FormatTest { * @return date */ @NotNull + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -290,6 +286,7 @@ public class FormatTest { * @return dateTime */ + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -308,6 +305,7 @@ public class FormatTest { * @return uuid */ + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -326,6 +324,7 @@ public class FormatTest { * @return password */ @NotNull + @JsonProperty("password") public String getPassword() { return password; } @@ -344,6 +343,7 @@ public class FormatTest { * @return bigDecimal */ + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 9d186aad54e..7fbc4d282cc 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -21,10 +21,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -37,6 +35,7 @@ public class HasOnlyReadOnly { * @return bar */ + @JsonProperty("bar") public String getBar() { return bar; } @@ -55,6 +54,7 @@ public class HasOnlyReadOnly { * @return foo */ + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java index f9c40fdd60e..db3d89f780a 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -22,9 +22,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -61,17 +60,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -91,6 +87,7 @@ public class MapTest { * @return mapMapOfString */ + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -117,6 +114,7 @@ public class MapTest { * @return mapOfEnumString */ + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -143,6 +141,7 @@ public class MapTest { * @return directMap */ + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -169,6 +168,7 @@ public class MapTest { * @return indirectMap */ + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1affd5d8362..8ff1a06c7eb 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -25,16 +25,13 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -46,6 +43,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid */ + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -64,6 +62,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return dateTime */ + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -90,6 +89,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return map */ + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Model200Response.java index 5fb76af8284..f88cd1000c9 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -21,10 +21,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -37,6 +35,7 @@ public class Model200Response { * @return name */ + @JsonProperty("name") public Integer getName() { return name; } @@ -55,6 +54,7 @@ public class Model200Response { * @return propertyClass */ + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index 2d95cc265e9..0de21a2fc4b 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -21,13 +21,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -40,6 +37,7 @@ public class ModelApiResponse { * @return code */ + @JsonProperty("code") public Integer getCode() { return code; } @@ -58,6 +56,7 @@ public class ModelApiResponse { * @return type */ + @JsonProperty("type") public String getType() { return type; } @@ -76,6 +75,7 @@ public class ModelApiResponse { * @return message */ + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelList.java index 959f91cdfd3..e7dc4ac59a3 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelList.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -34,6 +33,7 @@ public class ModelList { * @return _123list */ + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelReturn.java index 1dc48b70a7f..4fc7c0bf464 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -34,6 +33,7 @@ public class ModelReturn { * @return _return */ + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java index b67fffabe9f..3934b5a3c54 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Name.java @@ -19,16 +19,12 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -57,6 +53,7 @@ public class Name { * @return name */ @NotNull + @JsonProperty("name") public Integer getName() { return name; } @@ -75,6 +72,7 @@ public class Name { * @return snakeCase */ + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -93,6 +91,7 @@ public class Name { * @return property */ + @JsonProperty("property") public String getProperty() { return property; } @@ -111,6 +110,7 @@ public class Name { * @return _123number */ + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NumberOnly.java index a634326a1f8..15ead14ac72 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/NumberOnly.java @@ -20,7 +20,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -33,6 +32,7 @@ public class NumberOnly { * @return justNumber */ + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Order.java index 3eb6bc62e11..ef449034399 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Order.java @@ -22,16 +22,12 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -72,10 +68,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -88,6 +82,7 @@ public class Order { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -106,6 +101,7 @@ public class Order { * @return petId */ + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -124,6 +120,7 @@ public class Order { * @return quantity */ + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -142,6 +139,7 @@ public class Order { * @return shipDate */ + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -160,6 +158,7 @@ public class Order { * @return status */ + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -178,6 +177,7 @@ public class Order { * @return complete */ + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/OuterComposite.java index ddc31ebfb44..342a177ec6e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -20,13 +20,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -39,6 +36,7 @@ public class OuterComposite { * @return myNumber */ + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -57,6 +55,7 @@ public class OuterComposite { * @return myString */ + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -75,6 +74,7 @@ public class OuterComposite { * @return myBoolean */ + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java index 417eda278e2..91d62344c07 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") - private List tags = null; + private List tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -111,6 +105,7 @@ public class Pet { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -129,6 +124,7 @@ public class Pet { * @return category */ + @JsonProperty("category") public Category getCategory() { return category; } @@ -147,6 +143,7 @@ public class Pet { * @return name */ @NotNull + @JsonProperty("name") public String getName() { return name; } @@ -161,6 +158,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -170,6 +170,7 @@ public class Pet { * @return photoUrls */ @NotNull + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -197,6 +198,7 @@ public class Pet { * @return tags */ + @JsonProperty("tags") public List getTags() { return tags; } @@ -215,6 +217,7 @@ public class Pet { * @return status */ + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 9c1b537ab92..ab06c3aaa78 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -19,10 +19,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -35,6 +33,7 @@ public class ReadOnlyFirst { * @return bar */ + @JsonProperty("bar") public String getBar() { return bar; } @@ -53,6 +52,7 @@ public class ReadOnlyFirst { * @return baz */ + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..5d6f48d1f5f --- /dev/null +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,149 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index 90be05037e4..28d60b6af6b 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -17,11 +17,10 @@ import jakarta.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -34,6 +33,7 @@ public class SpecialModelName { * @return $specialPropertyName */ + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -50,8 +50,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Tag.java index f2fb6ae6006..d9e14881910 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Tag.java @@ -19,10 +19,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -35,6 +33,7 @@ public class Tag { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -53,6 +52,7 @@ public class Tag { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 8701e55eaa3..41daada064f 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -22,21 +22,16 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -68,6 +63,7 @@ public class TypeHolderDefault { * @return stringItem */ @NotNull + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -86,6 +82,7 @@ public class TypeHolderDefault { * @return numberItem */ @NotNull + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -104,6 +101,7 @@ public class TypeHolderDefault { * @return integerItem */ @NotNull + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -122,6 +120,7 @@ public class TypeHolderDefault { * @return boolItem */ @NotNull + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -136,6 +135,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -145,6 +147,7 @@ public class TypeHolderDefault { * @return arrayItem */ @NotNull + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 7b3eb0aec7f..1df30cf80c3 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -22,22 +22,16 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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<>(); @@ -72,6 +66,7 @@ public class TypeHolderExample { * @return stringItem */ @NotNull + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -90,6 +85,7 @@ public class TypeHolderExample { * @return numberItem */ @NotNull + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -108,6 +104,7 @@ public class TypeHolderExample { * @return floatItem */ @NotNull + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -126,6 +123,7 @@ public class TypeHolderExample { * @return integerItem */ @NotNull + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -144,6 +142,7 @@ public class TypeHolderExample { * @return boolItem */ @NotNull + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -158,6 +157,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -167,6 +169,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/User.java index 95d28312456..a1975bef3e6 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/User.java @@ -19,28 +19,20 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -53,6 +45,7 @@ public class User { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -71,6 +64,7 @@ public class User { * @return username */ + @JsonProperty("username") public String getUsername() { return username; } @@ -89,6 +83,7 @@ public class User { * @return firstName */ + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -107,6 +102,7 @@ public class User { * @return lastName */ + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -125,6 +121,7 @@ public class User { * @return email */ + @JsonProperty("email") public String getEmail() { return email; } @@ -143,6 +140,7 @@ public class User { * @return password */ + @JsonProperty("password") public String getPassword() { return password; } @@ -161,6 +159,7 @@ public class User { * @return phone */ + @JsonProperty("phone") public String getPhone() { return phone; } @@ -179,6 +178,7 @@ public class User { * @return userStatus */ + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java index e93ad13b463..cb4fc73bcb6 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -22,101 +22,72 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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; + private List wrappedArray; - @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; + private List nameArray; - @JsonProperty("name_wrapped_array") - private List nameWrappedArray = null; + private List nameWrappedArray; - @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; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -128,6 +99,7 @@ public class XmlItem { * @return attributeString */ + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -146,6 +118,7 @@ public class XmlItem { * @return attributeNumber */ + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -164,6 +137,7 @@ public class XmlItem { * @return attributeInteger */ + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -182,6 +156,7 @@ public class XmlItem { * @return attributeBoolean */ + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -208,6 +183,7 @@ public class XmlItem { * @return wrappedArray */ + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -226,6 +202,7 @@ public class XmlItem { * @return nameString */ + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -244,6 +221,7 @@ public class XmlItem { * @return nameNumber */ + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -262,6 +240,7 @@ public class XmlItem { * @return nameInteger */ + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -280,6 +259,7 @@ public class XmlItem { * @return nameBoolean */ + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -306,6 +286,7 @@ public class XmlItem { * @return nameArray */ + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -332,6 +313,7 @@ public class XmlItem { * @return nameWrappedArray */ + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -350,6 +332,7 @@ public class XmlItem { * @return prefixString */ + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -368,6 +351,7 @@ public class XmlItem { * @return prefixNumber */ + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -386,6 +370,7 @@ public class XmlItem { * @return prefixInteger */ + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -404,6 +389,7 @@ public class XmlItem { * @return prefixBoolean */ + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -430,6 +416,7 @@ public class XmlItem { * @return prefixArray */ + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -456,6 +443,7 @@ public class XmlItem { * @return prefixWrappedArray */ + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -474,6 +462,7 @@ public class XmlItem { * @return namespaceString */ + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -492,6 +481,7 @@ public class XmlItem { * @return namespaceNumber */ + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -510,6 +500,7 @@ public class XmlItem { * @return namespaceInteger */ + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -528,6 +519,7 @@ public class XmlItem { * @return namespaceBoolean */ + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -554,6 +546,7 @@ public class XmlItem { * @return namespaceArray */ + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -580,6 +573,7 @@ public class XmlItem { * @return namespaceWrappedArray */ + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -598,6 +592,7 @@ public class XmlItem { * @return prefixNsString */ + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -616,6 +611,7 @@ public class XmlItem { * @return prefixNsNumber */ + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -634,6 +630,7 @@ public class XmlItem { * @return prefixNsInteger */ + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -652,6 +649,7 @@ public class XmlItem { * @return prefixNsBoolean */ + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -678,6 +676,7 @@ public class XmlItem { * @return prefixNsArray */ + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -704,6 +703,7 @@ public class XmlItem { * @return prefixNsWrappedArray */ + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/client/petstore/spring-http-interface/.openapi-generator/FILES b/samples/client/petstore/spring-http-interface/.openapi-generator/FILES index 9c06c7689f4..12b7506e673 100644 --- a/samples/client/petstore/spring-http-interface/.openapi-generator/FILES +++ b/samples/client/petstore/spring-http-interface/.openapi-generator/FILES @@ -28,6 +28,7 @@ src/main/java/org/openapitools/model/CatDto.java src/main/java/org/openapitools/model/CategoryDto.java src/main/java/org/openapitools/model/ClassModelDto.java src/main/java/org/openapitools/model/ClientDto.java +src/main/java/org/openapitools/model/ContainerDefaultValueDto.java src/main/java/org/openapitools/model/DogAllOfDto.java src/main/java/org/openapitools/model/DogDto.java src/main/java/org/openapitools/model/EnumArraysDto.java @@ -48,6 +49,7 @@ src/main/java/org/openapitools/model/OuterCompositeDto.java src/main/java/org/openapitools/model/OuterEnumDto.java src/main/java/org/openapitools/model/PetDto.java src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java src/main/java/org/openapitools/model/ReturnDto.java src/main/java/org/openapitools/model/SpecialModelNameDto.java src/main/java/org/openapitools/model/TagDto.java diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java index 26f4d29907b..9220be9922f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -24,7 +24,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -34,7 +34,7 @@ public interface AnotherFakeApi { contentType = "application/json" ) ResponseEntity call123testSpecialTags( - @RequestBody ClientDto body + @RequestBody ClientDto clientDto ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java index c449390eb72..dd0b7038c74 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java @@ -33,7 +33,7 @@ public interface FakeApi { * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem * - * @param xmlItem XmlItem Body (required) + * @param xmlItemDto XmlItem Body (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -43,7 +43,7 @@ public interface FakeApi { contentType = "application/xml" ) ResponseEntity createXmlItem( - @RequestBody XmlItemDto xmlItem + @RequestBody XmlItemDto xmlItemDto ); @@ -58,7 +58,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/boolean", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity fakeOuterBooleanSerialize( @RequestBody(required = false) Boolean body @@ -69,17 +69,17 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerCompositeDto Input composite as post body (optional) * @return Output composite (status code 200) */ @HttpExchange( method = "POST", value = "/fake/outer/composite", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity fakeOuterCompositeSerialize( - @RequestBody(required = false) OuterCompositeDto body + @RequestBody(required = false) OuterCompositeDto outerCompositeDto ); @@ -94,7 +94,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/number", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity fakeOuterNumberSerialize( @RequestBody(required = false) BigDecimal body @@ -112,7 +112,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/string", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity fakeOuterStringSerialize( @RequestBody(required = false) String body @@ -123,7 +123,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClassDto (required) * @return Success (status code 200) */ @HttpExchange( @@ -133,7 +133,7 @@ public interface FakeApi { contentType = "application/json" ) ResponseEntity testBodyWithFileSchema( - @RequestBody FileSchemaTestClassDto body + @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto ); @@ -141,7 +141,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param userDto (required) * @return Success (status code 200) */ @HttpExchange( @@ -152,7 +152,7 @@ public interface FakeApi { ) ResponseEntity testBodyWithQueryParams( @RequestParam(value = "query", required = true) String query, - @RequestBody UserDto body + @RequestBody UserDto userDto ); @@ -160,7 +160,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -170,7 +170,7 @@ public interface FakeApi { contentType = "application/json" ) ResponseEntity testClientModel( - @RequestBody ClientDto body + @RequestBody ClientDto clientDto ); @@ -281,8 +281,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -292,12 +293,13 @@ public interface FakeApi { contentType = "application/json" ) ResponseEntity testInlineAdditionalProperties( - @RequestBody Map param + @RequestBody Map requestBody ); /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -320,7 +322,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -333,7 +334,6 @@ public interface FakeApi { ) ResponseEntity testQueryParameterCollectionFormat( @RequestParam(value = "pipe", required = true) List pipe, - @RequestParam(value = "ioutil", required = true) List ioutil, @RequestParam(value = "http", required = true) List http, @RequestParam(value = "url", required = true) List url, @RequestParam(value = "context", required = true) List context diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 68acb38fb96..10707ca7581 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -24,7 +24,7 @@ public interface FakeClassnameTags123Api { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -34,7 +34,7 @@ public interface FakeClassnameTags123Api { contentType = "application/json" ) ResponseEntity testClassname( - @RequestBody ClientDto body + @RequestBody ClientDto clientDto ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java index 8bba6d51f9d..696c8d4944b 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ApiResponseDto; import org.openapitools.model.PetDto; +import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto; import java.util.Set; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -24,8 +25,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -36,12 +38,13 @@ public interface PetApi { contentType = "application/json" ) ResponseEntity addPet( - @RequestBody PetDto body + @RequestBody PetDto petDto ); /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -117,9 +120,26 @@ public interface PetApi { /** - * PUT /pet : Update an existing pet + * GET /fake/{petId}/response-object-different-names * - * @param body Pet object that needs to be added to the store (required) + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/fake/{petId}/response-object-different-names", + accept = "application/json" + ) + ResponseEntity responseObjectDifferentNames( + @PathVariable("petId") Long petId + ); + + + /** + * PUT /pet : Update an existing pet + * + * + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -132,12 +152,13 @@ public interface PetApi { contentType = "application/json" ) ResponseEntity updatePet( - @RequestBody PetDto body + @RequestBody PetDto petDto ); /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -159,6 +180,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -180,6 +202,7 @@ public interface PetApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java index 5cd54cbf360..39d8f96ab1d 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java @@ -76,8 +76,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param orderDto order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -85,10 +86,10 @@ public interface StoreApi { method = "POST", value = "/store/order", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity placeOrder( - @RequestBody OrderDto body + @RequestBody OrderDto orderDto ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java index 4c82804fb6a..08b68d8177b 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java @@ -26,51 +26,53 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param userDto Created user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity createUser( - @RequestBody UserDto body + @RequestBody UserDto userDto ); /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param userDto List of user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user/createWithArray", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity createUsersWithArrayInput( - @RequestBody List body + @RequestBody List userDto ); /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param userDto List of user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user/createWithList", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity createUsersWithListInput( - @RequestBody List body + @RequestBody List userDto ); @@ -94,6 +96,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -112,6 +115,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -131,6 +135,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -149,7 +154,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param userDto Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -157,11 +162,11 @@ public interface UserApi { method = "PUT", value = "/user/{username}", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity updateUser( @PathVariable("username") String username, - @RequestBody UserDto body + @RequestBody UserDto userDto ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index 866c0c9d89b..966547c80da 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -23,7 +23,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyTypeDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyTypeDto name(String name) { @@ -36,6 +35,7 @@ public class AdditionalPropertiesAnyTypeDto extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index 67d06814cb3..41bf9effe53 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -24,7 +24,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArrayDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArrayDto name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesArrayDto extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index 53d996e4e84..8335c2ba832 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -23,7 +23,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBooleanDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBooleanDto name(String name) { @@ -36,6 +35,7 @@ public class AdditionalPropertiesBooleanDto extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 6dc80fc64c5..7267a4621a5 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -6,10 +6,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import jakarta.validation.constraints.NotNull; @@ -25,45 +28,34 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClassDto { - @JsonProperty("map_string") - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClassDto mapString(Map mapString) { @@ -84,6 +76,7 @@ public class AdditionalPropertiesClassDto { * @return mapString */ + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -110,6 +103,7 @@ public class AdditionalPropertiesClassDto { * @return mapNumber */ + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -136,6 +130,7 @@ public class AdditionalPropertiesClassDto { * @return mapInteger */ + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -162,6 +157,7 @@ public class AdditionalPropertiesClassDto { * @return mapBoolean */ + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -188,6 +184,7 @@ public class AdditionalPropertiesClassDto { * @return mapArrayInteger */ + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -214,6 +211,7 @@ public class AdditionalPropertiesClassDto { * @return mapArrayAnytype */ + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -240,6 +238,7 @@ public class AdditionalPropertiesClassDto { * @return mapMapString */ + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -266,6 +265,7 @@ public class AdditionalPropertiesClassDto { * @return mapMapAnytype */ + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -284,6 +284,7 @@ public class AdditionalPropertiesClassDto { * @return anytype1 */ + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -293,7 +294,7 @@ public class AdditionalPropertiesClassDto { } public AdditionalPropertiesClassDto anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -302,11 +303,12 @@ public class AdditionalPropertiesClassDto { * @return anytype2 */ - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -320,6 +322,7 @@ public class AdditionalPropertiesClassDto { * @return anytype3 */ + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -346,13 +349,24 @@ public class AdditionalPropertiesClassDto { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index a1bdab5d351..a7b0f41e864 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -23,7 +23,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesIntegerDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesIntegerDto name(String name) { @@ -36,6 +35,7 @@ public class AdditionalPropertiesIntegerDto extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index 2d449dc7771..955cd7c3aac 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -24,7 +24,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumberDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumberDto name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesNumberDto extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index 9ac0fac53cf..eac3c186356 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -23,7 +23,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObjectDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObjectDto name(String name) { @@ -36,6 +35,7 @@ public class AdditionalPropertiesObjectDto extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index 3752cc2f31c..fd8f19f618e 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -23,7 +23,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesStringDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesStringDto name(String name) { @@ -36,6 +35,7 @@ public class AdditionalPropertiesStringDto extends HashMap { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java index 98943e769c2..82a53627c68 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java @@ -8,9 +8,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.model.BigCatDto; -import org.openapitools.model.CatDto; -import org.openapitools.model.DogDto; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import jakarta.validation.constraints.NotNull; @@ -37,28 +34,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AnimalDto { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; - /** - * Default constructor - * @deprecated Use {@link AnimalDto#AnimalDto(String)} - */ - @Deprecated - public AnimalDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public AnimalDto(String className) { - this.className = className; - } - public AnimalDto className(String className) { this.className = className; return this; @@ -69,6 +48,7 @@ public class AnimalDto { * @return className */ @NotNull + @JsonProperty("className") public String getClassName() { return className; } @@ -87,6 +67,7 @@ public class AnimalDto { * @return color */ + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ApiResponseDto.java index 5bb9b181174..42c035a52e0 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -21,13 +21,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ApiResponseDto { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ApiResponseDto code(Integer code) { @@ -40,6 +37,7 @@ public class ApiResponseDto { * @return code */ + @JsonProperty("code") public Integer getCode() { return code; } @@ -58,6 +56,7 @@ public class ApiResponseDto { * @return type */ + @JsonProperty("type") public String getType() { return type; } @@ -76,6 +75,7 @@ public class ApiResponseDto { * @return message */ + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 0e954981dc9..da1319e9448 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -24,9 +24,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnlyDto { - @JsonProperty("ArrayArrayNumber") - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -46,6 +45,7 @@ public class ArrayOfArrayOfNumberOnlyDto { * @return arrayArrayNumber */ + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 26e8636a6a7..7c60e613a26 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -24,9 +24,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnlyDto { - @JsonProperty("ArrayNumber") - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -46,6 +45,7 @@ public class ArrayOfNumberOnlyDto { * @return arrayNumber */ + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java index ab8e5b17537..202e9497ccd 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -24,17 +24,14 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTestDto { - @JsonProperty("array_of_string") - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTestDto arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -54,6 +51,7 @@ public class ArrayTestDto { * @return arrayOfString */ + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -80,6 +78,7 @@ public class ArrayTestDto { * @return arrayArrayOfInteger */ + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -106,6 +105,7 @@ public class ArrayTestDto { * @return arrayArrayOfModel */ + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatAllOfDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatAllOfDto.java index 46a31a13a9c..34759c89187 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatAllOfDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatAllOfDto.java @@ -61,7 +61,6 @@ public class BigCatAllOfDto { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOfDto kind(KindEnum kind) { @@ -74,6 +73,7 @@ public class BigCatAllOfDto { * @return kind */ + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatDto.java index 6608ecfa7a4..b30873ccfde 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatDto.java @@ -66,25 +66,8 @@ public class BigCatDto extends CatDto { } } - @JsonProperty("kind") private KindEnum kind; - /** - * Default constructor - * @deprecated Use {@link BigCatDto#BigCatDto(String)} - */ - @Deprecated - public BigCatDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public BigCatDto(String className) { - super(className); - } - public BigCatDto kind(KindEnum kind) { this.kind = kind; return this; @@ -95,6 +78,7 @@ public class BigCatDto extends CatDto { * @return kind */ + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CapitalizationDto.java index 3f041a318d2..05c0616d28e 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -21,22 +21,16 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CapitalizationDto { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public CapitalizationDto smallCamel(String smallCamel) { @@ -49,6 +43,7 @@ public class CapitalizationDto { * @return smallCamel */ + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -67,6 +62,7 @@ public class CapitalizationDto { * @return capitalCamel */ + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -85,6 +81,7 @@ public class CapitalizationDto { * @return smallSnake */ + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -103,6 +100,7 @@ public class CapitalizationDto { * @return capitalSnake */ + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -121,6 +119,7 @@ public class CapitalizationDto { * @return scAETHFlowPoints */ + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -139,6 +138,7 @@ public class CapitalizationDto { * @return ATT_NAME */ + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatAllOfDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatAllOfDto.java index 9e6af0303ba..4a89e033886 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatAllOfDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatAllOfDto.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOfDto { - @JsonProperty("declawed") private Boolean declawed; public CatAllOfDto declawed(Boolean declawed) { @@ -34,6 +33,7 @@ public class CatAllOfDto { * @return declawed */ + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatDto.java index c350847bb89..b1866e10bcc 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatDto.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.model.AnimalDto; -import org.openapitools.model.BigCatDto; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import jakarta.validation.constraints.NotNull; @@ -34,25 +33,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatDto extends AnimalDto { - @JsonProperty("declawed") private Boolean declawed; - /** - * Default constructor - * @deprecated Use {@link CatDto#CatDto(String)} - */ - @Deprecated - public CatDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public CatDto(String className) { - super(className); - } - public CatDto declawed(Boolean declawed) { this.declawed = declawed; return this; @@ -63,6 +45,7 @@ public class CatDto extends AnimalDto { * @return declawed */ + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java index 5936031e79c..86a70d003fe 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java @@ -21,28 +21,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CategoryDto { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; - /** - * Default constructor - * @deprecated Use {@link CategoryDto#CategoryDto(String)} - */ - @Deprecated - public CategoryDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public CategoryDto(String name) { - this.name = name; - } - public CategoryDto id(Long id) { this.id = id; return this; @@ -53,6 +35,7 @@ public class CategoryDto { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -71,6 +54,7 @@ public class CategoryDto { * @return name */ @NotNull + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClassModelDto.java index 8a4fc71e614..e32c199f912 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClassModelDto.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModelDto { - @JsonProperty("_class") private String propertyClass; public ClassModelDto propertyClass(String propertyClass) { @@ -34,6 +33,7 @@ public class ClassModelDto { * @return propertyClass */ + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClientDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClientDto.java index 9185bd7de97..807f0684770 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ClientDto.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClientDto { - @JsonProperty("client") private String client; public ClientDto client(String client) { @@ -34,6 +33,7 @@ public class ClientDto { * @return client */ + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java new file mode 100644 index 00000000000..8e89bf7bcd4 --- /dev/null +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -0,0 +1,203 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ContainerDefaultValueDto + */ + +@JsonTypeName("ContainerDefaultValue") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValueDto { + + + private JsonNullable> nullableArray = JsonNullable.undefined(); + + + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + + private List requiredArray = new ArrayList<>(); + + + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + public ContainerDefaultValueDto nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValueDto nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValueDto requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValueDto addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValueDto nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValueDto containerDefaultValue = (ContainerDefaultValueDto) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValueDto {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogAllOfDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogAllOfDto.java index 13ca9db43a5..59e98fa8c70 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogAllOfDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogAllOfDto.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOfDto { - @JsonProperty("breed") private String breed; public DogAllOfDto breed(String breed) { @@ -34,6 +33,7 @@ public class DogAllOfDto { * @return breed */ + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java index 19f8d6d95c6..878670e1812 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java @@ -26,25 +26,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogDto extends AnimalDto { - @JsonProperty("breed") private String breed; - /** - * Default constructor - * @deprecated Use {@link DogDto#DogDto(String)} - */ - @Deprecated - public DogDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public DogDto(String className) { - super(className); - } - public DogDto breed(String breed) { this.breed = breed; return this; @@ -55,6 +38,7 @@ public class DogDto extends AnimalDto { * @return breed */ + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java index b01e1a1b904..1c1c01d8f68 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -59,7 +59,6 @@ public class EnumArraysDto { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -97,9 +96,8 @@ public class EnumArraysDto { } } - @JsonProperty("array_enum") - private List arrayEnum = null; + private List arrayEnum; public EnumArraysDto justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -111,6 +109,7 @@ public class EnumArraysDto { * @return justSymbol */ + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -137,6 +136,7 @@ public class EnumArraysDto { * @return arrayEnum */ + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java index f825319a573..2153d6b4cc9 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java @@ -60,7 +60,6 @@ public class EnumTestDto { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -100,7 +99,6 @@ public class EnumTestDto { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -138,7 +136,6 @@ public class EnumTestDto { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -176,28 +173,10 @@ public class EnumTestDto { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnumDto outerEnum; - /** - * Default constructor - * @deprecated Use {@link EnumTestDto#EnumTestDto(EnumStringRequiredEnum)} - */ - @Deprecated - public EnumTestDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EnumTestDto(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - public EnumTestDto enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; @@ -208,6 +187,7 @@ public class EnumTestDto { * @return enumString */ + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -226,6 +206,7 @@ public class EnumTestDto { * @return enumStringRequired */ @NotNull + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -244,6 +225,7 @@ public class EnumTestDto { * @return enumInteger */ + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -262,6 +244,7 @@ public class EnumTestDto { * @return enumNumber */ + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -280,6 +263,7 @@ public class EnumTestDto { * @return outerEnum */ + @JsonProperty("outerEnum") public OuterEnumDto getOuterEnum() { return outerEnum; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileDto.java index c2a46710955..de6980c4ae2 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileDto.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileDto { - @JsonProperty("sourceURI") private String sourceURI; public FileDto sourceURI(String sourceURI) { @@ -34,6 +33,7 @@ public class FileDto { * @return sourceURI */ + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index 916fb159a1c..dfd2796c531 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -24,12 +24,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClassDto { - @JsonProperty("file") private FileDto file; - @JsonProperty("files") - private List files = null; + private List files; public FileSchemaTestClassDto file(FileDto file) { this.file = file; @@ -41,6 +39,7 @@ public class FileSchemaTestClassDto { * @return file */ + @JsonProperty("file") public FileDto getFile() { return file; } @@ -67,6 +66,7 @@ public class FileSchemaTestClassDto { * @return files */ + @JsonProperty("files") public List getFiles() { return files; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java index 77f950cdef4..68f17b1f1f2 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java @@ -27,69 +27,36 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTestDto { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; - /** - * Default constructor - * @deprecated Use {@link FormatTestDto#FormatTestDto(BigDecimal, byte[], LocalDate, String)} - */ - @Deprecated - public FormatTestDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FormatTestDto(BigDecimal number, byte[] _byte, LocalDate date, String password) { - this.number = number; - this._byte = _byte; - this.date = date; - this.password = password; - } - public FormatTestDto integer(Integer integer) { this.integer = integer; return this; @@ -102,6 +69,7 @@ public class FormatTestDto { * @return integer */ + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -122,6 +90,7 @@ public class FormatTestDto { * @return int32 */ + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -140,6 +109,7 @@ public class FormatTestDto { * @return int64 */ + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -160,6 +130,7 @@ public class FormatTestDto { * @return number */ @NotNull + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -180,6 +151,7 @@ public class FormatTestDto { * @return _float */ + @JsonProperty("float") public Float getFloat() { return _float; } @@ -200,6 +172,7 @@ public class FormatTestDto { * @return _double */ + @JsonProperty("double") public Double getDouble() { return _double; } @@ -218,6 +191,7 @@ public class FormatTestDto { * @return string */ + @JsonProperty("string") public String getString() { return string; } @@ -236,6 +210,7 @@ public class FormatTestDto { * @return _byte */ @NotNull + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -254,6 +229,7 @@ public class FormatTestDto { * @return binary */ + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -272,6 +248,7 @@ public class FormatTestDto { * @return date */ @NotNull + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -290,6 +267,7 @@ public class FormatTestDto { * @return dateTime */ + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -308,6 +286,7 @@ public class FormatTestDto { * @return uuid */ + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -326,6 +305,7 @@ public class FormatTestDto { * @return password */ @NotNull + @JsonProperty("password") public String getPassword() { return password; } @@ -344,6 +324,7 @@ public class FormatTestDto { * @return bigDecimal */ + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index 3c361299744..1c311a43247 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -21,10 +21,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnlyDto { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnlyDto bar(String bar) { @@ -37,6 +35,7 @@ public class HasOnlyReadOnlyDto { * @return bar */ + @JsonProperty("bar") public String getBar() { return bar; } @@ -55,6 +54,7 @@ public class HasOnlyReadOnlyDto { * @return foo */ + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ListDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ListDto.java index 733fa698453..2c7f5040a16 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ListDto.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ListDto { - @JsonProperty("123-list") private String _123list; public ListDto _123list(String _123list) { @@ -34,6 +33,7 @@ public class ListDto { * @return _123list */ + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java index ea2eed82d1d..e74eafef2e9 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java @@ -24,9 +24,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTestDto { - @JsonProperty("map_map_of_string") - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -63,17 +62,14 @@ public class MapTestDto { } } - @JsonProperty("map_of_enum_string") - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTestDto mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -93,6 +89,7 @@ public class MapTestDto { * @return mapMapOfString */ + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,6 +116,7 @@ public class MapTestDto { * @return mapOfEnumString */ + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -145,6 +143,7 @@ public class MapTestDto { * @return directMap */ + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -171,6 +170,7 @@ public class MapTestDto { * @return indirectMap */ + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index 8622ea861da..499c5540a5f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -27,16 +27,13 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClassDto { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClassDto uuid(UUID uuid) { this.uuid = uuid; @@ -48,6 +45,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { * @return uuid */ + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -66,6 +64,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { * @return dateTime */ + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -92,6 +91,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { * @return map */ + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/Model200ResponseDto.java index f2e1a7ae060..0c0c986a0f9 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -21,10 +21,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200ResponseDto { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200ResponseDto name(Integer name) { @@ -37,6 +35,7 @@ public class Model200ResponseDto { * @return name */ + @JsonProperty("name") public Integer getName() { return name; } @@ -55,6 +54,7 @@ public class Model200ResponseDto { * @return propertyClass */ + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java index ba75b859251..e8a5563cabb 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java @@ -21,34 +21,14 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NameDto { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; - /** - * Default constructor - * @deprecated Use {@link NameDto#NameDto(Integer)} - */ - @Deprecated - public NameDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public NameDto(Integer name) { - this.name = name; - } - public NameDto name(Integer name) { this.name = name; return this; @@ -59,6 +39,7 @@ public class NameDto { * @return name */ @NotNull + @JsonProperty("name") public Integer getName() { return name; } @@ -77,6 +58,7 @@ public class NameDto { * @return snakeCase */ + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -95,6 +77,7 @@ public class NameDto { * @return property */ + @JsonProperty("property") public String getProperty() { return property; } @@ -113,6 +96,7 @@ public class NameDto { * @return _123number */ + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NumberOnlyDto.java index e449f9cf036..36659acdd2d 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -22,7 +22,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnlyDto { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnlyDto justNumber(BigDecimal justNumber) { @@ -35,6 +34,7 @@ public class NumberOnlyDto { * @return justNumber */ + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OrderDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OrderDto.java index 57896816729..83aaefccc2a 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OrderDto.java @@ -24,16 +24,12 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OrderDto { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -74,10 +70,8 @@ public class OrderDto { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public OrderDto id(Long id) { @@ -90,6 +84,7 @@ public class OrderDto { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -108,6 +103,7 @@ public class OrderDto { * @return petId */ + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -126,6 +122,7 @@ public class OrderDto { * @return quantity */ + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -144,6 +141,7 @@ public class OrderDto { * @return shipDate */ + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -162,6 +160,7 @@ public class OrderDto { * @return status */ + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -180,6 +179,7 @@ public class OrderDto { * @return complete */ + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OuterCompositeDto.java index 19cdb62012c..aa8b26075f8 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -22,13 +22,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterCompositeDto { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterCompositeDto myNumber(BigDecimal myNumber) { @@ -41,6 +38,7 @@ public class OuterCompositeDto { * @return myNumber */ + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -59,6 +57,7 @@ public class OuterCompositeDto { * @return myString */ + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -77,6 +76,7 @@ public class OuterCompositeDto { * @return myBoolean */ + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java index 95ec99c34d5..a4a33e8e3b9 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java @@ -29,22 +29,17 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class PetDto { - @JsonProperty("id") private Long id; - @JsonProperty("category") private CategoryDto category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") - private List tags = null; + private List tags; /** * pet status in the store @@ -83,26 +78,8 @@ public class PetDto { } } - @JsonProperty("status") private StatusEnum status; - /** - * Default constructor - * @deprecated Use {@link PetDto#PetDto(String, Set)} - */ - @Deprecated - public PetDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public PetDto(String name, Set photoUrls) { - this.name = name; - this.photoUrls = photoUrls; - } - public PetDto id(Long id) { this.id = id; return this; @@ -113,6 +90,7 @@ public class PetDto { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +109,7 @@ public class PetDto { * @return category */ + @JsonProperty("category") public CategoryDto getCategory() { return category; } @@ -149,6 +128,7 @@ public class PetDto { * @return name */ @NotNull + @JsonProperty("name") public String getName() { return name; } @@ -163,6 +143,9 @@ public class PetDto { } public PetDto addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -172,6 +155,7 @@ public class PetDto { * @return photoUrls */ @NotNull + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -199,6 +183,7 @@ public class PetDto { * @return tags */ + @JsonProperty("tags") public List getTags() { return tags; } @@ -217,6 +202,7 @@ public class PetDto { * @return status */ + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index 7ab8278a698..a7557dfd7aa 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -21,10 +21,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirstDto { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirstDto bar(String bar) { @@ -37,6 +35,7 @@ public class ReadOnlyFirstDto { * @return bar */ + @JsonProperty("bar") public String getBar() { return bar; } @@ -55,6 +54,7 @@ public class ReadOnlyFirstDto { * @return baz */ + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java new file mode 100644 index 00000000000..550a49f8bf1 --- /dev/null +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java @@ -0,0 +1,151 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNamesDto + */ + +@JsonTypeName("ResponseObjectWithDifferentFieldNames") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNamesDto { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNamesDto UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNamesDto lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNamesDto propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNamesDto responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNamesDto) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNamesDto {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReturnDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReturnDto.java index 99bdea143ef..8fcbd415e28 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ReturnDto.java @@ -21,7 +21,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReturnDto { - @JsonProperty("return") private Integer _return; public ReturnDto _return(Integer _return) { @@ -34,6 +33,7 @@ public class ReturnDto { * @return _return */ + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 6afd2e37646..009a9f9e423 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -17,11 +17,10 @@ import jakarta.annotation.Generated; * SpecialModelNameDto */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelNameDto { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelNameDto $specialPropertyName(Long $specialPropertyName) { @@ -34,6 +33,7 @@ public class SpecialModelNameDto { * @return $specialPropertyName */ + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -50,8 +50,8 @@ public class SpecialModelNameDto { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelNameDto $specialModelName = (SpecialModelNameDto) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelNameDto specialModelName = (SpecialModelNameDto) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TagDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TagDto.java index f3381428ec1..b9c8195bfa6 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TagDto.java @@ -21,10 +21,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TagDto { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public TagDto id(Long id) { @@ -37,6 +35,7 @@ public class TagDto { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -55,6 +54,7 @@ public class TagDto { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 70b2a2cebac..2b6d79d2e11 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -24,41 +24,16 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefaultDto { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderDefaultDto#TypeHolderDefaultDto(String, BigDecimal, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderDefaultDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderDefaultDto(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto stringItem(String stringItem) { this.stringItem = stringItem; @@ -70,6 +45,7 @@ public class TypeHolderDefaultDto { * @return stringItem */ @NotNull + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -88,6 +64,7 @@ public class TypeHolderDefaultDto { * @return numberItem */ @NotNull + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -106,6 +83,7 @@ public class TypeHolderDefaultDto { * @return integerItem */ @NotNull + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -124,6 +102,7 @@ public class TypeHolderDefaultDto { * @return boolItem */ @NotNull + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -138,6 +117,9 @@ public class TypeHolderDefaultDto { } public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -147,6 +129,7 @@ public class TypeHolderDefaultDto { * @return arrayItem */ @NotNull + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 31e61fbd0e6..85c6a38798f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -24,46 +24,19 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExampleDto { - @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<>(); - /** - * Default constructor - * @deprecated Use {@link TypeHolderExampleDto#TypeHolderExampleDto(String, BigDecimal, Float, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderExampleDto() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderExampleDto(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.floatItem = floatItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - public TypeHolderExampleDto stringItem(String stringItem) { this.stringItem = stringItem; return this; @@ -74,6 +47,7 @@ public class TypeHolderExampleDto { * @return stringItem */ @NotNull + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -92,6 +66,7 @@ public class TypeHolderExampleDto { * @return numberItem */ @NotNull + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +85,7 @@ public class TypeHolderExampleDto { * @return floatItem */ @NotNull + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -128,6 +104,7 @@ public class TypeHolderExampleDto { * @return integerItem */ @NotNull + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -146,6 +123,7 @@ public class TypeHolderExampleDto { * @return boolItem */ @NotNull + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -160,6 +138,9 @@ public class TypeHolderExampleDto { } public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -169,6 +150,7 @@ public class TypeHolderExampleDto { * @return arrayItem */ @NotNull + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/UserDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/UserDto.java index 01b2b3abce9..3cec69778ea 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/UserDto.java @@ -21,28 +21,20 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class UserDto { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public UserDto id(Long id) { @@ -55,6 +47,7 @@ public class UserDto { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -73,6 +66,7 @@ public class UserDto { * @return username */ + @JsonProperty("username") public String getUsername() { return username; } @@ -91,6 +85,7 @@ public class UserDto { * @return firstName */ + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -109,6 +104,7 @@ public class UserDto { * @return lastName */ + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -127,6 +123,7 @@ public class UserDto { * @return email */ + @JsonProperty("email") public String getEmail() { return email; } @@ -145,6 +142,7 @@ public class UserDto { * @return password */ + @JsonProperty("password") public String getPassword() { return password; } @@ -163,6 +161,7 @@ public class UserDto { * @return phone */ + @JsonProperty("phone") public String getPhone() { return phone; } @@ -181,6 +180,7 @@ public class UserDto { * @return userStatus */ + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java index d88463882e3..fccde590190 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java @@ -24,101 +24,72 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItemDto { - @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; + private List wrappedArray; - @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; + private List nameArray; - @JsonProperty("name_wrapped_array") - private List nameWrappedArray = null; + private List nameWrappedArray; - @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; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItemDto attributeString(String attributeString) { this.attributeString = attributeString; @@ -130,6 +101,7 @@ public class XmlItemDto { * @return attributeString */ + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -148,6 +120,7 @@ public class XmlItemDto { * @return attributeNumber */ + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -166,6 +139,7 @@ public class XmlItemDto { * @return attributeInteger */ + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -184,6 +158,7 @@ public class XmlItemDto { * @return attributeBoolean */ + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -210,6 +185,7 @@ public class XmlItemDto { * @return wrappedArray */ + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -228,6 +204,7 @@ public class XmlItemDto { * @return nameString */ + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -246,6 +223,7 @@ public class XmlItemDto { * @return nameNumber */ + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -264,6 +242,7 @@ public class XmlItemDto { * @return nameInteger */ + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -282,6 +261,7 @@ public class XmlItemDto { * @return nameBoolean */ + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -308,6 +288,7 @@ public class XmlItemDto { * @return nameArray */ + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -334,6 +315,7 @@ public class XmlItemDto { * @return nameWrappedArray */ + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -352,6 +334,7 @@ public class XmlItemDto { * @return prefixString */ + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -370,6 +353,7 @@ public class XmlItemDto { * @return prefixNumber */ + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -388,6 +372,7 @@ public class XmlItemDto { * @return prefixInteger */ + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -406,6 +391,7 @@ public class XmlItemDto { * @return prefixBoolean */ + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -432,6 +418,7 @@ public class XmlItemDto { * @return prefixArray */ + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -458,6 +445,7 @@ public class XmlItemDto { * @return prefixWrappedArray */ + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -476,6 +464,7 @@ public class XmlItemDto { * @return namespaceString */ + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -494,6 +483,7 @@ public class XmlItemDto { * @return namespaceNumber */ + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -512,6 +502,7 @@ public class XmlItemDto { * @return namespaceInteger */ + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -530,6 +521,7 @@ public class XmlItemDto { * @return namespaceBoolean */ + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -556,6 +548,7 @@ public class XmlItemDto { * @return namespaceArray */ + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -582,6 +575,7 @@ public class XmlItemDto { * @return namespaceWrappedArray */ + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -600,6 +594,7 @@ public class XmlItemDto { * @return prefixNsString */ + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -618,6 +613,7 @@ public class XmlItemDto { * @return prefixNsNumber */ + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -636,6 +632,7 @@ public class XmlItemDto { * @return prefixNsInteger */ + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -654,6 +651,7 @@ public class XmlItemDto { * @return prefixNsBoolean */ + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -680,6 +678,7 @@ public class XmlItemDto { * @return prefixNsArray */ + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -706,6 +705,7 @@ public class XmlItemDto { * @return prefixNsWrappedArray */ + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } 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 0e831f5b799..d41b6f67273 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 @@ -99,6 +99,7 @@ public interface PetApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -152,6 +153,7 @@ public interface PetApi { }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -207,6 +209,7 @@ public interface PetApi { }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -258,6 +261,7 @@ public interface PetApi { }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -296,6 +300,7 @@ public interface PetApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -334,6 +339,7 @@ public interface PetApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -383,6 +389,7 @@ public interface PetApi { }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } } 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 0df17105907..2c8321118e9 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 @@ -60,6 +60,7 @@ public interface StoreApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -93,6 +94,7 @@ public interface StoreApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -141,6 +143,7 @@ public interface StoreApi { }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -186,6 +189,7 @@ public interface StoreApi { }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } } 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 32f54a60f05..7c5e816ce78 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 @@ -59,6 +59,7 @@ public interface UserApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -86,6 +87,7 @@ public interface UserApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -113,6 +115,7 @@ public interface UserApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -143,6 +146,7 @@ public interface UserApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -190,6 +194,7 @@ public interface UserApi { }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -223,6 +228,7 @@ public interface UserApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -249,6 +255,7 @@ public interface UserApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } @@ -281,6 +288,7 @@ public interface UserApi { ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } } diff --git a/samples/client/petstore/swift5/anycodable/.gitignore b/samples/client/petstore/swift5/anycodable/.gitignore new file mode 100644 index 00000000000..316a84507fb --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/.gitignore @@ -0,0 +1,100 @@ +# Created by https://www.toptal.com/developers/gitignore/api/xcode,swift +# Edit at https://www.toptal.com/developers/gitignore?templates=xcode,swift + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### Xcode ### + +## Xcode 8 and earlier + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.toptal.com/developers/gitignore/api/xcode,swift diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore b/samples/client/petstore/swift5/anycodable/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.openapi-generator-ignore rename to samples/client/petstore/swift5/anycodable/.openapi-generator-ignore diff --git a/samples/client/petstore/swift5/anycodable/.openapi-generator/FILES b/samples/client/petstore/swift5/anycodable/.openapi-generator/FILES new file mode 100644 index 00000000000..916770788c3 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/.openapi-generator/FILES @@ -0,0 +1,24 @@ +.gitignore +.swiftformat +Cartfile +Package.swift +PetstoreClient.podspec +PetstoreClient/Classes/OpenAPIs/APIHelper.swift +PetstoreClient/Classes/OpenAPIs/APIs.swift +PetstoreClient/Classes/OpenAPIs/APIs/PetsAPI.swift +PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +PetstoreClient/Classes/OpenAPIs/Configuration.swift +PetstoreClient/Classes/OpenAPIs/Extensions.swift +PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +PetstoreClient/Classes/OpenAPIs/Models.swift +PetstoreClient/Classes/OpenAPIs/Models/PrefixPetSuffix.swift +PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift +PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift +PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +PetstoreClient/Classes/OpenAPIs/Validation.swift +README.md +docs/PetsAPI.md +docs/PrefixPetSuffix.md +git_push.sh +project.yml diff --git a/samples/client/petstore/swift5/anycodable/.openapi-generator/VERSION b/samples/client/petstore/swift5/anycodable/.openapi-generator/VERSION new file mode 100644 index 00000000000..757e6740040 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/anycodable/.swiftformat b/samples/client/petstore/swift5/anycodable/.swiftformat new file mode 100644 index 00000000000..93007252801 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/.swiftformat @@ -0,0 +1,45 @@ +# This file is auto-generated by OpenAPI Generator: https://openapi-generator.tech/ +# +# For rules on SwiftFormat, please refer to https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md +# +# file options + +# uncomment below to exclude files, folders +#--exclude path/to/test1.swift,Snapshots,Build + +# format options + +--allman false +--binarygrouping 4,8 +--commas always +--comments indent +--decimalgrouping 3,6 +--elseposition same-line +--empty void +--exponentcase lowercase +--exponentgrouping disabled +--fractiongrouping disabled +--header ignore +--hexgrouping 4,8 +--hexliteralcase uppercase +--ifdef indent +--indent 4 +--indentcase false +--importgrouping testable-bottom +--linebreaks lf +--maxwidth none +--octalgrouping 4,8 +--operatorfunc spaced +--patternlet hoist +--ranges spaced +--self remove +--semicolons inline +--stripunusedargs always +--swiftversion 5.4 +--trimwhitespace always +--wraparguments preserve +--wrapcollections preserve + +# rules + +--enable isEmpty diff --git a/samples/client/petstore/swift5/anycodable/Cartfile b/samples/client/petstore/swift5/anycodable/Cartfile new file mode 100644 index 00000000000..92bac174543 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/Cartfile @@ -0,0 +1 @@ +github "Flight-School/AnyCodable" ~> 0.6 diff --git a/samples/client/petstore/swift5/anycodable/OpenAPIClient.podspec b/samples/client/petstore/swift5/anycodable/OpenAPIClient.podspec new file mode 100644 index 00000000000..57d5e06e6e6 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/OpenAPIClient.podspec @@ -0,0 +1,15 @@ +Pod::Spec.new do |s| + s.name = 'OpenAPIClient' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '3.0' + s.version = '1.0.0' + s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } + s.authors = 'OpenAPI Generator' + s.license = 'Proprietary' + s.homepage = 'https://github.com/OpenAPITools/openapi-generator' + s.summary = 'OpenAPIClient Swift SDK' + s.source_files = 'OpenAPIClient/Classes/**/*.swift' + s.dependency 'AnyCodable-FlightSchool', '~> 0.6' +end diff --git a/samples/client/petstore/swift5/anycodable/Package.swift b/samples/client/petstore/swift5/anycodable/Package.swift new file mode 100644 index 00000000000..7c8b8f525f6 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.1 + +import PackageDescription + +let package = Package( + name: "PetstoreClient", + platforms: [ + .iOS(.v11), + .macOS(.v10_13), + .tvOS(.v11), + .watchOS(.v4), + ], + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "PetstoreClient", + targets: ["PetstoreClient"] + ), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + .package(url: "https://github.com/Flight-School/AnyCodable", .upToNextMajor(from: "0.6.1")), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "PetstoreClient", + dependencies: ["AnyCodable", ], + path: "PetstoreClient/Classes" + ), + ] +) diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient.podspec b/samples/client/petstore/swift5/anycodable/PetstoreClient.podspec new file mode 100644 index 00000000000..547ad5a7baa --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient.podspec @@ -0,0 +1,15 @@ +Pod::Spec.new do |s| + s.name = 'PetstoreClient' + s.ios.deployment_target = '11.0' + s.osx.deployment_target = '10.13' + s.tvos.deployment_target = '11.0' + s.watchos.deployment_target = '4.0' + s.version = '1.0.0' + s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } + s.authors = '' + s.license = 'Proprietary' + s.homepage = 'https://github.com/openapitools/openapi-generator' + s.summary = 'PetstoreClient' + s.source_files = 'PetstoreClient/Classes/**/*.swift' + s.dependency 'AnyCodable-FlightSchool', '~> 0.6' +end diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 00000000000..93c5c762602 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,119 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + let destination = source.reduce(into: [String: Any]()) { result, item in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + return source.reduce(into: [String: String]()) { result, item in + if let collection = item.value as? [Any?] { + result[item.key] = collection + .compactMap { value in convertAnyToString(value) } + .joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = convertAnyToString(value) + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any]()) { result, item in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + } + } + + public static func convertAnyToString(_ value: Any?) -> String? { + guard let value = value else { return nil } + if let value = value as? any RawRepresentable { + return "\(value.rawValue)" + } else { + return "\(value)" + } + } + + public static func mapValueToPathItem(_ source: Any) -> Any { + if let collection = source as? [Any?] { + return collection + .compactMap { value in convertAnyToString(value) } + .joined(separator: ",") + } + return source + } + + /// maps all values from source to query parameters + /// + /// explode attribute is respected: collection values might be either joined or split up into separate key value pairs + public static func mapValuesToQueryItems(_ source: [String: (wrappedValue: Any?, isExplode: Bool)]) -> [URLQueryItem]? { + let destination = source.filter { $0.value.wrappedValue != nil }.reduce(into: [URLQueryItem]()) { result, item in + if let collection = item.value.wrappedValue as? [Any?] { + + let collectionValues: [String] = collection.compactMap { value in convertAnyToString(value) } + + if !item.value.isExplode { + result.append(URLQueryItem(name: item.key, value: collectionValues.joined(separator: ","))) + } else { + collectionValues + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } + } + + } else if let value = item.value.wrappedValue { + result.append(URLQueryItem(name: item.key, value: convertAnyToString(value))) + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + /// maps all values from source to query parameters + /// + /// collection values are always exploded + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in + if let collection = item.value as? [Any?] { + collection + .compactMap { value in convertAnyToString(value) } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } + + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: convertAnyToString(value))) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 00000000000..30b466c25a1 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,65 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +open class PetstoreClientAPI { + public static var basePath = "http://localhost" + public static var customHeaders: [String: String] = [:] + public static var credential: URLCredential? + public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() + public static var apiResponseQueue: DispatchQueue = .main +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String: String] + public let parameters: [String: Any]? + public let method: String + public let URLString: String + public let requestTask: RequestTask = RequestTask() + public let requiresAuthentication: Bool + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.headers = headers + self.requiresAuthentication = requiresAuthentication + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders: [String: String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask + } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIs/PetsAPI.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIs/PetsAPI.swift new file mode 100644 index 00000000000..03222c67a75 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/APIs/PetsAPI.swift @@ -0,0 +1,99 @@ +// +// PetsAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class PetsAPI { + + /** + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func petsGet(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: PrefixPetSuffix?, _ error: Error?) -> Void)) -> RequestTask { + return petsGetWithRequestBuilder().execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + - GET /pets + - returns: RequestBuilder + */ + open class func petsGetWithRequestBuilder() -> RequestBuilder { + let localVariablePath = "/pets" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } + + /** + Info for a specific pet + + - parameter petId: (path) The id of the pet to retrieve + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func showPetById(petId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: AnyCodable?, _ error: Error?) -> Void)) -> RequestTask { + return showPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Info for a specific pet + - GET /pets/{petId} + - parameter petId: (path) The id of the pet to retrieve + - returns: RequestBuilder + */ + open class func showPetByIdWithRequestBuilder(petId: String) -> RequestBuilder { + var localVariablePath = "/pets/{petId}" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: false) + } +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift new file mode 100644 index 00000000000..09c82e53e13 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -0,0 +1,49 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class CodableHelper { + private static var customDateFormatter: DateFormatter? + private static var defaultDateFormatter: DateFormatter = OpenISO8601DateFormatter() + + private static var customJSONDecoder: JSONDecoder? + private static var defaultJSONDecoder: JSONDecoder = { + let decoder = JSONDecoder() + decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) + return decoder + }() + + private static var customJSONEncoder: JSONEncoder? + private static var defaultJSONEncoder: JSONEncoder = { + let encoder = JSONEncoder() + encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) + encoder.outputFormatting = .prettyPrinted + return encoder + }() + + public static var dateFormatter: DateFormatter { + get { return customDateFormatter ?? defaultDateFormatter } + set { customDateFormatter = newValue } + } + public static var jsonDecoder: JSONDecoder { + get { return customJSONDecoder ?? defaultJSONDecoder } + set { customJSONDecoder = newValue } + } + public static var jsonEncoder: JSONEncoder { + get { return customJSONEncoder ?? defaultJSONEncoder } + set { customJSONEncoder = newValue } + } + + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try jsonDecoder.decode(type, from: data) } + } + + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try jsonEncoder.encode(value) } + } +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 00000000000..df53ee09010 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class Configuration { + + /// Configures the range of HTTP status codes that will result in a successful response + /// + /// If a HTTP status code is outside of this range the response will be interpreted as failed. + public static var successfulStatusCodeRange: Range = 200..<300 +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Extensions.swift new file mode 100644 index 00000000000..d12fa0fb513 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -0,0 +1,230 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension Decimal: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { self } +} + +extension RawRepresentable where RawValue: JSONEncodable { + func encodeToJSON() -> Any { return self.rawValue } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Set: JSONEncodable { + func encodeToJSON() -> Any { + return Array(self).encodeToJSON() + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return CodableHelper.dateFormatter.string(from: self) + } +} + +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + guard let data = try? CodableHelper.jsonEncoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + + public mutating func encode(_ value: Decimal, forKey key: Self.Key) throws { + var mutableValue = value + let stringValue = NSDecimalString(&mutableValue, Locale(identifier: "en_US")) + try encode(stringValue, forKey: key) + } + + public mutating func encodeIfPresent(_ value: Decimal?, forKey key: Self.Key) throws { + if let value = value { + try encode(value, forKey: key) + } + } +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + + public func decode(_ type: Decimal.Type, forKey key: Self.Key) throws -> Decimal { + let stringValue = try decode(String.self, forKey: key) + guard let decimalValue = Decimal(string: stringValue) else { + let context = DecodingError.Context(codingPath: [key], debugDescription: "The key \(key) couldn't be converted to a Decimal value") + throw DecodingError.typeMismatch(type, context) + } + + return decimalValue + } + + public func decodeIfPresent(_ type: Decimal.Type, forKey key: Self.Key) throws -> Decimal? { + guard let stringValue = try decodeIfPresent(String.self, forKey: key) else { + return nil + } + guard let decimalValue = Decimal(string: stringValue) else { + let context = DecodingError.Context(codingPath: [key], debugDescription: "The key \(key) couldn't be converted to a Decimal value") + throw DecodingError.typeMismatch(type, context) + } + + return decimalValue + } + +} + +extension HTTPURLResponse { + var isStatusCodeSuccessful: Bool { + return Configuration.successfulStatusCodeRange.contains(statusCode) + } +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift new file mode 100644 index 00000000000..b79e9f5e64d --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -0,0 +1,53 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct JSONDataEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest { + var urlRequest = urlRequest + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> [String: Any]? { + var returnedParams: [String: Any]? + if let jsonData = jsonData, !jsonData.isEmpty { + var params: [String: Any] = [:] + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift new file mode 100644 index 00000000000..02f78ffb470 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -0,0 +1,45 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj) + do { + let data = try encodeResult.get() + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { + var params: [String: Any]? + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + return nil + } + } + + return params + } + +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Models.swift new file mode 100644 index 00000000000..b73c2b8fde0 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -0,0 +1,126 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + +public enum ErrorResponse: Error { + case error(Int, Data?, URLResponse?, Error) +} + +public enum DownloadException: Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum DecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case unsuccessfulHTTPStatusCode + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class Response { + public let statusCode: Int + public let header: [String: String] + public let body: T + public let bodyData: Data? + + public init(statusCode: Int, header: [String: String], body: T, bodyData: Data?) { + self.statusCode = statusCode + self.header = header + self.body = body + self.bodyData = bodyData + } + + public convenience init(response: HTTPURLResponse, body: T, bodyData: Data?) { + let rawHeader = response.allHeaderFields + var header = [String: String]() + for (key, value) in rawHeader { + if let key = key.base as? String, let value = value as? String { + header[key] = value + } + } + self.init(statusCode: response.statusCode, header: header, body: body, bodyData: bodyData) + } +} + +public final class RequestTask { + private var lock = NSRecursiveLock() + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + lock.lock() + defer { lock.unlock() } + self.task = task + } + + public func cancel() { + lock.lock() + defer { lock.unlock() } + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Models/PrefixPetSuffix.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Models/PrefixPetSuffix.swift new file mode 100644 index 00000000000..183f8eeb770 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Models/PrefixPetSuffix.swift @@ -0,0 +1,32 @@ +// +// PrefixPetSuffix.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct PrefixPetSuffix: Codable, JSONEncodable, Hashable { + + public var testProperty: String + + public init(testProperty: String) { + self.testProperty = testProperty + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case testProperty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(testProperty, forKey: .testProperty) + } +} + diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift new file mode 100644 index 00000000000..cc3288805f1 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift @@ -0,0 +1,56 @@ +// +// OpenISO8601DateFormatter.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +// https://stackoverflow.com/a/50281094/976628 +public class OpenISO8601DateFormatter: DateFormatter { + static let withoutSeconds: DateFormatter = { + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" + return formatter + }() + + static let withoutTime: DateFormatter = { + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd" + return formatter + }() + + private func setup() { + calendar = Calendar(identifier: .iso8601) + locale = Locale(identifier: "en_US_POSIX") + timeZone = TimeZone(secondsFromGMT: 0) + dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + } + + override init() { + super.init() + setup() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setup() + } + + override public func date(from string: String) -> Date? { + if let result = super.date(from: string) { + return result + } else if let result = OpenISO8601DateFormatter.withoutSeconds.date(from: string) { + return result + } + + return OpenISO8601DateFormatter.withoutTime.date(from: string) + } +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift new file mode 100644 index 00000000000..acf7ff4031b --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift @@ -0,0 +1,36 @@ +// SynchronizedDictionary.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +internal struct SynchronizedDictionary { + + private var dictionary = [K: V]() + private let queue = DispatchQueue( + label: "SynchronizedDictionary", + qos: DispatchQoS.userInitiated, + attributes: [DispatchQueue.Attributes.concurrent], + autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, + target: nil + ) + + internal subscript(key: K) -> V? { + get { + var value: V? + + queue.sync { + value = self.dictionary[key] + } + + return value + } + set { + queue.sync(flags: DispatchWorkItemFlags.barrier) { + self.dictionary[key] = newValue + } + } + } +} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift new file mode 100644 index 00000000000..f04c90878cb --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -0,0 +1,618 @@ +// URLSessionImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if !os(macOS) +import MobileCoreServices +#endif + +public protocol URLSessionProtocol { + func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +} + +extension URLSession: URLSessionProtocol {} + +class URLSessionRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return URLSessionRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return URLSessionDecodableRequestBuilder.self + } +} + +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + +// Store the URLSession to retain its reference +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() + +open class URLSessionRequestBuilder: RequestBuilder { + + /** + May be assigned if you want to control the authentication challenges. + */ + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? + + /** + May be assigned if you want to do any of those things: + - control the task completion + - intercept and handle errors like authorization + - retry the request. + */ + @available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool) { + super.init(method: method, URLString: URLString, parameters: parameters, headers: headers, requiresAuthentication: requiresAuthentication) + } + + /** + May be overridden by a subclass if you want to control the URLSession + configuration. + */ + open func createURLSession() -> URLSessionProtocol { + return defaultURLSession + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the URLRequest + configuration (e.g. to override the cache policy). + */ + open func createURLRequest(urlSession: URLSessionProtocol, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + + guard let url = URL(string: URLString) else { + throw DownloadException.requestMissingURL + } + + var originalRequest = URLRequest(url: url) + + originalRequest.httpMethod = method.rawValue + + buildHeaders().forEach { key, value in + originalRequest.setValue(value, forHTTPHeaderField: key) + } + + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) + + return modifiedRequest + } + + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + let urlSession = createURLSession() + + guard let xMethod = HTTPMethod(rawValue: method) else { + fatalError("Unsupported Http method - \(method)") + } + + let encoding: ParameterEncoding + + switch xMethod { + case .get, .head: + encoding = URLEncoding() + + case .options, .post, .put, .patch, .delete, .trace, .connect: + let contentType = headers["Content-Type"] ?? "application/json" + + if contentType.hasPrefix("application/json") { + encoding = JSONDataEncoding() + } else if contentType.hasPrefix("multipart/form-data") { + encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) + } else if contentType.hasPrefix("application/x-www-form-urlencoded") { + encoding = FormURLEncoding() + } else { + fatalError("Unsupported Media Type - \(contentType)") + } + } + + do { + let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + + let dataTask = urlSession.dataTask(with: request) { data, response, error in + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() + } + } + + onProgressReady?(dataTask.progress) + + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + + dataTask.resume() + + requestTask.set(task: dataTask) + } catch { + apiResponseQueue.async { + completion(.failure(ErrorResponse.error(415, nil, nil, error))) + } + } + + return requestTask + } + + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, response, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, response, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: () as! T, bodyData: data))) + + default: + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") + } + + } + + open func buildHeaders() -> [String: String] { + var httpHeaders: [String: String] = [:] + for (key, value) in PetstoreClientAPI.customHeaders { + httpHeaders[key] = value + } + for (key, value) in headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename: String? + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + continue + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with: "") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url: URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, response, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, response, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is String.Type: + + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" + + completion(.success(Response(response: httpResponse, body: body as! T, bodyData: data))) + + case is URL.Type: + do { + + guard error == nil else { + throw DownloadException.responseFailed + } + + guard let data = data else { + throw DownloadException.responseDataMissing + } + + let fileManager = FileManager.default + let cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] + let requestURL = try getURL(from: urlRequest) + + var requestPath = try getPath(from: requestURL) + + if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } else { + requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") + } + + let filePath = cachesDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion(.success(Response(response: httpResponse, body: filePath as! T, bodyData: data))) + + } catch let requestParserError as DownloadException { + completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) + } catch { + completion(.failure(ErrorResponse.error(400, data, response, error))) + } + + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: () as! T, bodyData: data))) + + case is Data.Type: + + completion(.success(Response(response: httpResponse, body: data as! T, bodyData: data))) + + default: + + guard let unwrappedData = data, !unwrappedData.isEmpty else { + if let E = T.self as? ExpressibleByNilLiteral.Type { + completion(.success(Response(response: httpResponse, body: E.init(nilLiteral: ()) as! T, bodyData: data))) + } else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, response, DecodableRequestBuilderError.emptyDataResponse))) + } + return + } + + let decodeResult = CodableHelper.decode(T.self, from: unwrappedData) + + switch decodeResult { + case let .success(decodableObj): + completion(.success(Response(response: httpResponse, body: decodableObj, bodyData: unwrappedData))) + case let .failure(error): + completion(.failure(ErrorResponse.error(httpResponse.statusCode, unwrappedData, response, error))) + } + } + } +} + +private class SessionDelegate: NSObject, URLSessionTaskDelegate { + func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + + var credential: URLCredential? + + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } +} + +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +public protocol ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest +} + +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters else { return urlRequest } + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) + urlRequest.url = urlComponents.url + } + + return urlRequest + } +} + +private class FormDataEncoding: ParameterEncoding { + + let contentTypeForFormPart: (_ fileURL: URL) -> String? + + init(contentTypeForFormPart: @escaping (_ fileURL: URL) -> String?) { + self.contentTypeForFormPart = contentTypeForFormPart + } + + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters, !parameters.isEmpty else { + return urlRequest + } + + let boundary = "Boundary-\(UUID().uuidString)" + + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") + + for (key, value) in parameters { + for value in (value as? Array ?? [value]) { + switch value { + case let fileURL as URL: + + urlRequest = try configureFileUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + fileURL: fileURL + ) + + case let string as String: + + if let data = string.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + case let number as NSNumber: + + if let data = number.stringValue.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + + case let uuid as UUID: + + if let data = uuid.uuidString.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + default: + fatalError("Unprocessable value \(value) with key \(key)") + } + } + } + + var body = urlRequest.httpBody.orEmpty + + body.append("\r\n--\(boundary)--\r\n") + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureFileUploadRequest(urlRequest: URLRequest, boundary: String, name: String, fileURL: URL) throws -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + let fileData = try Data(contentsOf: fileURL) + + let mimetype = contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) + + let fileName = fileURL.lastPathComponent + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n") + body.append("Content-Type: \(mimetype)\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(fileData) + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(data) + + urlRequest.httpBody = body + + return urlRequest + + } + + func mimeType(for url: URL) -> String { + let pathExtension = url.pathExtension + + if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as NSString, nil)?.takeRetainedValue() { + if let mimetype = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() { + return mimetype as String + } + } + return "application/octet-stream" + } + +} + +private class FormURLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + var requestBodyComponents = URLComponents() + requestBodyComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:]) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = requestBodyComponents.query?.data(using: .utf8) + + return urlRequest + } +} + +private extension Data { + /// Append string to Data + /// + /// Rather than littering my code with calls to `dataUsingEncoding` to convert strings to Data, and then add that data to the Data, this wraps it in a nice convenient little extension to Data. This converts using UTF-8. + /// + /// - parameter string: The string to be added to the `Data`. + + mutating func append(_ string: String) { + if let data = string.data(using: .utf8) { + append(data) + } + } +} + +private extension Optional where Wrapped == Data { + var orEmpty: Data { + self ?? Data() + } +} + +extension JSONDataEncoding: ParameterEncoding {} diff --git a/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Validation.swift new file mode 100644 index 00000000000..df99b3e124b --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -0,0 +1,126 @@ +// Validation.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct StringRule { + public var minLength: Int? + public var maxLength: Int? + public var pattern: String? +} + +public struct NumericRule { + public var minimum: T? + public var exclusiveMinimum = false + public var maximum: T? + public var exclusiveMaximum = false + public var multipleOf: T? +} + +public enum StringValidationErrorKind: Error { + case minLength, maxLength, pattern +} + +public enum NumericValidationErrorKind: Error { + case minimum, maximum, multipleOf +} + +public struct ValidationError: Error { + public fileprivate(set) var kinds: Set +} + +public struct Validator { + /// Validate a string against a rule. + /// - Parameter string: The String you wish to validate. + /// - Parameter rule: The StringRule you wish to use for validation. + /// - Returns: A validated string. + /// - Throws: `ValidationError` if the string is invalid against the rule, + /// `NSError` if the rule.pattern is invalid. + public static func validate(_ string: String, against rule: StringRule) throws -> String { + var error = ValidationError(kinds: []) + if let minLength = rule.minLength, !(minLength <= string.count) { + error.kinds.insert(.minLength) + } + if let maxLength = rule.maxLength, !(string.count <= maxLength) { + error.kinds.insert(.maxLength) + } + if let pattern = rule.pattern { + let matches = try NSRegularExpression(pattern: pattern, options: .caseInsensitive) + .matches(in: string, range: .init(location: 0, length: string.utf16.count)) + if matches.isEmpty { + error.kinds.insert(.pattern) + } + } + guard error.kinds.isEmpty else { + throw error + } + return string + } + + /// Validate a integer against a rule. + /// - Parameter numeric: The integer you wish to validate. + /// - Parameter rule: The NumericRule you wish to use for validation. + /// - Returns: A validated integer. + /// - Throws: `ValidationError` if the numeric is invalid against the rule. + public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { + var error = ValidationError(kinds: []) + if let minium = rule.minimum { + if !rule.exclusiveMinimum, !(minium <= numeric) { + error.kinds.insert(.minimum) + } + if rule.exclusiveMinimum, !(minium < numeric) { + error.kinds.insert(.minimum) + } + } + if let maximum = rule.maximum { + if !rule.exclusiveMaximum, !(numeric <= maximum) { + error.kinds.insert(.maximum) + } + if rule.exclusiveMaximum, !(numeric < maximum) { + error.kinds.insert(.maximum) + } + } + if let multipleOf = rule.multipleOf, !numeric.isMultiple(of: multipleOf) { + error.kinds.insert(.multipleOf) + } + guard error.kinds.isEmpty else { + throw error + } + return numeric + } + + /// Validate a fractional number against a rule. + /// - Parameter numeric: The fractional number you wish to validate. + /// - Parameter rule: The NumericRule you wish to use for validation. + /// - Returns: A validated fractional number. + /// - Throws: `ValidationError` if the numeric is invalid against the rule. + public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { + var error = ValidationError(kinds: []) + if let minium = rule.minimum { + if !rule.exclusiveMinimum, !(minium <= numeric) { + error.kinds.insert(.minimum) + } + if rule.exclusiveMinimum, !(minium < numeric) { + error.kinds.insert(.minimum) + } + } + if let maximum = rule.maximum { + if !rule.exclusiveMaximum, !(numeric <= maximum) { + error.kinds.insert(.maximum) + } + if rule.exclusiveMaximum, !(numeric < maximum) { + error.kinds.insert(.maximum) + } + } + if let multipleOf = rule.multipleOf, numeric.remainder(dividingBy: multipleOf) != 0 { + error.kinds.insert(.multipleOf) + } + guard error.kinds.isEmpty else { + throw error + } + return numeric + } +} diff --git a/samples/client/petstore/swift5/anycodable/README.md b/samples/client/petstore/swift5/anycodable/README.md new file mode 100644 index 00000000000..f98ca53800a --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/README.md @@ -0,0 +1,45 @@ +# Swift5 API client for PetstoreClient + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build package: org.openapitools.codegen.languages.Swift5ClientCodegen + +## Installation + +### Carthage + +Run `carthage update` + +### CocoaPods + +Run `pod install` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetsAPI* | [**petsGet**](docs/PetsAPI.md#petsget) | **GET** /pets | +*PetsAPI* | [**showPetById**](docs/PetsAPI.md#showpetbyid) | **GET** /pets/{petId} | Info for a specific pet + + +## Documentation For Models + + - [PrefixPetSuffix](docs/PrefixPetSuffix.md) + + +## Documentation For Authorization + + All endpoints do not require authorization. + + +## Author + + + diff --git a/samples/client/petstore/swift5/anycodable/docs/PetsAPI.md b/samples/client/petstore/swift5/anycodable/docs/PetsAPI.md new file mode 100644 index 00000000000..9dfc4bc6c7e --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/docs/PetsAPI.md @@ -0,0 +1,101 @@ +# PetsAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**petsGet**](PetsAPI.md#petsget) | **GET** /pets | +[**showPetById**](PetsAPI.md#showpetbyid) | **GET** /pets/{petId} | Info for a specific pet + + +# **petsGet** +```swift + open class func petsGet(completion: @escaping (_ data: PrefixPetSuffix?, _ error: Error?) -> Void) +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + + +PetsAPI.petsGet() { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PrefixPetSuffix**](PrefixPetSuffix.md) + +### 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) + +# **showPetById** +```swift + open class func showPetById(petId: String, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void) +``` + +Info for a specific pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = "petId_example" // String | The id of the pet to retrieve + +// Info for a specific pet +PetsAPI.showPetById(petId: petId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **String** | The id of the pet to retrieve | + +### Return type + +**AnyCodable** + +### 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) + diff --git a/samples/client/petstore/swift5/anycodable/docs/PrefixPetSuffix.md b/samples/client/petstore/swift5/anycodable/docs/PrefixPetSuffix.md new file mode 100644 index 00000000000..62e3869100b --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/docs/PrefixPetSuffix.md @@ -0,0 +1,10 @@ +# PrefixPetSuffix + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**testProperty** | **String** | | + +[[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/swift5/anycodable/git_push.sh b/samples/client/petstore/swift5/anycodable/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/git_push.sh @@ -0,0 +1,57 @@ +#!/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" "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/swift5/anycodable/pom.xml b/samples/client/petstore/swift5/anycodable/pom.xml new file mode 100644 index 00000000000..c1b201eb3b4 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + Swift5PetstoreClientTests + pom + 1.0-SNAPSHOT + Swift5 Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_spmbuild.sh + + + + + + + diff --git a/samples/client/petstore/swift5/anycodable/project.yml b/samples/client/petstore/swift5/anycodable/project.yml new file mode 100644 index 00000000000..876aca81692 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/project.yml @@ -0,0 +1,15 @@ +name: PetstoreClient +targets: + PetstoreClient: + type: framework + platform: iOS + deploymentTarget: "11.0" + sources: [PetstoreClient] + info: + path: ./Info.plist + version: 1.0.0 + settings: + APPLICATION_EXTENSION_API_ONLY: true + scheme: {} + dependencies: + - carthage: AnyCodable diff --git a/samples/client/petstore/swift5/anycodable/run_spmbuild.sh b/samples/client/petstore/swift5/anycodable/run_spmbuild.sh new file mode 100755 index 00000000000..1a9f585ad05 --- /dev/null +++ b/samples/client/petstore/swift5/anycodable/run_spmbuild.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/default/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift5/default/docs/AdditionalPropertiesClass.md index 1cffcdd8484..4d5f0963145 100644 --- a/samples/client/petstore/swift5/default/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/swift5/default/docs/AdditionalPropertiesClass.md @@ -11,9 +11,9 @@ Name | Type | Description | Notes **mapArrayAnytype** | [String: [AnyCodable]] | | [optional] **mapMapString** | [String: [String: String]] | | [optional] **mapMapAnytype** | [String: [String: AnyCodable]] | | [optional] -**anytype1** | [**AnyCodable**](.md) | | [optional] -**anytype2** | [**AnyCodable**](.md) | | [optional] -**anytype3** | [**AnyCodable**](.md) | | [optional] +**anytype1** | **AnyCodable** | | [optional] +**anytype2** | **AnyCodable** | | [optional] +**anytype3** | **AnyCodable** | | [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/swift5/swift5_test_all.sh b/samples/client/petstore/swift5/swift5_test_all.sh index c1d6899114a..902a476ef7d 100755 --- a/samples/client/petstore/swift5/swift5_test_all.sh +++ b/samples/client/petstore/swift5/swift5_test_all.sh @@ -14,6 +14,7 @@ mvn -f $DIRECTORY/urlsessionLibrary/SwaggerClientTests/pom.xml integration-test # spm build mvn -f $DIRECTORY/alamofireLibrary/pom.xml integration-test +mvn -f $DIRECTORY/anycodable/pom.xml integration-test mvn -f $DIRECTORY/asyncAwaitLibrary/pom.xml integration-test mvn -f $DIRECTORY/combineLibrary/pom.xml integration-test mvn -f $DIRECTORY/default/pom.xml integration-test diff --git a/samples/client/petstore/swift5/vaporLibrary/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift5/vaporLibrary/docs/AdditionalPropertiesClass.md index 1cffcdd8484..4d5f0963145 100644 --- a/samples/client/petstore/swift5/vaporLibrary/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/swift5/vaporLibrary/docs/AdditionalPropertiesClass.md @@ -11,9 +11,9 @@ Name | Type | Description | Notes **mapArrayAnytype** | [String: [AnyCodable]] | | [optional] **mapMapString** | [String: [String: String]] | | [optional] **mapMapAnytype** | [String: [String: AnyCodable]] | | [optional] -**anytype1** | [**AnyCodable**](.md) | | [optional] -**anytype2** | [**AnyCodable**](.md) | | [optional] -**anytype3** | [**AnyCodable**](.md) | | [optional] +**anytype1** | **AnyCodable** | | [optional] +**anytype2** | **AnyCodable** | | [optional] +**anytype3** | **AnyCodable** | | [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/typescript-fetch/builds/allOf-nullable/runtime.ts b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/runtime.ts index 18b2f64813e..c8c0c413a2b 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts index 18b2f64813e..c8c0c413a2b 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index f02d35b1039..a34da5fccb9 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -232,7 +232,11 @@ export class FakeApi extends runtime.BaseAPI { body: requestParameters.body as any, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** @@ -290,7 +294,11 @@ export class FakeApi extends runtime.BaseAPI { body: requestParameters.body as any, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** @@ -319,7 +327,11 @@ export class FakeApi extends runtime.BaseAPI { body: requestParameters.body as any, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/UserApi.ts index 5598e0818b1..fa437d76cba 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/UserApi.ts @@ -254,7 +254,11 @@ export class UserApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts index 7c611d3f08e..3aba7c739e4 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts @@ -57,10 +57,10 @@ export function AnimalFromJSONTyped(json: any, ignoreDiscriminator: boolean): An return json; } if (!ignoreDiscriminator) { - if (json['className'] === 'Cat') { + if (json['className'] === 'CAT') { return CatFromJSONTyped(json, true); } - if (json['className'] === 'Dog') { + if (json['className'] === 'DOG') { return DogFromJSONTyped(json, true); } } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts index 85e8df80b70..e46e834fc01 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts index d0341bba887..cf07b17e74a 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts @@ -247,7 +247,11 @@ export class UserApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts index 353b30125b0..a1fe7aa98dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts index ee616abdf8f..fa1d5875027 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts @@ -33,9 +33,9 @@ import { export interface FakeEnumRequestGetInlineRequest { stringEnum?: FakeEnumRequestGetInlineStringEnumEnum; - nullableStringEnum?: string | null; + nullableStringEnum?: FakeEnumRequestGetInlineNullableStringEnumEnum; numberEnum?: FakeEnumRequestGetInlineNumberEnumEnum; - nullableNumberEnum?: number | null; + nullableNumberEnum?: FakeEnumRequestGetInlineNullableNumberEnumEnum; } export interface FakeEnumRequestGetRefRequest { @@ -203,6 +203,15 @@ export const FakeEnumRequestGetInlineStringEnumEnum = { Three: 'three' } as const; export type FakeEnumRequestGetInlineStringEnumEnum = typeof FakeEnumRequestGetInlineStringEnumEnum[keyof typeof FakeEnumRequestGetInlineStringEnumEnum]; +/** + * @export + */ +export const FakeEnumRequestGetInlineNullableStringEnumEnum = { + One: 'one', + Two: 'two', + Three: 'three' +} as const; +export type FakeEnumRequestGetInlineNullableStringEnumEnum = typeof FakeEnumRequestGetInlineNullableStringEnumEnum[keyof typeof FakeEnumRequestGetInlineNullableStringEnumEnum]; /** * @export */ @@ -212,3 +221,12 @@ export const FakeEnumRequestGetInlineNumberEnumEnum = { NUMBER_3: 3 } as const; export type FakeEnumRequestGetInlineNumberEnumEnum = typeof FakeEnumRequestGetInlineNumberEnumEnum[keyof typeof FakeEnumRequestGetInlineNumberEnumEnum]; +/** + * @export + */ +export const FakeEnumRequestGetInlineNullableNumberEnumEnum = { + NUMBER_1: 1, + NUMBER_2: 2, + NUMBER_3: 3 +} as const; +export type FakeEnumRequestGetInlineNullableNumberEnumEnum = typeof FakeEnumRequestGetInlineNullableNumberEnumEnum[keyof typeof FakeEnumRequestGetInlineNullableNumberEnumEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts b/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts index 65f8058af3a..8ec41ab00fa 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); 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 d0341bba887..cf07b17e74a 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 @@ -247,7 +247,11 @@ export class UserApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** 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 353b30125b0..a1fe7aa98dd 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 @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts index 158ea10d595..c4e068f2fb0 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts @@ -247,7 +247,11 @@ export class UserApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts index 353b30125b0..a1fe7aa98dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); 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 index a2cb05f96ca..6c66a4223b7 100644 --- 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 @@ -247,7 +247,11 @@ export class UserApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** 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 index 353b30125b0..a1fe7aa98dd 100644 --- 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 @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/UserApi.ts index 9f3b847e02a..01878bc490b 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/UserApi.ts @@ -250,7 +250,11 @@ export class UserApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts index 353b30125b0..a1fe7aa98dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts index 986bc1afedc..986cd8cc6df 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts @@ -380,7 +380,11 @@ export class UserApi extends runtime.BaseAPI implements UserApiInterface { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts index 353b30125b0..a1fe7aa98dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); 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 d0341bba887..cf07b17e74a 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 @@ -247,7 +247,11 @@ export class UserApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** 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 353b30125b0..a1fe7aa98dd 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 @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts index 53db124d121..a6f4fa649ac 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/apis/DefaultApi.ts @@ -33,9 +33,9 @@ import { export interface FakeEnumRequestGetInlineRequest { stringEnum?: FakeEnumRequestGetInlineStringEnumEnum; - nullableStringEnum?: string | null; + nullableStringEnum?: FakeEnumRequestGetInlineNullableStringEnumEnum; numberEnum?: FakeEnumRequestGetInlineNumberEnumEnum; - nullableNumberEnum?: number | null; + nullableNumberEnum?: FakeEnumRequestGetInlineNullableNumberEnumEnum; } export interface FakeEnumRequestGetRefRequest { @@ -203,6 +203,15 @@ export enum FakeEnumRequestGetInlineStringEnumEnum { Two = 'two', Three = 'three' } +/** + * @export + * @enum {string} + */ +export enum FakeEnumRequestGetInlineNullableStringEnumEnum { + One = 'one', + Two = 'two', + Three = 'three' +} /** * @export * @enum {string} @@ -212,3 +221,12 @@ export enum FakeEnumRequestGetInlineNumberEnumEnum { NUMBER_2 = 2, NUMBER_3 = 3 } +/** + * @export + * @enum {string} + */ +export enum FakeEnumRequestGetInlineNullableNumberEnumEnum { + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3 +} diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts index 65f8058af3a..8ec41ab00fa 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/UserApi.ts index 7a0175aec1e..b9f6ec2db67 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/UserApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/UserApi.ts @@ -243,7 +243,11 @@ export class UserApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.TextApiResponse(response) as any; + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } } /** diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts index 3dfb66ac7be..4d355ad4aa2 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts @@ -91,6 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -113,6 +114,23 @@ export class BaseAPI { return this.withMiddleware(...middlewares); } + /** + * 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. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { const { url, init } = await this.createFetchParams(context, initOverrides); const response = await this.fetchApi(url, init); diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go index ed42e1f1b88..1b13ffceee0 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go @@ -640,16 +640,17 @@ func formatErrorMessage(status string, v interface{}) string { str := "" metaValue := reflect.ValueOf(v).Elem() - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } } - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - - // status title (detail) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 7462e79590a..a143237a07e 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -35,6 +35,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -42,11 +43,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -68,63 +72,58 @@ import org.openapitools.client.auth.ApiKeyAuth; */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient extends JavaTimeFormatter { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "http://petstore.swagger.io:80/v2"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://{server}.swagger.io:{port}/v2", - "petstore server", - new HashMap() {{ - put("server", new ServerVariable( - "No description provided", - "petstore", - new HashSet( - Arrays.asList( - "petstore", - "qa-petstore", - "dev-petstore" - ) + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://{server}.swagger.io:{port}/v2", + "petstore server", + Stream.>of( + new SimpleEntry<>("server", new ServerVariable( + "No description provided", + "petstore", + new LinkedHashSet<>(Arrays.asList( + "petstore", + "qa-petstore", + "dev-petstore" + )) + )), + new SimpleEntry<>("port", new ServerVariable( + "No description provided", + "80", + new LinkedHashSet<>(Arrays.asList( + "80", + "8080" + )) + )) + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + ), + new ServerConfiguration( + "https://localhost:8080/{version}", + "The local server", + Stream.>of( + new SimpleEntry<>("version", new ServerVariable( + "No description provided", + "v2", + new LinkedHashSet<>(Arrays.asList( + "v1", + "v2" + )) + )) + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) ) - )); - put("port", new ServerVariable( - "No description provided", - "80", - new HashSet( - Arrays.asList( - "80", - "8080" - ) - ) - )); - }} - ), - new ServerConfiguration( - "https://localhost:8080/{version}", - "The local server", - new HashMap() {{ - put("version", new ServerVariable( - "No description provided", - "v2", - new HashSet( - Arrays.asList( - "v1", - "v2" - ) - ) - )); - }} - ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + protected Map> operationServers = new HashMap<>(); + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -161,7 +160,7 @@ public class ApiClient extends JavaTimeFormatter { setUserAgent("OpenAPI-Generator/1.0.0/java"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; if (authMap != null) { auth = authMap.get("api_key"); @@ -183,7 +182,7 @@ public class ApiClient extends JavaTimeFormatter { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap(); + authenticationLookup = new HashMap<>(); authenticationLookup.put("api_key_query", "api_key"); } @@ -665,7 +664,7 @@ public class ApiClient extends JavaTimeFormatter { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -724,14 +723,13 @@ public class ApiClient extends JavaTimeFormatter { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -743,8 +741,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -764,8 +762,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1057,15 +1055,17 @@ public class ApiClient extends JavaTimeFormatter { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + null, + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1237,10 +1237,10 @@ public class ApiClient extends JavaTimeFormatter { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index c6c83696217..af211b53e53 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -63,7 +63,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -83,7 +83,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -192,12 +192,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/api/UsageApi.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/api/UsageApi.java index 3b1d2d280f0..5843abb0b83 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/api/UsageApi.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/api/UsageApi.java @@ -11,6 +11,7 @@ import javax.ws.rs.core.GenericType; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -71,37 +72,12 @@ public class UsageApi { */ public ApiResponse anyKeyWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/any"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "api_key_query" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "api_key_query"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UsageApi.anyKey", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("UsageApi.anyKey", "/any", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -131,37 +107,12 @@ public class UsageApi { */ public ApiResponse bothKeysWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/both"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "api_key_query" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "api_key_query"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UsageApi.bothKeys", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("UsageApi.bothKeys", "/both", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -191,37 +142,12 @@ public class UsageApi { */ public ApiResponse keyInHeaderWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/header"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UsageApi.keyInHeader", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("UsageApi.keyInHeader", "/header", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -251,37 +177,12 @@ public class UsageApi { */ public ApiResponse keyInQueryWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/query"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key_query" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key_query"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UsageApi.keyInQuery", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("UsageApi.keyInQuery", "/query", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api/usage_api_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api/usage_api_spec.rb index 03e3ed32596..ab8053f3662 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api/usage_api_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api/usage_api_spec.rb @@ -39,7 +39,7 @@ describe 'UsageApi' do # @return [Object] describe 'any_key test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -50,7 +50,7 @@ describe 'UsageApi' do # @return [Object] describe 'both_keys test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -61,7 +61,7 @@ describe 'UsageApi' do # @return [Object] describe 'key_in_header test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -72,7 +72,7 @@ describe 'UsageApi' do # @return [Object] describe 'key_in_query test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api/usage_api_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api/usage_api_spec.rb index 4a88b4e41c0..efb2b641fe6 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api/usage_api_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api/usage_api_spec.rb @@ -39,7 +39,7 @@ describe 'UsageApi' do # @return [Object] describe 'custom_server test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -50,7 +50,7 @@ describe 'UsageApi' do # @return [Object] describe 'default_server test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api/usage_api_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api/usage_api_spec.rb index 66607732925..1c84555f390 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api/usage_api_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api/usage_api_spec.rb @@ -36,11 +36,11 @@ describe 'UsageApi' do # Use alias to array # Use alias to array # @param [Hash] opts the optional parameters - # @option opts [ArrayAlias] :array_alias + # @option opts [ArrayAlias] :array_alias # @return [Object] describe 'array test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end @@ -48,11 +48,11 @@ describe 'UsageApi' do # Use alias to map # Use alias to map # @param [Hash] opts the optional parameters - # @option opts [MapAlias] :map_alias + # @option opts [MapAlias] :map_alias # @return [Object] describe 'map test' do it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ end end diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart index dd3a19e9d93..b654a66733e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -69,5 +69,3 @@ class AllOfWithSingleRef { } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart index 04f59d36012..5bcd7d9dee8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart @@ -21,6 +21,7 @@ abstract class AllOfWithSingleRef implements Built discriminatorMapping = { - r'Cat': Cat, - r'Dog': Dog, + r'CAT': Cat, + r'DOG': Dog, }; @BuiltValueSerializer(custom: true) @@ -37,10 +37,10 @@ abstract class Animal { extension AnimalDiscriminatorExt on Animal { String? get discriminatorValue { if (this is Cat) { - return r'Cat'; + return r'CAT'; } if (this is Dog) { - return r'Dog'; + return r'DOG'; } return null; } @@ -48,10 +48,10 @@ extension AnimalDiscriminatorExt on Animal { extension AnimalBuilderDiscriminatorExt on AnimalBuilder { String? get discriminatorValue { if (this is CatBuilder) { - return r'Cat'; + return r'CAT'; } if (this is DogBuilder) { - return r'Dog'; + return r'DOG'; } return null; } @@ -108,9 +108,9 @@ class _$AnimalSerializer implements PrimitiveSerializer { final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1; final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; switch (discValue) { - case r'Cat': + case r'CAT': return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; - case r'Dog': + case r'DOG': return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; default: return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/all_of_with_single_ref.dart index e98860d25a8..c21911eeec8 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/all_of_with_single_ref.dart @@ -25,6 +25,12 @@ class AllOfWithSingleRef { /// String? username; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// SingleRefType? singleRefType; @override diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index 77a8b5f0386..3df7e6b46e8 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -690,16 +690,17 @@ func formatErrorMessage(status string, v interface{}) string { str := "" metaValue := reflect.ValueOf(v).Elem() - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } } - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - - // status title (detail) return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java index 93587e00afd..641b5f5d50f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java @@ -35,6 +35,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -42,11 +43,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -68,25 +72,26 @@ import org.openapitools.client.auth.ApiKeyAuth; */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient extends JavaTimeFormatter { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "http://localhost"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "", - "No description provided", - new HashMap() - ) + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new LinkedHashMap<>() + ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + protected Map> operationServers = new HashMap<>(); + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -123,13 +128,13 @@ public class ApiClient extends JavaTimeFormatter { setUserAgent("OpenAPI-Generator/1.0.0/java"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap(); + authenticationLookup = new HashMap<>(); } /** @@ -610,7 +615,7 @@ public class ApiClient extends JavaTimeFormatter { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -669,14 +674,13 @@ public class ApiClient extends JavaTimeFormatter { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -688,8 +692,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -709,8 +713,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1002,15 +1006,17 @@ public class ApiClient extends JavaTimeFormatter { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + null, + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1182,10 +1188,10 @@ public class ApiClient extends JavaTimeFormatter { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java index 24317dfe36a..8e72ba03553 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java @@ -64,7 +64,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -84,7 +84,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -193,12 +193,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/api/DefaultApi.java index 2bbea7b750c..5652c5a00bc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.MySchemaNameCharacters; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,37 +75,11 @@ public class DefaultApi { */ public ApiResponse testPostWithHttpInfo(MySchemaNameCharacters mySchemaNameCharacters) throws ApiException { - Object localVarPostBody = mySchemaNameCharacters; - - // create path and map variables - String localVarPath = "/test"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("DefaultApi.testPost", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("DefaultApi.testPost", "/test", "POST", new ArrayList<>(), mySchemaNameCharacters, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java index a39f12c00b1..4c35f1b883c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java @@ -92,7 +92,7 @@ public class ChildSchema extends Parent { @JsonAnySetter public ChildSchema putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -160,11 +160,11 @@ public class ChildSchema extends Parent { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildSchema", ChildSchema.class); - JSON.registerDiscriminator(ChildSchema.class, "objectType", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ChildSchema", ChildSchema.class); + JSON.registerDiscriminator(ChildSchema.class, "objectType", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java index fd536702c9c..d54af6d0d58 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java @@ -93,7 +93,7 @@ public class MySchemaNameCharacters extends Parent { @JsonAnySetter public MySchemaNameCharacters putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -161,11 +161,11 @@ public class MySchemaNameCharacters extends Parent { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("MySchemaName._-Characters", MySchemaNameCharacters.class); - JSON.registerDiscriminator(MySchemaNameCharacters.class, "objectType", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("MySchemaName._-Characters", MySchemaNameCharacters.class); + JSON.registerDiscriminator(MySchemaNameCharacters.class, "objectType", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java index ebef79d5e94..e701fbb6811 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java @@ -25,8 +25,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildSchema; -import org.openapitools.client.model.MySchemaNameCharacters; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -120,13 +118,13 @@ public class Parent { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildSchema", ChildSchema.class); - mappings.put("MySchemaName._-Characters", MySchemaNameCharacters.class); - mappings.put("Parent", Parent.class); - JSON.registerDiscriminator(Parent.class, "objectType", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ChildSchema", ChildSchema.class); + mappings.put("MySchemaName._-Characters", MySchemaNameCharacters.class); + mappings.put("Parent", Parent.class); + JSON.registerDiscriminator(Parent.class, "objectType", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java index da12109e92d..86f484909f7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java @@ -36,6 +36,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -43,11 +44,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -70,25 +74,26 @@ import org.openapitools.client.auth.OAuth; */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient extends JavaTimeFormatter { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "http://petstore.swagger.io/v2"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io/v2", - "No description provided", - new HashMap() - ) + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new LinkedHashMap<>() + ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + protected Map> operationServers = new HashMap<>(); + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -125,7 +130,7 @@ public class ApiClient extends JavaTimeFormatter { setUserAgent("OpenAPI-Generator/1.0.0/java"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; if (authMap != null) { auth = authMap.get("petstore_auth"); @@ -147,7 +152,7 @@ public class ApiClient extends JavaTimeFormatter { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap(); + authenticationLookup = new HashMap<>(); } /** @@ -735,7 +740,7 @@ public class ApiClient extends JavaTimeFormatter { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -794,14 +799,13 @@ public class ApiClient extends JavaTimeFormatter { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -813,8 +817,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -834,8 +838,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1127,15 +1131,17 @@ public class ApiClient extends JavaTimeFormatter { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + null, + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1152,7 +1158,7 @@ public class ApiClient extends JavaTimeFormatter { final int statusCode = response.getStatusInfo().getStatusCode(); // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (statusCode == Status.UNAUTHORIZED.getStatusCode()) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1323,10 +1329,10 @@ public class ApiClient extends JavaTimeFormatter { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/JSON.java index 24317dfe36a..8e72ba03553 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/JSON.java @@ -64,7 +64,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -84,7 +84,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -193,12 +193,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/PetApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/PetApi.java index b08f6fccba5..c0a100379b9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,6 +14,7 @@ import org.openapitools.client.model.Pet; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -78,42 +79,17 @@ public class PetApi { */ public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { - Object localVarPostBody = pet; - - // verify the required parameter 'pet' is set + // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } - - // create path and map variables - String localVarPath = "/pet"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), pet, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -146,43 +122,26 @@ public class PetApi { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - if (apiKey != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (apiKey != null) { localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + } - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", new ArrayList<>(), null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -216,43 +175,22 @@ public class PetApi { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'status' is set + // Check required parameters if (status == null) { throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); } - - // create path and map variables - String localVarPath = "/pet/findByStatus"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "status", status) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -290,43 +228,22 @@ public class PetApi { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'tags' is set + // Check required parameters if (tags == null) { throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); } - - // create path and map variables - String localVarPath = "/pet/findByTags"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "tags", tags) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -362,43 +279,21 @@ public class PetApi { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -440,42 +335,17 @@ public class PetApi { * @see Update an existing pet Documentation */ public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { - Object localVarPostBody = pet; - - // verify the required parameter 'pet' is set + // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } - - // create path and map variables - String localVarPath = "/pet"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), pet, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -510,45 +380,29 @@ public class PetApi { */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (name != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (name != null) { localVarFormParams.put("name", name); -if (status != null) + } + if (status != null) { localVarFormParams.put("status", status); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -584,47 +438,30 @@ if (status != null) */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (_file != null) + } + if (_file != null) { localVarFormParams.put("file", _file); + } - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java index 612bf71da3e..94ad6912d67 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/StoreApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Order; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -75,42 +76,20 @@ public class StoreApi { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + .replaceAll("\\{orderId}", apiClient.escapeString(orderId)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("StoreApi.deleteOrder", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Returns pet inventories by status @@ -139,37 +118,12 @@ public class StoreApi { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/inventory"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("StoreApi.getInventory", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("StoreApi.getInventory", "/store/inventory", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -205,44 +159,21 @@ public class StoreApi { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{orderId}", apiClient.escapeString(orderId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Place an order for a pet @@ -275,42 +206,16 @@ public class StoreApi { */ public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { - Object localVarPostBody = order; - - // verify the required parameter 'order' is set + // Check required parameters if (order == null) { throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } - - // create path and map variables - String localVarPath = "/store/order"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.placeOrder", "/store/order", "POST", new ArrayList<>(), order, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/UserApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/UserApi.java index ba58b97a090..291c174a161 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/api/UserApi.java @@ -13,6 +13,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,40 +75,16 @@ public class UserApi { */ public ApiResponse createUserWithHttpInfo(User user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } - - // create path and map variables - String localVarPath = "/user"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("UserApi.createUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -138,40 +115,16 @@ public class UserApi { */ public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } - - // create path and map variables - String localVarPath = "/user/createWithArray"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -202,40 +155,16 @@ public class UserApi { */ public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } - - // create path and map variables - String localVarPath = "/user/createWithList"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("UserApi.createUsersWithListInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -268,41 +197,20 @@ public class UserApi { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -338,44 +246,21 @@ public class UserApi { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{username}", apiClient.escapeString(username)); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs user into the system @@ -410,50 +295,26 @@ public class UserApi { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); } - - // verify the required parameter 'password' is set if (password == null) { throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); } - - // create path and map variables - String localVarPath = "/user/login"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "username", username) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.loginUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.loginUser", "/user/login", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs out current logged in user session @@ -481,35 +342,11 @@ public class UserApi { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/logout"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("UserApi.logoutUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -544,46 +381,23 @@ public class UserApi { */ public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - - // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Pet.java index 866bfced4c7..c0a3cc863a9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/model/Pet.java @@ -59,7 +59,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -188,6 +188,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index aa6944f29d9..25eb87c05ea 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -36,6 +36,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -43,11 +44,14 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -71,94 +75,93 @@ import org.openapitools.client.auth.OAuth; */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient extends JavaTimeFormatter { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "http://petstore.swagger.io:80/v2"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://{server}.swagger.io:{port}/v2", - "petstore server", - new HashMap() {{ - put("server", new ServerVariable( - "No description provided", - "petstore", - new HashSet( - Arrays.asList( - "petstore", - "qa-petstore", - "dev-petstore" - ) + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://{server}.swagger.io:{port}/v2", + "petstore server", + Stream.>of( + new SimpleEntry<>("server", new ServerVariable( + "No description provided", + "petstore", + new LinkedHashSet<>(Arrays.asList( + "petstore", + "qa-petstore", + "dev-petstore" + )) + )), + new SimpleEntry<>("port", new ServerVariable( + "No description provided", + "80", + new LinkedHashSet<>(Arrays.asList( + "80", + "8080" + )) + )) + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + ), + new ServerConfiguration( + "https://localhost:8080/{version}", + "The local server", + Stream.>of( + new SimpleEntry<>("version", new ServerVariable( + "No description provided", + "v2", + new LinkedHashSet<>(Arrays.asList( + "v1", + "v2" + )) + )) + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + ), + new ServerConfiguration( + "https://127.0.0.1/no_variable", + "The local server without variables", + new LinkedHashMap<>() ) - )); - put("port", new ServerVariable( - "No description provided", - "80", - new HashSet( - Arrays.asList( - "80", - "8080" - ) - ) - )); - }} - ), - new ServerConfiguration( - "https://localhost:8080/{version}", - "The local server", - new HashMap() {{ - put("version", new ServerVariable( - "No description provided", - "v2", - new HashSet( - Arrays.asList( - "v1", - "v2" - ) - ) - )); - }} - ), - new ServerConfiguration( - "https://127.0.0.1/no_variable", - "The local server without variables", - new HashMap() - ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - put("PetApi.addPet", new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io/v2", - "No description provided", - new HashMap() - ), + protected Map> operationServers; - new ServerConfiguration( - "http://path-server-test.petstore.local/v2", - "No description provided", - new HashMap() - ) + { + Map> operationServers = new HashMap<>(); + operationServers.put("PetApi.addPet", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new LinkedHashMap<>() + ), + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new LinkedHashMap<>() + ) ))); - put("PetApi.updatePet", new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io/v2", - "No description provided", - new HashMap() - ), + operationServers.put("PetApi.updatePet", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new LinkedHashMap<>() + ), + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new LinkedHashMap<>() + ) + ))); + this.operationServers = operationServers; + } - new ServerConfiguration( - "http://path-server-test.petstore.local/v2", - "No description provided", - new HashMap() - ) - ))); - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -195,7 +198,7 @@ public class ApiClient extends JavaTimeFormatter { setUserAgent("OpenAPI-Generator/1.0.0/java"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; if (authMap != null) { auth = authMap.get("petstore_auth"); @@ -247,7 +250,7 @@ public class ApiClient extends JavaTimeFormatter { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap(); + authenticationLookup = new HashMap<>(); } /** @@ -835,7 +838,7 @@ public class ApiClient extends JavaTimeFormatter { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; @@ -894,14 +897,13 @@ public class ApiClient extends JavaTimeFormatter { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -913,8 +915,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -934,8 +936,8 @@ public class ApiClient extends JavaTimeFormatter { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -1227,15 +1229,17 @@ public class ApiClient extends JavaTimeFormatter { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - serializeToString(body, formParams, contentType, isBodyNullable), - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + serializeToString(body, formParams, contentType, isBodyNullable), + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1252,7 +1256,7 @@ public class ApiClient extends JavaTimeFormatter { final int statusCode = response.getStatusInfo().getStatusCode(); // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (statusCode == Status.UNAUTHORIZED.getStatusCode()) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1423,10 +1427,10 @@ public class ApiClient extends JavaTimeFormatter { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index 24317dfe36a..8e72ba03553 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -64,7 +64,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -84,7 +84,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -193,12 +193,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 0a0eb17b606..493d0d99a0f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,42 +75,16 @@ public class AnotherFakeApi { */ public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { - Object localVarPostBody = client; - - // verify the required parameter 'client' is set + // Check required parameters if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); } - - // create path and map variables - String localVarPath = "/another-fake/dummy"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", "/another-fake/dummy", "PATCH", new ArrayList<>(), client, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/DefaultApi.java index 9088aa8da1f..03f7f512dbd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.FooGetDefaultResponse; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -72,37 +73,11 @@ public class DefaultApi { */ public ApiResponse fooGetWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/foo"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("DefaultApi.fooGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("DefaultApi.fooGet", "/foo", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java index 5b555dab325..a925510e6e3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -21,6 +21,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -81,38 +82,12 @@ public class FakeApi { */ public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/health"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeHealthGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeHealthGet", "/fake/health", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -143,38 +118,12 @@ public class FakeApi { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/boolean"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", "/fake/outer/boolean", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -205,38 +154,12 @@ public class FakeApi { */ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { - Object localVarPostBody = outerComposite; - - // create path and map variables - String localVarPath = "/fake/outer/composite"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", "/fake/outer/composite", "POST", new ArrayList<>(), outerComposite, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -267,38 +190,12 @@ public class FakeApi { */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/number"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", "/fake/outer/number", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -329,38 +226,12 @@ public class FakeApi { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/string"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("*/*"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", "/fake/outer/string", "POST", new ArrayList<>(), body, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Array of Enums @@ -389,38 +260,12 @@ public class FakeApi { */ public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake/array-of-enums"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("FakeApi.getArrayOfEnums", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.getArrayOfEnums", "/fake/array-of-enums", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * @@ -450,41 +295,16 @@ public class FakeApi { */ public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - Object localVarPostBody = fileSchemaTestClass; - - // verify the required parameter 'fileSchemaTestClass' is set + // Check required parameters if (fileSchemaTestClass == null) { throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema"); } - - // create path and map variables - String localVarPath = "/fake/body-with-file-schema"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", "/fake/body-with-file-schema", "PUT", new ArrayList<>(), fileSchemaTestClass, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * @@ -516,47 +336,24 @@ public class FakeApi { */ public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'query' is set + // Check required parameters if (query == null) { throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); } - - // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); } - - // create path and map variables - String localVarPath = "/fake/body-with-query-params"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "query", query) + ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", "/fake/body-with-query-params", "PUT", localVarQueryParams, user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * To test \"client\" model @@ -587,43 +384,17 @@ public class FakeApi { */ public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { - Object localVarPostBody = client; - - // verify the required parameter 'client' is set + // Check required parameters if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); } - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeApi.testClientModel", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("FakeApi.testClientModel", "/fake", "PATCH", new ArrayList<>(), client, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -681,83 +452,62 @@ public class FakeApi { */ 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 = null; - - // verify the required parameter 'number' is set + // Check required parameters if (number == null) { throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); } - - // verify the required parameter '_double' is set if (_double == null) { throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); } - - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } - - // verify the required parameter '_byte' is set if (_byte == null) { throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - - // create path and map variables - String localVarPath = "/fake"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (integer != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (integer != null) { localVarFormParams.put("integer", integer); -if (int32 != null) + } + if (int32 != null) { localVarFormParams.put("int32", int32); -if (int64 != null) + } + if (int64 != null) { localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) + } + localVarFormParams.put("number", number); + if (_float != null) { localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) + } + localVarFormParams.put("double", _double); + if (string != null) { localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) + } + localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); + localVarFormParams.put("byte", _byte); + if (binary != null) { localVarFormParams.put("binary", binary); -if (date != null) + } + if (date != null) { localVarFormParams.put("date", date); -if (dateTime != null) + } + if (dateTime != null) { localVarFormParams.put("dateTime", dateTime); -if (password != null) + } + if (password != null) { localVarFormParams.put("password", password); -if (paramCallback != null) + } + if (paramCallback != null) { localVarFormParams.put("callback", paramCallback); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "http_basic_test" }; - - return apiClient.invokeAPI("FakeApi.testEndpointParameters", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"http_basic_test"}; + return apiClient.invokeAPI("FakeApi.testEndpointParameters", "/fake", "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -804,103 +554,71 @@ if (paramCallback != null) */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); - if (enumHeaderStringArray != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (enumHeaderStringArray != null) { localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + } + if (enumHeaderString != null) { localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + } - - if (enumFormStringArray != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (enumFormStringArray != null) { localVarFormParams.put("enum_form_string_array", enumFormStringArray); -if (enumFormString != null) + } + if (enumFormString != null) { localVarFormParams.put("enum_form_string", enumFormString); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testEnumParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + return apiClient.invokeAPI("FakeApi.testEnumParameters", "/fake", "GET", localVarQueryParams, null, + localVarHeaderParams, new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + null, null, false); } private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'requiredStringGroup' is set + // Check required parameters if (requiredStringGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); } - - // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); } - - // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - - // create path and map variables - String localVarPath = "/fake"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "required_string_group", requiredStringGroup) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group)); - if (requiredBooleanGroup != null) - localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); -if (booleanGroup != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + if (booleanGroup != null) { localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); + } - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "bearer_test" }; - - return apiClient.invokeAPI("FakeApi.testGroupParameters", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"bearer_test"}; + return apiClient.invokeAPI("FakeApi.testGroupParameters", "/fake", "DELETE", localVarQueryParams, null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } @@ -1046,41 +764,16 @@ if (booleanGroup != null) */ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws ApiException { - Object localVarPostBody = requestBody; - - // verify the required parameter 'requestBody' is set + // Check required parameters if (requestBody == null) { throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } - - // create path and map variables - String localVarPath = "/fake/inline-additionalProperties"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", "/fake/inline-additionalProperties", "POST", new ArrayList<>(), requestBody, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * test json serialization of form data @@ -1112,50 +805,24 @@ if (booleanGroup != null) */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set + // Check required parameters if (param == null) { throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); } - - // verify the required parameter 'param2' is set if (param2 == null) { throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); } - - // create path and map variables - String localVarPath = "/fake/jsonFormData"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams.put("param", param); + localVarFormParams.put("param2", param2); - - - - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("FakeApi.testJsonFormData", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + return apiClient.invokeAPI("FakeApi.testJsonFormData", "/fake/jsonFormData", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + null, null, false); } /** * @@ -1193,65 +860,36 @@ if (param2 != null) */ 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 + // Check required parameters 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-parameters"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "pipe", pipe)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("multi", "pipe", pipe) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "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("FakeApi.testQueryParameterCollectionFormat", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", "/fake/test-query-parameters", "PUT", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 7dabf14a620..2c736ab8f8f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Client; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,42 +75,17 @@ public class FakeClassnameTags123Api { */ public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { - Object localVarPostBody = client; - - // verify the required parameter 'client' is set + // Check required parameters if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); } - - // create path and map variables - String localVarPath = "/fake_classname_test"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key_query" }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key_query"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", "/fake_classname_test", "PATCH", new ArrayList<>(), client, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java index f985d589a3f..77301195e02 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,6 +14,7 @@ import org.openapitools.client.model.Pet; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -75,40 +76,16 @@ public class PetApi { */ public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { - Object localVarPostBody = pet; - - // verify the required parameter 'pet' is set + // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } - - // create path and map variables - String localVarPath = "/pet"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; - - return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), pet, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -141,43 +118,26 @@ public class PetApi { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - if (apiKey != null) + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + if (apiKey != null) { localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + } - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", new ArrayList<>(), null, + localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -211,43 +171,22 @@ public class PetApi { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'status' is set + // Check required parameters if (status == null) { throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); } - - // create path and map variables - String localVarPath = "/pet/findByStatus"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "status", status) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -285,43 +224,22 @@ public class PetApi { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'tags' is set + // Check required parameters if (tags == null) { throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); } - - // create path and map variables - String localVarPath = "/pet/findByTags"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("csv", "tags", tags) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -357,43 +275,21 @@ public class PetApi { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -428,40 +324,16 @@ public class PetApi { */ public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { - Object localVarPostBody = pet; - - // verify the required parameter 'pet' is set + // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } - - // create path and map variables - String localVarPath = "/pet"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" }; - - return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), pet, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -496,45 +368,29 @@ public class PetApi { */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (name != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (name != null) { localVarFormParams.put("name", name); -if (status != null) + } + if (status != null) { localVarFormParams.put("status", status); + } - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null, false); } /** @@ -570,47 +426,30 @@ if (status != null) */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (_file != null) + } + if (_file != null) { localVarFormParams.put("file", _file); + } - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -646,52 +485,31 @@ if (_file != null) */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set + // Check required parameters if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - - // verify the required parameter 'requiredFile' is set if (requiredFile == null) { throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } - - // create path and map variables + + // Path parameters String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - if (additionalMetadata != null) + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { localVarFormParams.put("additionalMetadata", additionalMetadata); -if (requiredFile != null) - localVarFormParams.put("requiredFile", requiredFile); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; + } + localVarFormParams.put("requiredFile", requiredFile); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java index ae83b818043..2e85d6953a5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java @@ -12,6 +12,7 @@ import org.openapitools.client.model.Order; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -75,42 +76,20 @@ public class StoreApi { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + .replaceAll("\\{order_id}", apiClient.escapeString(orderId)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("StoreApi.deleteOrder", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Returns pet inventories by status @@ -139,37 +118,12 @@ public class StoreApi { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/inventory"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType> localVarReturnType = new GenericType>() {}; - - return apiClient.invokeAPI("StoreApi.getInventory", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + return apiClient.invokeAPI("StoreApi.getInventory", "/store/inventory", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** @@ -205,44 +159,21 @@ public class StoreApi { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set + // Check required parameters if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); } - - // create path and map variables + + // Path parameters String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Place an order for a pet @@ -275,42 +206,16 @@ public class StoreApi { */ public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { - Object localVarPostBody = order; - - // verify the required parameter 'order' is set + // Check required parameters if (order == null) { throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } - - // create path and map variables - String localVarPath = "/store/order"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("StoreApi.placeOrder", "/store/order", "POST", new ArrayList<>(), order, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index 769693bc7e4..ed938d93187 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -13,6 +13,7 @@ import org.openapitools.client.model.User; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -74,41 +75,16 @@ public class UserApi { */ public ApiResponse createUserWithHttpInfo(User user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } - - // create path and map variables - String localVarPath = "/user"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("UserApi.createUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Creates list of users with given input array @@ -138,41 +114,16 @@ public class UserApi { */ public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } - - // create path and map variables - String localVarPath = "/user/createWithArray"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Creates list of users with given input array @@ -202,41 +153,16 @@ public class UserApi { */ public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'user' is set + // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } - - // create path and map variables - String localVarPath = "/user/createWithList"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("UserApi.createUsersWithListInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Delete user @@ -268,42 +194,20 @@ public class UserApi { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.deleteUser", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Get user by user name @@ -338,44 +242,21 @@ public class UserApi { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; + .replaceAll("\\{username}", apiClient.escapeString(username)); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs user into the system @@ -410,50 +291,26 @@ public class UserApi { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); } - - // verify the required parameter 'password' is set if (password == null) { throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); } - - // create path and map variables - String localVarPath = "/user/login"; - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "username", username) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarContentType = apiClient.selectHeaderContentType(); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UserApi.loginUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI("UserApi.loginUser", "/user/login", "GET", localVarQueryParams, null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, localVarReturnType, false); } /** * Logs out current logged in user session @@ -481,36 +338,11 @@ public class UserApi { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/logout"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - 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("UserApi.logoutUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType(); + return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } /** * Updated user @@ -544,46 +376,22 @@ public class UserApi { */ public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { - Object localVarPostBody = user; - - // verify the required parameter 'username' is set + // Check required parameters if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - - // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } - - // create path and map variables + + // Path parameters String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + .replaceAll("\\{username}", apiClient.escapeString(username)); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarAccept = apiClient.selectHeaderAccept(); + String localVarContentType = apiClient.selectHeaderContentType("application/json"); + return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), user, + new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, + null, null, false); } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 9e376a44729..c7f44840819 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -25,8 +25,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -151,13 +149,13 @@ public class Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Cat", Cat.class); - mappings.put("Dog", Dog.class); - mappings.put("Animal", Animal.class); - JSON.registerDiscriminator(Animal.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Cat", Cat.class); + mappings.put("Dog", Dog.class); + mappings.put("Animal", Animal.class); + JSON.registerDiscriminator(Animal.class, "className", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index a4940ec1ec6..08081168ee6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly() { } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index a2679d903aa..d74f9a70f67 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -38,7 +38,7 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly() { } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index 337c357f30e..b52510668e4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -40,13 +40,13 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; public ArrayTest() { } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 12b32a246fd..60b84c4da78 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -92,7 +92,7 @@ public class Cat extends Animal { @JsonAnySetter public Cat putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -160,11 +160,11 @@ public class Cat extends Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Cat", Cat.class); - JSON.registerDiscriminator(Cat.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Cat", Cat.class); + JSON.registerDiscriminator(Cat.class, "className", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java index 3ac6ccd656d..e6d126868a3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java @@ -135,7 +135,7 @@ public class ChildCat extends ParentPet { @JsonAnySetter public ChildCat putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -205,11 +205,11 @@ public class ChildCat extends ParentPet { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ChildCat", ChildCat.class); + JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 8541cb00ed1..06456f92460 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -111,7 +111,7 @@ public class ComplexQuadrilateral { @JsonAnySetter public ComplexQuadrilateral putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index f0ad8bc6a8c..20b066546d1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -92,7 +92,7 @@ public class Dog extends Animal { @JsonAnySetter public Dog putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -160,11 +160,11 @@ public class Dog extends Animal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Dog", Dog.class); - JSON.registerDiscriminator(Dog.class, "className", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("Dog", Dog.class); + JSON.registerDiscriminator(Dog.class, "className", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java index f344f11ad05..ac0adc5d30f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java @@ -61,7 +61,7 @@ public class Drawing { private JsonNullable nullableShape = JsonNullable.undefined(); public static final String JSON_PROPERTY_SHAPES = "shapes"; - private List shapes = new ArrayList<>(); + private List shapes; public Drawing() { } @@ -195,7 +195,7 @@ public class Drawing { @JsonAnySetter public Drawing putAdditionalProperty(String key, Fruit value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 618d07b460a..db4d50934a8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -111,7 +111,7 @@ public class EnumArrays { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays() { } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 7dd69787f4f..28229b549b8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -111,7 +111,7 @@ public class EquilateralTriangle { @JsonAnySetter public EquilateralTriangle putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index fa760cf7ab3..2535ea9856c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -42,7 +42,7 @@ public class FileSchemaTestClass { private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass() { } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java index 6a129ce7dd5..0d6ac3ccd9c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java @@ -162,7 +162,7 @@ public class Fruit extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Fruit() { super("oneOf", Boolean.FALSE); @@ -201,12 +201,12 @@ public class Fruit extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Banana.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java index 72da8edfb43..4f555519330 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java @@ -164,7 +164,7 @@ public class FruitReq extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public FruitReq() { super("oneOf", Boolean.TRUE); @@ -208,12 +208,12 @@ public class FruitReq extends AbstractOpenApiSchema { return; } - if (JSON.isInstanceOf(AppleReq.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(AppleReq.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(BananaReq.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(BananaReq.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java index 2dc45f2acae..3ddffddec45 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java @@ -122,7 +122,7 @@ public class GmFruit extends AbstractOpenApiSchema { } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public GmFruit() { super("anyOf", Boolean.FALSE); @@ -161,12 +161,12 @@ public class GmFruit extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Banana.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index b5b983bf448..efc411bee63 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -25,8 +25,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; -import org.openapitools.client.model.ParentPet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -120,13 +118,13 @@ public class GrandparentAnimal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - mappings.put("ParentPet", ParentPet.class); - mappings.put("GrandparentAnimal", GrandparentAnimal.class); - JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ChildCat", ChildCat.class); + mappings.put("ParentPet", ParentPet.class); + mappings.put("GrandparentAnimal", GrandparentAnimal.class); + JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java index 4eaf73a35a7..752f009935d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java @@ -97,7 +97,7 @@ public class Mammal extends AbstractOpenApiSchema { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; Mammal newMammal = new Mammal(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("className"); switch (discriminatorValue) { case "Pig": @@ -215,7 +215,7 @@ public class Mammal extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Mammal() { super("oneOf", Boolean.FALSE); @@ -234,7 +234,7 @@ public class Mammal extends AbstractOpenApiSchema { @JsonAnySetter public Mammal putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -294,7 +294,7 @@ public class Mammal extends AbstractOpenApiSchema { }); JSON.registerDescendants(Mammal.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("Pig", Pig.class); mappings.put("whale", Whale.class); mappings.put("zebra", Zebra.class); @@ -317,17 +317,17 @@ public class Mammal extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Pig.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Pig.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Whale.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Whale.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Zebra.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index 7415b8ed01f..6b579273ce2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -85,7 +85,7 @@ public class NullableClass { private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; private JsonNullable> objectNullableProp = JsonNullable.>undefined(); @@ -556,7 +556,7 @@ public class NullableClass { @JsonAnySetter public NullableClass putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java index c2124244758..c6a8d3c70d8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java @@ -96,7 +96,7 @@ public class NullableShape extends AbstractOpenApiSchema { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; NullableShape newNullableShape = new NullableShape(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("shapeType"); switch (discriminatorValue) { case "Quadrilateral": @@ -186,7 +186,7 @@ public class NullableShape extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public NullableShape() { super("oneOf", Boolean.TRUE); @@ -205,7 +205,7 @@ public class NullableShape extends AbstractOpenApiSchema { @JsonAnySetter public NullableShape putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -258,7 +258,7 @@ public class NullableShape extends AbstractOpenApiSchema { }); JSON.registerDescendants(NullableShape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("Quadrilateral", Quadrilateral.class); mappings.put("Triangle", Triangle.class); mappings.put("NullableShape", NullableShape.class); @@ -285,12 +285,12 @@ public class NullableShape extends AbstractOpenApiSchema { return; } - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 4b597849b86..89a7b3433d0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -51,7 +51,7 @@ public class ObjectWithDeprecatedFields { private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields() { } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java index 1dcdfb52d1e..fe10e19e172 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java @@ -29,7 +29,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; @@ -67,7 +66,7 @@ public class ParentPet extends GrandparentAnimal { @JsonAnySetter public ParentPet putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -131,12 +130,12 @@ public class ParentPet extends GrandparentAnimal { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - mappings.put("ParentPet", ParentPet.class); - JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ChildCat", ChildCat.class); + mappings.put("ParentPet", ParentPet.class); + JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index b54202ff81f..3a8944d2c0a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -56,7 +56,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -182,6 +182,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java index e75900b1bcf..d93d4be006f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java @@ -96,7 +96,7 @@ public class Pig extends AbstractOpenApiSchema { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; Pig newPig = new Pig(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("className"); switch (discriminatorValue) { case "BasquePig": @@ -184,7 +184,7 @@ public class Pig extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Pig() { super("oneOf", Boolean.FALSE); @@ -203,7 +203,7 @@ public class Pig extends AbstractOpenApiSchema { @JsonAnySetter public Pig putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -256,7 +256,7 @@ public class Pig extends AbstractOpenApiSchema { }); JSON.registerDescendants(Pig.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("BasquePig", BasquePig.class); mappings.put("DanishPig", DanishPig.class); mappings.put("Pig", Pig.class); @@ -278,12 +278,12 @@ public class Pig extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(BasquePig.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(BasquePig.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(DanishPig.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(DanishPig.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java index 7f1a2f87366..3e5e890dc23 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -96,7 +96,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; Quadrilateral newQuadrilateral = new Quadrilateral(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("quadrilateralType"); switch (discriminatorValue) { case "ComplexQuadrilateral": @@ -184,7 +184,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Quadrilateral() { super("oneOf", Boolean.FALSE); @@ -203,7 +203,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { @JsonAnySetter public Quadrilateral putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -256,7 +256,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { }); JSON.registerDescendants(Quadrilateral.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("ComplexQuadrilateral", ComplexQuadrilateral.class); mappings.put("SimpleQuadrilateral", SimpleQuadrilateral.class); mappings.put("Quadrilateral", Quadrilateral.class); @@ -278,12 +278,12 @@ public class Quadrilateral extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 65e9c9c120b..5aecc750295 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -111,7 +111,7 @@ public class ScaleneTriangle { @JsonAnySetter public ScaleneTriangle putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java index 6a4229f69fa..c685a630de6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java @@ -96,7 +96,7 @@ public class Shape extends AbstractOpenApiSchema { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; Shape newShape = new Shape(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("shapeType"); switch (discriminatorValue) { case "Quadrilateral": @@ -184,7 +184,7 @@ public class Shape extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Shape() { super("oneOf", Boolean.FALSE); @@ -203,7 +203,7 @@ public class Shape extends AbstractOpenApiSchema { @JsonAnySetter public Shape putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -256,7 +256,7 @@ public class Shape extends AbstractOpenApiSchema { }); JSON.registerDescendants(Shape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("Quadrilateral", Quadrilateral.class); mappings.put("Triangle", Triangle.class); mappings.put("Shape", Shape.class); @@ -278,12 +278,12 @@ public class Shape extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 9e993d94de2..e7058ad5a04 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -96,7 +96,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; ShapeOrNull newShapeOrNull = new ShapeOrNull(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("shapeType"); switch (discriminatorValue) { case "Quadrilateral": @@ -186,7 +186,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public ShapeOrNull() { super("oneOf", Boolean.TRUE); @@ -205,7 +205,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { @JsonAnySetter public ShapeOrNull putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -258,7 +258,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { }); JSON.registerDescendants(ShapeOrNull.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("Quadrilateral", Quadrilateral.class); mappings.put("Triangle", Triangle.class); mappings.put("ShapeOrNull", ShapeOrNull.class); @@ -285,12 +285,12 @@ public class ShapeOrNull extends AbstractOpenApiSchema { return; } - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index ebe8b033d8c..db08e735e6a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -111,7 +111,7 @@ public class SimpleQuadrilateral { @JsonAnySetter public SimpleQuadrilateral putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java index c4c5687cf01..08e069cde17 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java @@ -97,7 +97,7 @@ public class Triangle extends AbstractOpenApiSchema { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; Triangle newTriangle = new Triangle(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("triangleType"); switch (discriminatorValue) { case "EquilateralTriangle": @@ -215,7 +215,7 @@ public class Triangle extends AbstractOpenApiSchema { } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map schemas = new HashMap<>(); public Triangle() { super("oneOf", Boolean.FALSE); @@ -234,7 +234,7 @@ public class Triangle extends AbstractOpenApiSchema { @JsonAnySetter public Triangle putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; @@ -294,7 +294,7 @@ public class Triangle extends AbstractOpenApiSchema { }); JSON.registerDescendants(Triangle.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); mappings.put("EquilateralTriangle", EquilateralTriangle.class); mappings.put("IsoscelesTriangle", IsoscelesTriangle.class); mappings.put("ScaleneTriangle", ScaleneTriangle.class); @@ -317,17 +317,17 @@ public class Triangle extends AbstractOpenApiSchema { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(EquilateralTriangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(EquilateralTriangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(IsoscelesTriangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(IsoscelesTriangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(ScaleneTriangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(ScaleneTriangle.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index 28287ba639c..0f10ff57b24 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -149,7 +149,7 @@ public class Zebra { @JsonAnySetter public Zebra putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.github/workflows/python.yml index 28a13b8f38e..3cef12d7476 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.github/workflows/python.yml @@ -15,12 +15,12 @@ jobs: matrix: python-version: ["3.7", "3.8", "3.9", "3.10"] - steps:s + steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }}s + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip @@ -34,4 +34,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest \ No newline at end of file + pytest diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES index c2f43506f98..970be2c4e66 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES @@ -18,6 +18,7 @@ docs/Capitalization.md docs/Cat.md docs/CatAllOf.md docs/Category.md +docs/CircularReferenceModel.md docs/ClassModel.md docs/Client.md docs/Color.md @@ -34,11 +35,13 @@ docs/FakeApi.md docs/FakeClassnameTags123Api.md docs/File.md docs/FileSchemaTestClass.md +docs/FirstRef.md docs/Foo.md docs/FooGetDefaultResponse.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md +docs/InnerDictWithProperty.md docs/List.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -55,10 +58,12 @@ docs/OuterEnumDefaultValue.md docs/OuterEnumInteger.md docs/OuterEnumIntegerDefaultValue.md docs/OuterObjectWithEnumProperty.md +docs/ParentWithOptionalDict.md docs/Pet.md docs/PetApi.md docs/Pig.md docs/ReadOnlyFirst.md +docs/SecondRef.md docs/SelfReferenceModel.md docs/SingleRefType.md docs/SpecialCharacterEnum.md @@ -97,6 +102,7 @@ petstore_api/models/capitalization.py petstore_api/models/cat.py petstore_api/models/cat_all_of.py petstore_api/models/category.py +petstore_api/models/circular_reference_model.py petstore_api/models/class_model.py petstore_api/models/client.py petstore_api/models/color.py @@ -110,11 +116,13 @@ petstore_api/models/enum_class.py petstore_api/models/enum_test.py petstore_api/models/file.py petstore_api/models/file_schema_test_class.py +petstore_api/models/first_ref.py petstore_api/models/foo.py petstore_api/models/foo_get_default_response.py petstore_api/models/format_test.py petstore_api/models/has_only_read_only.py petstore_api/models/health_check_result.py +petstore_api/models/inner_dict_with_property.py petstore_api/models/list.py petstore_api/models/map_test.py petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -131,9 +139,11 @@ petstore_api/models/outer_enum_default_value.py petstore_api/models/outer_enum_integer.py petstore_api/models/outer_enum_integer_default_value.py petstore_api/models/outer_object_with_enum_property.py +petstore_api/models/parent_with_optional_dict.py petstore_api/models/pet.py petstore_api/models/pig.py petstore_api/models/read_only_first.py +petstore_api/models/second_ref.py petstore_api/models/self_reference_model.py petstore_api/models/single_ref_type.py petstore_api/models/special_character_enum.py @@ -144,6 +154,7 @@ petstore_api/models/user.py petstore_api/models/with_nested_one_of.py petstore_api/rest.py petstore_api/signing.py +pyproject.toml requirements.txt setup.cfg setup.py diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md index d9db0c5fce3..e26d9f33e89 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md @@ -40,6 +40,10 @@ Then import the package: import petstore_api ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: @@ -84,6 +88,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_any_type_request_body**](docs/FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | @@ -141,6 +146,7 @@ Class | Method | HTTP request | Description - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) - [Category](docs/Category.md) + - [CircularReferenceModel](docs/CircularReferenceModel.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) - [Color](docs/Color.md) @@ -154,11 +160,13 @@ Class | Method | HTTP request | Description - [EnumTest](docs/EnumTest.md) - [File](docs/File.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FirstRef](docs/FirstRef.md) - [Foo](docs/Foo.md) - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) + - [InnerDictWithProperty](docs/InnerDictWithProperty.md) - [List](docs/List.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -175,9 +183,11 @@ Class | Method | HTTP request | Description - [OuterEnumInteger](docs/OuterEnumInteger.md) - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md) + - [ParentWithOptionalDict](docs/ParentWithOptionalDict.md) - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SecondRef](docs/SecondRef.md) - [SelfReferenceModel](docs/SelfReferenceModel.md) - [SingleRefType](docs/SingleRefType.md) - [SpecialCharacterEnum](docs/SpecialCharacterEnum.md) diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/CircularReferenceModel.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/CircularReferenceModel.md new file mode 100644 index 00000000000..d5e97934d2b --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/CircularReferenceModel.md @@ -0,0 +1,29 @@ +# CircularReferenceModel + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | | [optional] +**nested** | [**FirstRef**](FirstRef.md) | | [optional] + +## Example + +```python +from petstore_api.models.circular_reference_model import CircularReferenceModel + +# TODO update the JSON string below +json = "{}" +# create an instance of CircularReferenceModel from a JSON string +circular_reference_model_instance = CircularReferenceModel.from_json(json) +# print the JSON string representation of the object +print CircularReferenceModel.to_json() + +# convert the object into a dict +circular_reference_model_dict = circular_reference_model_instance.to_dict() +# create an instance of CircularReferenceModel from a dict +circular_reference_model_form_dict = circular_reference_model.from_dict(circular_reference_model_dict) +``` +[[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/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md index c819e37193f..6c225b2426f 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fake_any_type_request_body**](FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | @@ -23,6 +24,66 @@ Method | HTTP request | Description [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | +# **fake_any_type_request_body** +> fake_any_type_request_body(body=body) + +test any type request body + +### Example + +```python +from __future__ import print_function +import time +import os +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +async with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = None # object | (optional) + + try: + # test any type request body + await api_instance.fake_any_type_request_body(body=body) + except Exception as e: + print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **object**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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_health_get** > HealthCheckResult fake_health_get() @@ -551,7 +612,7 @@ configuration = petstore_api.Configuration( async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) - body = 'body_example' # str | image to upload + body = None # bytearray | image to upload try: await api_instance.test_body_with_binary(body) @@ -563,7 +624,7 @@ async with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **str**| image to upload | + **body** | **bytearray**| image to upload | ### Return type @@ -873,13 +934,13 @@ async with petstore_api.ApiClient(configuration) as api_client: number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None - byte = 'byte_example' # str | None + byte = None # bytearray | None integer = 56 # int | None (optional) int32 = 56 # int | None (optional) int64 = 56 # int | None (optional) float = 3.4 # float | None (optional) string = 'string_example' # str | None (optional) - binary = 'binary_example' # str | None (optional) + binary = None # bytearray | None (optional) var_date = '2013-10-20' # date | None (optional) date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) @@ -899,13 +960,13 @@ Name | Type | Description | Notes **number** | **float**| None | **double** | **float**| None | **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | + **byte** | **bytearray**| None | **integer** | **int**| None | [optional] **int32** | **int**| None | [optional] **int64** | **int**| None | [optional] **float** | **float**| None | [optional] **string** | **str**| None | [optional] - **binary** | **str**| None | [optional] + **binary** | **bytearray**| None | [optional] **var_date** | **date**| None | [optional] **date_time** | **datetime**| None | [optional] **password** | **str**| None | [optional] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FirstRef.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FirstRef.md new file mode 100644 index 00000000000..b5e7ab766b4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FirstRef.md @@ -0,0 +1,29 @@ +# FirstRef + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**self_ref** | [**SecondRef**](SecondRef.md) | | [optional] + +## Example + +```python +from petstore_api.models.first_ref import FirstRef + +# TODO update the JSON string below +json = "{}" +# create an instance of FirstRef from a JSON string +first_ref_instance = FirstRef.from_json(json) +# print the JSON string representation of the object +print FirstRef.to_json() + +# convert the object into a dict +first_ref_dict = first_ref_instance.to_dict() +# create an instance of FirstRef from a dict +first_ref_form_dict = first_ref.from_dict(first_ref_dict) +``` +[[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/openapi3/client/petstore/python-nextgen-aiohttp/docs/FormatTest.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FormatTest.md index 5ea09e1908a..aa81e585952 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FormatTest.md @@ -12,8 +12,9 @@ Name | Type | Description | Notes **double** | **float** | | [optional] **decimal** | **decimal.Decimal** | | [optional] **string** | **str** | | [optional] -**byte** | **str** | | [optional] -**binary** | **str** | | [optional] +**string_with_double_quote_pattern** | **str** | | [optional] +**byte** | **bytearray** | | [optional] +**binary** | **bytearray** | | [optional] **var_date** | **date** | | **date_time** | **datetime** | | [optional] **uuid** | **str** | | [optional] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/InnerDictWithProperty.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/InnerDictWithProperty.md new file mode 100644 index 00000000000..45d76ad458c --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/InnerDictWithProperty.md @@ -0,0 +1,28 @@ +# InnerDictWithProperty + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**a_property** | **object** | | [optional] + +## Example + +```python +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + +# TODO update the JSON string below +json = "{}" +# create an instance of InnerDictWithProperty from a JSON string +inner_dict_with_property_instance = InnerDictWithProperty.from_json(json) +# print the JSON string representation of the object +print InnerDictWithProperty.to_json() + +# convert the object into a dict +inner_dict_with_property_dict = inner_dict_with_property_instance.to_dict() +# create an instance of InnerDictWithProperty from a dict +inner_dict_with_property_form_dict = inner_dict_with_property.from_dict(inner_dict_with_property_dict) +``` +[[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/openapi3/client/petstore/python-nextgen-aiohttp/docs/ParentWithOptionalDict.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ParentWithOptionalDict.md new file mode 100644 index 00000000000..04bf9494201 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/ParentWithOptionalDict.md @@ -0,0 +1,28 @@ +# ParentWithOptionalDict + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_dict** | [**Dict[str, InnerDictWithProperty]**](InnerDictWithProperty.md) | | [optional] + +## Example + +```python +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict + +# TODO update the JSON string below +json = "{}" +# create an instance of ParentWithOptionalDict from a JSON string +parent_with_optional_dict_instance = ParentWithOptionalDict.from_json(json) +# print the JSON string representation of the object +print ParentWithOptionalDict.to_json() + +# convert the object into a dict +parent_with_optional_dict_dict = parent_with_optional_dict_instance.to_dict() +# create an instance of ParentWithOptionalDict from a dict +parent_with_optional_dict_form_dict = parent_with_optional_dict.from_dict(parent_with_optional_dict_dict) +``` +[[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/openapi3/client/petstore/python-nextgen-aiohttp/docs/PetApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/PetApi.md index efeab229b1b..c63c0c6ec48 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/PetApi.md @@ -1176,7 +1176,7 @@ async with petstore_api.ApiClient(configuration) as api_client: api_instance = petstore_api.PetApi(api_client) pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) - file = 'file_example' # str | file to upload (optional) + file = None # bytearray | file to upload (optional) try: # uploads an image @@ -1193,7 +1193,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet to update | **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **str**| file to upload | [optional] + **file** | **bytearray**| file to upload | [optional] ### Return type @@ -1250,7 +1250,7 @@ async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.PetApi(api_client) pet_id = 56 # int | ID of pet to update - required_file = 'required_file_example' # str | file to upload + required_file = None # bytearray | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) try: @@ -1267,7 +1267,7 @@ async with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet to update | - **required_file** | **str**| file to upload | + **required_file** | **bytearray**| file to upload | **additional_metadata** | **str**| Additional data to pass to server | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SecondRef.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SecondRef.md new file mode 100644 index 00000000000..e6fb1e2d4f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/SecondRef.md @@ -0,0 +1,29 @@ +# SecondRef + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**circular_ref** | [**CircularReferenceModel**](CircularReferenceModel.md) | | [optional] + +## Example + +```python +from petstore_api.models.second_ref import SecondRef + +# TODO update the JSON string below +json = "{}" +# create an instance of SecondRef from a JSON string +second_ref_instance = SecondRef.from_json(json) +# print the JSON string representation of the object +print SecondRef.to_json() + +# convert the object into a dict +second_ref_dict = second_ref_instance.to_dict() +# create an instance of SecondRef from a dict +second_ref_form_dict = second_ref.from_dict(second_ref_dict) +``` +[[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/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/__init__.py index 2b6fe534d7b..417db16491d 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/__init__.py @@ -8,12 +8,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - __version__ = "1.0.0" # import apis into sdk package @@ -49,6 +49,7 @@ from petstore_api.models.capitalization import Capitalization from petstore_api.models.cat import Cat from petstore_api.models.cat_all_of import CatAllOf from petstore_api.models.category import Category +from petstore_api.models.circular_reference_model import CircularReferenceModel from petstore_api.models.class_model import ClassModel from petstore_api.models.client import Client from petstore_api.models.color import Color @@ -62,11 +63,13 @@ from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_test import EnumTest from petstore_api.models.file import File from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.first_ref import FirstRef from petstore_api.models.foo import Foo from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.list import List from petstore_api.models.map_test import MapTest from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass @@ -83,9 +86,11 @@ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.second_ref import SecondRef from petstore_api.models.self_reference_model import SelfReferenceModel from petstore_api.models.single_ref_type import SingleRefType from petstore_api.models.special_character_enum import SpecialCharacterEnum diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/__init__.py index bc45197c40f..7a2616975a2 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/__init__.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - # flake8: noqa # import apis into api package @@ -10,3 +8,4 @@ from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi + diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/another_fake_api.py index 07acb105845..e03a60ce0ef 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/another_fake_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/default_api.py index 4a3ef582a87..c497aac8916 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/default_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py index 6d8084aa5e8..d6e1bf1e559 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError @@ -22,7 +22,7 @@ from datetime import date, datetime from pydantic import Field, StrictBool, StrictInt, StrictStr, confloat, conint, conlist, constr, validator -from typing import Dict, Optional +from typing import Any, Dict, Optional from petstore_api.models.client import Client from petstore_api.models.file_schema_test_class import FileSchemaTestClass @@ -51,6 +51,155 @@ class FakeApi(object): api_client = ApiClient.get_default() self.api_client = api_client + @overload + async def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, **kwargs) -> None: # noqa: E501 + ... + + @overload + def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, async_req: Optional[bool]=True, **kwargs) -> None: # noqa: E501 + ... + + @validate_arguments + def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]: # noqa: E501 + """test any type request body # 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_any_type_request_body(body, async_req=True) + >>> result = thread.get() + + :param body: + :type body: object + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :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: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if async_req is not None: + kwargs['async_req'] = async_req + return self.fake_any_type_request_body_with_http_info(body, **kwargs) # noqa: E501 + + @validate_arguments + def fake_any_type_request_body_with_http_info(self, body : Optional[Dict[str, Any]] = None, **kwargs): # noqa: E501 + """test any type request body # 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_any_type_request_body_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: + :type body: object + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :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. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'body' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_any_type_request_body" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['body']: + _body_params = _params['body'] + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/fake/any_type_body', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @overload async def fake_health_get(self, **kwargs) -> HealthCheckResult: # noqa: E501 ... @@ -1161,7 +1310,7 @@ class FakeApi(object): >>> result = thread.get() :param body: image to upload (required) - :type body: str + :type body: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1194,7 +1343,7 @@ class FakeApi(object): >>> result = thread.get() :param body: image to upload (required) - :type body: str + :type body: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -1911,15 +2060,15 @@ class FakeApi(object): _request_auth=_params.get('_request_auth')) @overload - async def test_endpoint_parameters(self, number : Annotated[confloat(ge=543.2, le=32.1), Field(..., description="None")], double : Annotated[confloat(ge=123.4, le=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(ge=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs) -> None: # noqa: E501 + async def test_endpoint_parameters(self, number : Annotated[confloat(le=543.2, ge=32.1), Field(..., description="None")], double : Annotated[confloat(le=123.4, ge=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(le=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs) -> None: # noqa: E501 ... @overload - def test_endpoint_parameters(self, number : Annotated[confloat(ge=543.2, le=32.1), Field(..., description="None")], double : Annotated[confloat(ge=123.4, le=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(ge=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, async_req: Optional[bool]=True, **kwargs) -> None: # noqa: E501 + def test_endpoint_parameters(self, number : Annotated[confloat(le=543.2, ge=32.1), Field(..., description="None")], double : Annotated[confloat(le=123.4, ge=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(le=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, async_req: Optional[bool]=True, **kwargs) -> None: # noqa: E501 ... @validate_arguments - def test_endpoint_parameters(self, number : Annotated[confloat(ge=543.2, le=32.1), Field(..., description="None")], double : Annotated[confloat(ge=123.4, le=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(ge=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]: # noqa: E501 + def test_endpoint_parameters(self, number : Annotated[confloat(le=543.2, ge=32.1), Field(..., description="None")], double : Annotated[confloat(le=123.4, ge=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(le=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]: # noqa: E501 """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 @@ -1936,7 +2085,7 @@ class FakeApi(object): :param pattern_without_delimiter: None (required) :type pattern_without_delimiter: str :param byte: None (required) - :type byte: str + :type byte: bytearray :param integer: None :type integer: int :param int32: None @@ -1948,7 +2097,7 @@ class FakeApi(object): :param string: None :type string: str :param binary: None - :type binary: str + :type binary: bytearray :param var_date: None :type var_date: date :param date_time: None @@ -1978,7 +2127,7 @@ class FakeApi(object): return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, var_date, date_time, password, param_callback, **kwargs) # noqa: E501 @validate_arguments - def test_endpoint_parameters_with_http_info(self, number : Annotated[confloat(ge=543.2, le=32.1), Field(..., description="None")], double : Annotated[confloat(ge=123.4, le=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(ge=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs): # noqa: E501 + def test_endpoint_parameters_with_http_info(self, number : Annotated[confloat(le=543.2, ge=32.1), Field(..., description="None")], double : Annotated[confloat(le=123.4, ge=67.8), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(le=987.6)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs): # noqa: E501 """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 @@ -1995,7 +2144,7 @@ class FakeApi(object): :param pattern_without_delimiter: None (required) :type pattern_without_delimiter: str :param byte: None (required) - :type byte: str + :type byte: bytearray :param integer: None :type integer: int :param int32: None @@ -2007,7 +2156,7 @@ class FakeApi(object): :param string: None :type string: str :param binary: None - :type binary: str + :type binary: bytearray :param var_date: None :type var_date: date :param date_time: None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_classname_tags123_api.py index b3764536e1d..7443f859ed3 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_classname_tags123_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/pet_api.py index cf76764956f..afc8cc96162 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/pet_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError @@ -1145,7 +1145,7 @@ class PetApi(object): :param additional_metadata: Additional data to pass to server :type additional_metadata: str :param file: file to upload - :type file: str + :type file: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1182,7 +1182,7 @@ class PetApi(object): :param additional_metadata: Additional data to pass to server :type additional_metadata: str :param file: file to upload - :type file: str + :type file: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -1316,7 +1316,7 @@ class PetApi(object): :param pet_id: ID of pet to update (required) :type pet_id: int :param required_file: file to upload (required) - :type required_file: str + :type required_file: bytearray :param additional_metadata: Additional data to pass to server :type additional_metadata: str :param async_req: Whether to execute the request asynchronously. @@ -1353,7 +1353,7 @@ class PetApi(object): :param pet_id: ID of pet to update (required) :type pet_id: int :param required_file: file to upload (required) - :type required_file: str + :type required_file: bytearray :param additional_metadata: Additional data to pass to server :type additional_metadata: str :param async_req: Whether to execute the request asynchronously. diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/store_api.py index 1a68a5fd667..92289931c84 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/store_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/user_api.py index 7a5e957f01b..66d311856a9 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/user_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api_client.py index fb0ecb5301c..c75ef6f2ad3 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api_client.py @@ -1,14 +1,16 @@ # 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import import atexit import datetime @@ -36,10 +38,6 @@ class ApiClient(object): 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 @@ -65,7 +63,7 @@ class ApiClient(object): def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): - # use default configuraiton if none is provided + # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration @@ -231,7 +229,9 @@ class ApiClient(object): response_type = response_types_map.get(str(response_data.status), None) - if response_type not in ["file", "bytes"]: + if response_type == "bytearray": + response_data.data = response_data.data + else: match = None content_type = response_data.getheader('content-type') if content_type is not None: @@ -240,8 +240,9 @@ class ApiClient(object): response_data.data = response_data.data.decode(encoding) # deserialize response data - - if response_type: + if response_type == "bytearray": + return_data = response_data.data + elif response_type: return_data = self.deserialize(response_data, response_type) else: return_data = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/configuration.py index 12e9a7ef799..ed439f7f5af 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/configuration.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import copy import logging import sys @@ -20,7 +20,6 @@ import urllib3 import http.client as httplib from petstore_api.exceptions import ApiValueError - JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', @@ -28,10 +27,7 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { } class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. + """This class contains various settings of the API client. :param host: Base url. :param api_key: Dict to store API key(s). diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/exceptions.py index b81fd7505ff..cb957db48b9 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/exceptions.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/__init__.py index fe6f65f77ba..212f2096311 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/__init__.py @@ -7,12 +7,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - # import models into model package from petstore_api.models.additional_properties_class import AdditionalPropertiesClass from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef @@ -28,6 +28,7 @@ from petstore_api.models.capitalization import Capitalization from petstore_api.models.cat import Cat from petstore_api.models.cat_all_of import CatAllOf from petstore_api.models.category import Category +from petstore_api.models.circular_reference_model import CircularReferenceModel from petstore_api.models.class_model import ClassModel from petstore_api.models.client import Client from petstore_api.models.color import Color @@ -41,11 +42,13 @@ from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_test import EnumTest from petstore_api.models.file import File from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.first_ref import FirstRef from petstore_api.models.foo import Foo from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.list import List from petstore_api.models.map_test import MapTest from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass @@ -62,9 +65,11 @@ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.second_ref import SecondRef from petstore_api.models.self_reference_model import SelfReferenceModel from petstore_api.models.single_ref_type import SingleRefType from petstore_api.models.special_character_enum import SpecialCharacterEnum diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py index 77d3e3ed178..34cead3a8a3 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/additional_properties_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Dict, Optional from pydantic import BaseModel, StrictStr class AdditionalPropertiesClass(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + AdditionalPropertiesClass """ map_property: Optional[Dict[str, StrictStr]] = None map_of_map_property: Optional[Dict[str, Dict[str, StrictStr]]] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py index 876a78a8f96..c6826c1a651 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/all_of_with_single_ref.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -17,17 +19,16 @@ import re # noqa: F401 import json -from typing import Any, Optional +from typing import Optional from pydantic import BaseModel, Field, StrictStr +from petstore_api.models.single_ref_type import SingleRefType class AllOfWithSingleRef(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + AllOfWithSingleRef """ username: Optional[StrictStr] = None - single_ref_type: Optional[Any] = Field(None, alias="SingleRefType") + single_ref_type: Optional[SingleRefType] = Field(None, alias="SingleRefType") __properties = ["username", "SingleRefType"] class Config: @@ -53,9 +54,6 @@ class AllOfWithSingleRef(BaseModel): exclude={ }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of single_ref_type - if self.single_ref_type: - _dict['SingleRefType'] = self.single_ref_type.to_dict() return _dict @classmethod @@ -69,7 +67,7 @@ class AllOfWithSingleRef(BaseModel): _obj = AllOfWithSingleRef.parse_obj({ "username": obj.get("username"), - "single_ref_type": SingleRefType.from_dict(obj.get("SingleRefType")) if obj.get("SingleRefType") is not None else None + "single_ref_type": obj.get("SingleRefType") }) return _obj diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py index 582668b4f5f..5bdd2d93816 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/animal.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class Animal(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Animal """ class_name: StrictStr = Field(..., alias="className") color: Optional[StrictStr] = 'red' diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_color.py index 2a44d37581b..61dffbb4c50 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_color.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -24,11 +26,10 @@ from pydantic import StrictStr, Field ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] class AnyOfColor(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ + Any of RGB array, RGBA array, or hex string. + """ + # data type: List[int] anyof_schema_1_validator: Optional[conlist(conint(strict=True, le=255, ge=0), max_items=3, min_items=3)] = Field(None, description="RGB three element array with values 0-255.") # data type: List[int] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py index d96f44bfdf8..e9e97b7d404 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/any_of_pig.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -26,11 +28,10 @@ from pydantic import StrictStr, Field ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] class AnyOfPig(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ + AnyOfPig + """ + # data type: BasquePig anyof_schema_1_validator: Optional[BasquePig] = None # data type: DanishPig diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py index 8b6ca41d617..26f3025fb3a 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/api_response.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class ApiResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ApiResponse """ code: Optional[StrictInt] = None type: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py index a023c9c0d0c..4593b477f59 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_array_of_number_only.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import List, Optional from pydantic import BaseModel, Field, conlist class ArrayOfArrayOfNumberOnly(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ArrayOfArrayOfNumberOnly """ array_array_number: Optional[conlist(conlist(float))] = Field(None, alias="ArrayArrayNumber") __properties = ["ArrayArrayNumber"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py index ff80adc5878..9a03e3150aa 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_of_number_only.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import List, Optional from pydantic import BaseModel, Field, conlist class ArrayOfNumberOnly(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ArrayOfNumberOnly """ array_number: Optional[conlist(float)] = Field(None, alias="ArrayNumber") __properties = ["ArrayNumber"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py index c526a25201a..021c38893c6 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/array_test.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, StrictInt, StrictStr, conlist from petstore_api.models.read_only_first import ReadOnlyFirst class ArrayTest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ArrayTest """ array_of_string: Optional[conlist(StrictStr, max_items=3, min_items=0)] = None array_array_of_integer: Optional[conlist(conlist(StrictInt))] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py index 18c8b241522..7a9bc1624e2 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/basque_pig.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ import json from pydantic import BaseModel, Field, StrictStr class BasquePig(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + BasquePig """ class_name: StrictStr = Field(..., alias="className") color: StrictStr = ... diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py index 800d22c2360..64518b99447 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/capitalization.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class Capitalization(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Capitalization """ small_camel: Optional[StrictStr] = Field(None, alias="smallCamel") capital_camel: Optional[StrictStr] = Field(None, alias="CapitalCamel") diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py index c9070f52b9b..0f1ece68548 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, StrictBool from petstore_api.models.animal import Animal class Cat(Animal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Cat """ declawed: Optional[StrictBool] = None __properties = ["className", "color", "declawed"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py index f6de765293b..7fd50e58975 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/cat_all_of.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictBool class CatAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CatAllOf """ declawed: Optional[StrictBool] = None __properties = ["declawed"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py index 226caf6c360..e738609efd5 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/category.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class Category(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Category """ id: Optional[StrictInt] = None name: StrictStr = ... diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/circular_reference_model.py new file mode 100644 index 00000000000..3a03dad4ddd --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/circular_reference_model.py @@ -0,0 +1,75 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictInt + +class CircularReferenceModel(BaseModel): + """ + CircularReferenceModel + """ + size: Optional[StrictInt] = None + nested: Optional[FirstRef] = None + __properties = ["size", "nested"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CircularReferenceModel: + """Create an instance of CircularReferenceModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of nested + if self.nested: + _dict['nested'] = self.nested.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CircularReferenceModel: + """Create an instance of CircularReferenceModel from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return CircularReferenceModel.parse_obj(obj) + + _obj = CircularReferenceModel.parse_obj({ + "size": obj.get("size"), + "nested": FirstRef.from_dict(obj.get("nested")) if obj.get("nested") is not None else None + }) + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py index 5f40800b9c0..04cd03eb71f 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/class_model.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class ClassModel(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Model for testing model with \"_class\" property """ var_class: Optional[StrictStr] = Field(None, alias="_class") __properties = ["_class"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py index cc651168676..793b26fab96 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/client.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class Client(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Client """ client: Optional[StrictStr] = None __properties = ["client"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/color.py index 45d2d0d8f43..2cc4abc9757 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/color.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -24,10 +26,8 @@ from pydantic import StrictStr, Field COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] class Color(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + RGB array, RGBA array, or hex string. """ # data type: List[int] oneof_schema_1_validator: Optional[conlist(conint(strict=True, le=255, ge=0), max_items=3, min_items=3)] = Field(None, description="RGB three element array with values 0-255.") diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py index 8dd221a3d3c..1e79f3db26e 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/danish_pig.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ import json from pydantic import BaseModel, Field, StrictInt, StrictStr class DanishPig(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DanishPig """ class_name: StrictStr = Field(..., alias="className") size: StrictInt = ... diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py index 2d1ad0d9b7c..1b17a9aec47 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/deprecated_object.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class DeprecatedObject(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DeprecatedObject """ name: Optional[StrictStr] = None __properties = ["name"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py index 11cc128ea9c..03b803d8788 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, StrictStr from petstore_api.models.animal import Animal class Dog(Animal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Dog """ breed: Optional[StrictStr] = None __properties = ["className", "color", "breed"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py index 8befb96f847..9fa8cea2d48 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dog_all_of.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class DogAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DogAllOf """ breed: Optional[StrictStr] = None __properties = ["breed"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py index b91cc8103b6..47cc18f1a12 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/dummy_model.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class DummyModel(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DummyModel """ category: Optional[StrictStr] = None self_ref: Optional[SelfReferenceModel] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py index 1421b202998..a3665c53ded 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_arrays.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import List, Optional from pydantic import BaseModel, StrictStr, conlist, validator class EnumArrays(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + EnumArrays """ just_symbol: Optional[StrictStr] = None array_enum: Optional[conlist(StrictStr)] = None @@ -34,18 +34,17 @@ class EnumArrays(BaseModel): def just_symbol_validate_enum(cls, v): if v is None: return v - if v not in ('>=', '$'): - raise ValueError("must validate the enum values ('>=', '$')") + raise ValueError("must be one of enum values ('>=', '$')") return v @validator('array_enum') def array_enum_validate_enum(cls, v): if v is None: return v - - if v not in ('fish', 'crab'): - raise ValueError("must validate the enum values ('fish', 'crab')") + for i in v: + if i not in ('fish', 'crab'): + raise ValueError("each list item must be one of ('fish', 'crab')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_class.py index 9fd2fcc13cd..8f013917f4c 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class EnumClass(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + EnumClass """ """ allowed enum values """ - ABC = '_abc' MINUS_EFG = '-efg' LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS = '(xyz)' diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py index c7cb02c5e52..fc634228f93 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/enum_test.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -25,10 +27,8 @@ from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue class EnumTest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + EnumTest """ enum_string: Optional[StrictStr] = None enum_string_required: StrictStr = ... @@ -45,42 +45,38 @@ class EnumTest(BaseModel): def enum_string_validate_enum(cls, v): if v is None: return v - if v not in ('UPPER', 'lower', ''): - raise ValueError("must validate the enum values ('UPPER', 'lower', '')") + raise ValueError("must be one of enum values ('UPPER', 'lower', '')") return v @validator('enum_string_required') def enum_string_required_validate_enum(cls, v): if v not in ('UPPER', 'lower', ''): - raise ValueError("must validate the enum values ('UPPER', 'lower', '')") + raise ValueError("must be one of enum values ('UPPER', 'lower', '')") return v @validator('enum_integer_default') def enum_integer_default_validate_enum(cls, v): if v is None: return v - if v not in (1, 5, 14): - raise ValueError("must validate the enum values (1, 5, 14)") + raise ValueError("must be one of enum values (1, 5, 14)") return v @validator('enum_integer') def enum_integer_validate_enum(cls, v): if v is None: return v - if v not in (1, -1): - raise ValueError("must validate the enum values (1, -1)") + raise ValueError("must be one of enum values (1, -1)") return v @validator('enum_number') def enum_number_validate_enum(cls, v): if v is None: return v - if v not in (1.1, -1.2): - raise ValueError("must validate the enum values (1.1, -1.2)") + raise ValueError("must be one of enum values (1.1, -1.2)") return v class Config: @@ -107,7 +103,8 @@ class EnumTest(BaseModel): }, exclude_none=True) # set to None if outer_enum (nullable) is None - if self.outer_enum is None: + # and __fields_set__ contains the field + if self.outer_enum is None and "outer_enum" in self.__fields_set__: _dict['outerEnum'] = None return _dict diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py index 547ac02231c..aae806f9515 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class File(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Must be named `File` for test. """ source_uri: Optional[StrictStr] = Field(None, alias="sourceURI", description="Test capitalization") __properties = ["sourceURI"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py index 0c9641aa66b..86c9b1bd46f 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/file_schema_test_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, conlist from petstore_api.models.file import File class FileSchemaTestClass(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + FileSchemaTestClass """ file: Optional[File] = None files: Optional[conlist(File)] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/first_ref.py new file mode 100644 index 00000000000..0856f9b0daf --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/first_ref.py @@ -0,0 +1,75 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr + +class FirstRef(BaseModel): + """ + FirstRef + """ + category: Optional[StrictStr] = None + self_ref: Optional[SecondRef] = None + __properties = ["category", "self_ref"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> FirstRef: + """Create an instance of FirstRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of self_ref + if self.self_ref: + _dict['self_ref'] = self.self_ref.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> FirstRef: + """Create an instance of FirstRef from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return FirstRef.parse_obj(obj) + + _obj = FirstRef.parse_obj({ + "category": obj.get("category"), + "self_ref": SecondRef.from_dict(obj.get("self_ref")) if obj.get("self_ref") is not None else None + }) + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py index fdd55d3b587..c85ac8cec6c 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class Foo(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Foo """ bar: Optional[StrictStr] = 'bar' __properties = ["bar"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py index 824cb819f96..1a8502a9eb6 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/foo_get_default_response.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel from petstore_api.models.foo import Foo class FooGetDefaultResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + FooGetDefaultResponse """ string: Optional[Foo] = None __properties = ["string"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py index 2d71fcfca2a..811d3a4ee27 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/format_test.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator class FormatTest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + FormatTest """ integer: Optional[conint(strict=True, le=100, ge=10)] = None int32: Optional[conint(strict=True, le=200, ge=20)] = None @@ -34,6 +34,7 @@ class FormatTest(BaseModel): double: Optional[confloat(le=123.4, ge=67.8)] = None decimal: Optional[condecimal()] = None string: Optional[constr(strict=True)] = None + string_with_double_quote_pattern: Optional[constr(strict=True)] = None byte: Optional[StrictBytes] = None binary: Optional[StrictBytes] = None var_date: date = Field(..., alias="date") @@ -42,7 +43,7 @@ class FormatTest(BaseModel): password: constr(strict=True, max_length=64, min_length=10) = ... pattern_with_digits: Optional[constr(strict=True)] = Field(None, description="A string that is a 10 digit number. Can have leading zeros.") pattern_with_digits_and_delimiter: Optional[constr(strict=True)] = Field(None, description="A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") - __properties = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"] + __properties = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "string_with_double_quote_pattern", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"] @validator('string') def string_validate_regular_expression(cls, v): @@ -50,6 +51,12 @@ class FormatTest(BaseModel): raise ValueError(r"must validate the regular expression /[a-z]/i") return v + @validator('string_with_double_quote_pattern') + def string_with_double_quote_pattern_validate_regular_expression(cls, v): + if not re.match(r"this is \"something\"", v): + raise ValueError(r"must validate the regular expression /this is \"something\"/") + return v + @validator('pattern_with_digits') def pattern_with_digits_validate_regular_expression(cls, v): if not re.match(r"^\d{10}$", v): @@ -105,6 +112,7 @@ class FormatTest(BaseModel): "double": obj.get("double"), "decimal": obj.get("decimal"), "string": obj.get("string"), + "string_with_double_quote_pattern": obj.get("string_with_double_quote_pattern"), "byte": obj.get("byte"), "binary": obj.get("binary"), "var_date": obj.get("date"), diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py index a894bea69c5..47345cc0a89 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/has_only_read_only.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class HasOnlyReadOnly(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + HasOnlyReadOnly """ bar: Optional[StrictStr] = None foo: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py index 4894db223db..8f674067ff8 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/health_check_result.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class HealthCheckResult(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. """ nullable_message: Optional[StrictStr] = Field(None, alias="NullableMessage") __properties = ["NullableMessage"] @@ -53,7 +53,8 @@ class HealthCheckResult(BaseModel): }, exclude_none=True) # set to None if nullable_message (nullable) is None - if self.nullable_message is None: + # and __fields_set__ contains the field + if self.nullable_message is None and "nullable_message" in self.__fields_set__: _dict['NullableMessage'] = None return _dict diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/inner_dict_with_property.py new file mode 100644 index 00000000000..8bce01a25b4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/inner_dict_with_property.py @@ -0,0 +1,70 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field + +class InnerDictWithProperty(BaseModel): + """ + InnerDictWithProperty + """ + a_property: Optional[Dict[str, Any]] = Field(None, alias="aProperty") + __properties = ["aProperty"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> InnerDictWithProperty: + """Create an instance of InnerDictWithProperty from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> InnerDictWithProperty: + """Create an instance of InnerDictWithProperty from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return InnerDictWithProperty.parse_obj(obj) + + _obj = InnerDictWithProperty.parse_obj({ + "a_property": obj.get("aProperty") + }) + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py index 5e57dd7284a..e0a3f4b55e4 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/list.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class List(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + List """ var_123_list: Optional[StrictStr] = Field(None, alias="123-list") __properties = ["123-list"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py index 0f163673c83..36d415ccbf6 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/map_test.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Dict, Optional from pydantic import BaseModel, StrictBool, StrictStr, validator class MapTest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + MapTest """ map_map_of_string: Optional[Dict[str, Dict[str, StrictStr]]] = None map_of_enum_string: Optional[Dict[str, StrictStr]] = None @@ -36,9 +36,8 @@ class MapTest(BaseModel): def map_of_enum_string_validate_enum(cls, v): if v is None: return v - if v not in ('UPPER', 'lower'): - raise ValueError("must validate the enum values ('UPPER', 'lower')") + raise ValueError("must be one of enum values ('UPPER', 'lower')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py index 63cecf94a3c..5c96c891435 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.animal import Animal class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + MixedPropertiesAndAdditionalPropertiesClass """ uuid: Optional[StrictStr] = None date_time: Optional[datetime] = Field(None, alias="dateTime") @@ -76,7 +76,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): _obj = MixedPropertiesAndAdditionalPropertiesClass.parse_obj({ "uuid": obj.get("uuid"), "date_time": obj.get("dateTime"), - "map": dict((_k, Dict[str, Animal].from_dict(_v)) for _k, _v in obj.get("map").items()) + "map": dict((_k, Animal.from_dict(_v)) for _k, _v in obj.get("map").items()) if obj.get("map") is not None else None }) return _obj diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py index 9e63ffc0f65..55ddbc2a050 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model200_response.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class Model200Response(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Model for testing model name starting with number """ name: Optional[StrictInt] = None var_class: Optional[StrictStr] = Field(None, alias="class") diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py index a7906692c6c..527a4f5b47e 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/model_return.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt class ModelReturn(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Model for testing reserved words """ var_return: Optional[StrictInt] = Field(None, alias="return") __properties = ["return"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py index 27f190d6fc3..2bd141055bb 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/name.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class Name(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Model for testing model name same as property name """ name: StrictInt = ... snake_case: Optional[StrictInt] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py index edf0ad22723..32d313365d6 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/nullable_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, conlist class NullableClass(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + NullableClass """ required_integer_prop: Optional[StrictInt] = ... integer_prop: Optional[StrictInt] = None @@ -65,47 +65,58 @@ class NullableClass(BaseModel): }, exclude_none=True) # set to None if required_integer_prop (nullable) is None - if self.required_integer_prop is None: + # and __fields_set__ contains the field + if self.required_integer_prop is None and "required_integer_prop" in self.__fields_set__: _dict['required_integer_prop'] = None # set to None if integer_prop (nullable) is None - if self.integer_prop is None: + # and __fields_set__ contains the field + if self.integer_prop is None and "integer_prop" in self.__fields_set__: _dict['integer_prop'] = None # set to None if number_prop (nullable) is None - if self.number_prop is None: + # and __fields_set__ contains the field + if self.number_prop is None and "number_prop" in self.__fields_set__: _dict['number_prop'] = None # set to None if boolean_prop (nullable) is None - if self.boolean_prop is None: + # and __fields_set__ contains the field + if self.boolean_prop is None and "boolean_prop" in self.__fields_set__: _dict['boolean_prop'] = None # set to None if string_prop (nullable) is None - if self.string_prop is None: + # and __fields_set__ contains the field + if self.string_prop is None and "string_prop" in self.__fields_set__: _dict['string_prop'] = None # set to None if date_prop (nullable) is None - if self.date_prop is None: + # and __fields_set__ contains the field + if self.date_prop is None and "date_prop" in self.__fields_set__: _dict['date_prop'] = None # set to None if datetime_prop (nullable) is None - if self.datetime_prop is None: + # and __fields_set__ contains the field + if self.datetime_prop is None and "datetime_prop" in self.__fields_set__: _dict['datetime_prop'] = None # set to None if array_nullable_prop (nullable) is None - if self.array_nullable_prop is None: + # and __fields_set__ contains the field + if self.array_nullable_prop is None and "array_nullable_prop" in self.__fields_set__: _dict['array_nullable_prop'] = None # set to None if array_and_items_nullable_prop (nullable) is None - if self.array_and_items_nullable_prop is None: + # and __fields_set__ contains the field + if self.array_and_items_nullable_prop is None and "array_and_items_nullable_prop" in self.__fields_set__: _dict['array_and_items_nullable_prop'] = None # set to None if object_nullable_prop (nullable) is None - if self.object_nullable_prop is None: + # and __fields_set__ contains the field + if self.object_nullable_prop is None and "object_nullable_prop" in self.__fields_set__: _dict['object_nullable_prop'] = None # set to None if object_and_items_nullable_prop (nullable) is None - if self.object_and_items_nullable_prop is None: + # and __fields_set__ contains the field + if self.object_and_items_nullable_prop is None and "object_and_items_nullable_prop" in self.__fields_set__: _dict['object_and_items_nullable_prop'] = None return _dict diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py index c3a7dbaedde..c4a400a846c 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/number_only.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field class NumberOnly(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + NumberOnly """ just_number: Optional[float] = Field(None, alias="JustNumber") __properties = ["JustNumber"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py index fd38ee7af4a..d056ce8778a 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/object_with_deprecated_fields.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, Field, StrictStr, conlist from petstore_api.models.deprecated_object import DeprecatedObject class ObjectWithDeprecatedFields(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ObjectWithDeprecatedFields """ uuid: Optional[StrictStr] = None id: Optional[float] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py index 7605ddaf569..c44c3a2eea9 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/order.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator class Order(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Order """ id: Optional[StrictInt] = None pet_id: Optional[StrictInt] = Field(None, alias="petId") @@ -38,9 +38,8 @@ class Order(BaseModel): def status_validate_enum(cls, v): if v is None: return v - if v not in ('placed', 'approved', 'delivered'): - raise ValueError("must validate the enum values ('placed', 'approved', 'delivered')") + raise ValueError("must be one of enum values ('placed', 'approved', 'delivered')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py index ee896ed54ab..7fce7797fee 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_composite.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictBool, StrictStr class OuterComposite(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterComposite """ my_number: Optional[float] = None my_string: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum.py index 179e822d35d..befbdfdaa67 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class OuterEnum(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterEnum """ """ allowed enum values """ - PLACED = 'placed' APPROVED = 'approved' DELIVERED = 'delivered' diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_default_value.py index 4a93cbda580..b8937b43c42 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_default_value.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class OuterEnumDefaultValue(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterEnumDefaultValue """ """ allowed enum values """ - PLACED = 'placed' APPROVED = 'approved' DELIVERED = 'delivered' diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer.py index 4a4347e3106..72aa99814d4 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class OuterEnumInteger(int, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterEnumInteger """ """ allowed enum values """ - NUMBER_0 = 0 NUMBER_1 = 1 NUMBER_2 = 2 diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer_default_value.py index b0e86076d16..09a945f73c3 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_enum_integer_default_value.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class OuterEnumIntegerDefaultValue(int, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterEnumIntegerDefaultValue """ """ allowed enum values """ - NUMBER_0 = 0 NUMBER_1 = 1 NUMBER_2 = 2 diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py index c80429a190b..db3e40fb412 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/outer_object_with_enum_property.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -23,10 +25,8 @@ from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger class OuterObjectWithEnumProperty(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterObjectWithEnumProperty """ str_value: Optional[OuterEnum] = None value: OuterEnumInteger = ... @@ -56,7 +56,8 @@ class OuterObjectWithEnumProperty(BaseModel): }, exclude_none=True) # set to None if str_value (nullable) is None - if self.str_value is None: + # and __fields_set__ contains the field + if self.str_value is None and "str_value" in self.__fields_set__: _dict['str_value'] = None return _dict diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent_with_optional_dict.py new file mode 100644 index 00000000000..e886b75bd08 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/parent_with_optional_dict.py @@ -0,0 +1,78 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Dict, Optional +from pydantic import BaseModel, Field +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + +class ParentWithOptionalDict(BaseModel): + """ + ParentWithOptionalDict + """ + optional_dict: Optional[Dict[str, InnerDictWithProperty]] = Field(None, alias="optionalDict") + __properties = ["optionalDict"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ParentWithOptionalDict: + """Create an instance of ParentWithOptionalDict from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each value in optional_dict (dict) + _field_dict = {} + if self.optional_dict: + for _key in self.optional_dict: + if self.optional_dict[_key]: + _field_dict[_key] = self.optional_dict[_key].to_dict() + _dict['optionalDict'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ParentWithOptionalDict: + """Create an instance of ParentWithOptionalDict from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return ParentWithOptionalDict.parse_obj(obj) + + _obj = ParentWithOptionalDict.parse_obj({ + "optional_dict": dict((_k, InnerDictWithProperty.from_dict(_v)) for _k, _v in obj.get("optionalDict").items()) if obj.get("optionalDict") is not None else None + }) + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py index bdff5742127..f8bb0d46377 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pet.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -23,10 +25,8 @@ from petstore_api.models.category import Category from petstore_api.models.tag import Tag class Pet(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Pet """ id: Optional[StrictInt] = None category: Optional[Category] = None @@ -40,9 +40,8 @@ class Pet(BaseModel): def status_validate_enum(cls, v): if v is None: return v - if v not in ('available', 'pending', 'sold'): - raise ValueError("must validate the enum values ('available', 'pending', 'sold')") + raise ValueError("must be one of enum values ('available', 'pending', 'sold')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py index 77abb2d6703..baa32ba0c4a 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/pig.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -26,10 +28,8 @@ from pydantic import StrictStr, Field PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] class Pig(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Pig """ # data type: BasquePig oneof_schema_1_validator: Optional[BasquePig] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py index 4f8ca3b6eca..ac16280844b 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/read_only_first.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class ReadOnlyFirst(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ReadOnlyFirst """ bar: Optional[StrictStr] = None baz: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/second_ref.py new file mode 100644 index 00000000000..f00e2756920 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/second_ref.py @@ -0,0 +1,75 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr + +class SecondRef(BaseModel): + """ + SecondRef + """ + category: Optional[StrictStr] = None + circular_ref: Optional[CircularReferenceModel] = None + __properties = ["category", "circular_ref"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> SecondRef: + """Create an instance of SecondRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of circular_ref + if self.circular_ref: + _dict['circular_ref'] = self.circular_ref.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> SecondRef: + """Create an instance of SecondRef from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return SecondRef.parse_obj(obj) + + _obj = SecondRef.parse_obj({ + "category": obj.get("category"), + "circular_ref": CircularReferenceModel.from_dict(obj.get("circular_ref")) if obj.get("circular_ref") is not None else None + }) + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py index 39692b911ea..b8fa0dd875f 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/self_reference_model.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt class SelfReferenceModel(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SelfReferenceModel """ size: Optional[StrictInt] = None nested: Optional[DummyModel] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/single_ref_type.py index 67ae5e41be3..e5879e62968 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/single_ref_type.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/single_ref_type.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class SingleRefType(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SingleRefType """ """ allowed enum values """ - ADMIN = 'admin' USER = 'user' diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_character_enum.py index 374ac242de6..8ecf8ac3d69 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_character_enum.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_character_enum.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class SpecialCharacterEnum(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SpecialCharacterEnum """ """ allowed enum values """ - ENUM_456 = '456' ENUM_123ABC = '123abc' UNDERSCORE = '_' diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py index f5f83a5f419..bc9f7b4cdaa 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_model_name.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt class SpecialModelName(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SpecialModelName """ special_property_name: Optional[StrictInt] = Field(None, alias="$special[property.name]") __properties = ["$special[property.name]"] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py index 42d107844e2..811569b1c98 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/special_name.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from petstore_api.models.category import Category class SpecialName(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SpecialName """ var_property: Optional[StrictInt] = Field(None, alias="property") var_async: Optional[Category] = Field(None, alias="async") @@ -36,9 +36,8 @@ class SpecialName(BaseModel): def var_schema_validate_enum(cls, v): if v is None: return v - if v not in ('available', 'pending', 'sold'): - raise ValueError("must validate the enum values ('available', 'pending', 'sold')") + raise ValueError("must be one of enum values ('available', 'pending', 'sold')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py index 310b8429843..80c683f5d95 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/tag.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class Tag(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Tag """ id: Optional[StrictInt] = None name: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py index 65fd56849d1..77c6b277f01 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/user.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class User(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + User """ id: Optional[StrictInt] = None username: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py index 1675a10bbfc..6690f8dd734 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/models/with_nested_one_of.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, StrictInt from petstore_api.models.pig import Pig class WithNestedOneOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + WithNestedOneOf """ size: Optional[StrictInt] = None nested_pig: Optional[Pig] = None diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/rest.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/rest.py index c128a2588f4..eee373266b6 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/rest.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/signing.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/signing.py index 5060f6edbcd..cc1a0c9d6f7 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/signing.py @@ -4,7 +4,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -72,11 +74,6 @@ class HttpSigningConfiguration(object): and optionally the body of the HTTP request, then signing the hash value using a private key. The 'Authorization' header is added to outbound HTTP requests. - NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param key_id: A string value specifying the identifier of the cryptographic key, when signing HTTP requests. :param signing_scheme: A string value specifying the signature scheme, when diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml b/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml new file mode 100644 index 00000000000..6c4548406a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "petstore_api" +version = "1.0.0" +description = "OpenAPI Petstore" +authors = ["OpenAPI Generator Community "] +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/GIT_REPO_ID/GIT_USER_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +aiohttp = ">= 3.8.4" +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +pydantic = "^1.10.5" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/requirements.txt b/samples/openapi3/client/petstore/python-nextgen-aiohttp/requirements.txt index 1365d507af1..8bb00c2c243 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/requirements.txt +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/requirements.txt @@ -1,6 +1,6 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.25.3 -pydantic >= 1.10.2 +pydantic >= 1.10.5, < 2 aenum >= 3.1.11 aiohttp >= 3.0.0 diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.py index 881691d6f74..d584a44727d 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/setup.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -27,7 +29,7 @@ REQUIRES = [ "aiohttp >= 3.0.0", "pem>=19.3.0", "pycryptodome>=3.9.0", - "pydantic", + "pydantic >= 1.10.5, < 2", "aenum" ] diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_circular_reference_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_circular_reference_model.py new file mode 100644 index 00000000000..f734d3fc0ff --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_circular_reference_model.py @@ -0,0 +1,64 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.circular_reference_model import CircularReferenceModel # noqa: E501 +from petstore_api.rest import ApiException + +class TestCircularReferenceModel(unittest.TestCase): + """CircularReferenceModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CircularReferenceModel + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CircularReferenceModel` + """ + model = petstore_api.models.circular_reference_model.CircularReferenceModel() # noqa: E501 + if include_optional : + return CircularReferenceModel( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', ), ), ), ) + ) + else : + return CircularReferenceModel( + ) + """ + + def testCircularReferenceModel(self): + """Test CircularReferenceModel""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_first_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_first_ref.py new file mode 100644 index 00000000000..bcec1c0334b --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_first_ref.py @@ -0,0 +1,62 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.first_ref import FirstRef # noqa: E501 +from petstore_api.rest import ApiException + +class TestFirstRef(unittest.TestCase): + """FirstRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test FirstRef + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FirstRef` + """ + model = petstore_api.models.first_ref.FirstRef() # noqa: E501 + if include_optional : + return FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', ), ), ) + ) + else : + return FirstRef( + ) + """ + + def testFirstRef(self): + """Test FirstRef""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_inner_dict_with_property.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_inner_dict_with_property.py new file mode 100644 index 00000000000..8a63b70d552 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_inner_dict_with_property.py @@ -0,0 +1,56 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty # noqa: E501 +from petstore_api.rest import ApiException + +class TestInnerDictWithProperty(unittest.TestCase): + """InnerDictWithProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test InnerDictWithProperty + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InnerDictWithProperty` + """ + model = petstore_api.models.inner_dict_with_property.InnerDictWithProperty() # noqa: E501 + if include_optional : + return InnerDictWithProperty( + a_property = None + ) + else : + return InnerDictWithProperty( + ) + """ + + def testInnerDictWithProperty(self): + """Test InnerDictWithProperty""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_parent_with_optional_dict.py new file mode 100644 index 00000000000..25b769e3d39 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_parent_with_optional_dict.py @@ -0,0 +1,59 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict # noqa: E501 +from petstore_api.rest import ApiException + +class TestParentWithOptionalDict(unittest.TestCase): + """ParentWithOptionalDict unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ParentWithOptionalDict + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ParentWithOptionalDict` + """ + model = petstore_api.models.parent_with_optional_dict.ParentWithOptionalDict() # noqa: E501 + if include_optional : + return ParentWithOptionalDict( + optional_dict = { + 'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty( + a_property = petstore_api.models.a_property.aProperty(), ) + } + ) + else : + return ParentWithOptionalDict( + ) + """ + + def testParentWithOptionalDict(self): + """Test ParentWithOptionalDict""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_second_ref.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_second_ref.py new file mode 100644 index 00000000000..782892fd4e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/test/test_second_ref.py @@ -0,0 +1,62 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.second_ref import SecondRef # noqa: E501 +from petstore_api.rest import ApiException + +class TestSecondRef(unittest.TestCase): + """SecondRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test SecondRef + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SecondRef` + """ + model = petstore_api.models.second_ref.SecondRef() # noqa: E501 + if include_optional : + return SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', ), ), ) + ) + else : + return SecondRef( + ) + """ + + def testSecondRef(self): + """Test SecondRef""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_model.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_model.py index b2954d10e0a..c9dc0681baf 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_model.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/tests/test_model.py @@ -195,7 +195,7 @@ class ModelTests(unittest.TestCase): # test enum ref property # test to_json d = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1) - self.assertEqual(d.to_json(), '{"value": 1, "str_value": null}') + self.assertEqual(d.to_json(), '{"value": 1}') d2 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=petstore_api.OuterEnum.DELIVERED) self.assertEqual(d2.to_json(), '{"str_value": "delivered", "value": 1}') # test from_json (round trip) @@ -209,7 +209,7 @@ class ModelTests(unittest.TestCase): a = petstore_api.FormatTest(number=39.8, float=123, byte=bytes("string", 'utf-8'), date="2013-09-17", password="testing09876") self.assertEqual(a.float, 123.0) - json_str = '{"number": 34.5, "float": "456", "date": "2013-12-08", "password": "empty1234567", "pattern_with_digits": "1234567890", "pattern_with_digits_and_delimiter": "image_123" , "string": "string"}' + json_str = "{\"number\": 34.5, \"float\": \"456\", \"date\": \"2013-12-08\", \"password\": \"empty1234567\", \"pattern_with_digits\": \"1234567890\", \"pattern_with_digits_and_delimiter\": \"image_123\", \"string_with_double_quote_pattern\": \"this is \\\"something\\\"\", \"string\": \"string\"}" # no exception thrown when assigning 456 (integer) to float type since strict is set to false f = petstore_api.FormatTest.from_json(json_str) self.assertEqual(f.float, 456.0) @@ -235,4 +235,4 @@ class ModelTests(unittest.TestCase): self.pet.status = "error" self.assertTrue(False) # this line shouldn't execute except ValueError as e: - self.assertTrue("must validate the enum values ('available', 'pending', 'sold')" in str(e)) + self.assertTrue("must be one of enum values ('available', 'pending', 'sold')" in str(e)) diff --git a/samples/openapi3/client/petstore/python-nextgen/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-nextgen/.github/workflows/python.yml index 28a13b8f38e..3cef12d7476 100644 --- a/samples/openapi3/client/petstore/python-nextgen/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python-nextgen/.github/workflows/python.yml @@ -15,12 +15,12 @@ jobs: matrix: python-version: ["3.7", "3.8", "3.9", "3.10"] - steps:s + steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }}s + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip @@ -34,4 +34,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest \ No newline at end of file + pytest diff --git a/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES index f5e76be9e49..1c063f5f802 100755 --- a/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES @@ -18,6 +18,7 @@ docs/Capitalization.md docs/Cat.md docs/CatAllOf.md docs/Category.md +docs/CircularReferenceModel.md docs/ClassModel.md docs/Client.md docs/Color.md @@ -34,11 +35,13 @@ docs/FakeApi.md docs/FakeClassnameTags123Api.md docs/File.md docs/FileSchemaTestClass.md +docs/FirstRef.md docs/Foo.md docs/FooGetDefaultResponse.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md +docs/InnerDictWithProperty.md docs/List.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -55,10 +58,12 @@ docs/OuterEnumDefaultValue.md docs/OuterEnumInteger.md docs/OuterEnumIntegerDefaultValue.md docs/OuterObjectWithEnumProperty.md +docs/ParentWithOptionalDict.md docs/Pet.md docs/PetApi.md docs/Pig.md docs/ReadOnlyFirst.md +docs/SecondRef.md docs/SelfReferenceModel.md docs/SingleRefType.md docs/SpecialCharacterEnum.md @@ -97,6 +102,7 @@ petstore_api/models/capitalization.py petstore_api/models/cat.py petstore_api/models/cat_all_of.py petstore_api/models/category.py +petstore_api/models/circular_reference_model.py petstore_api/models/class_model.py petstore_api/models/client.py petstore_api/models/color.py @@ -110,11 +116,13 @@ petstore_api/models/enum_class.py petstore_api/models/enum_test.py petstore_api/models/file.py petstore_api/models/file_schema_test_class.py +petstore_api/models/first_ref.py petstore_api/models/foo.py petstore_api/models/foo_get_default_response.py petstore_api/models/format_test.py petstore_api/models/has_only_read_only.py petstore_api/models/health_check_result.py +petstore_api/models/inner_dict_with_property.py petstore_api/models/list.py petstore_api/models/map_test.py petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -131,9 +139,11 @@ petstore_api/models/outer_enum_default_value.py petstore_api/models/outer_enum_integer.py petstore_api/models/outer_enum_integer_default_value.py petstore_api/models/outer_object_with_enum_property.py +petstore_api/models/parent_with_optional_dict.py petstore_api/models/pet.py petstore_api/models/pig.py petstore_api/models/read_only_first.py +petstore_api/models/second_ref.py petstore_api/models/self_reference_model.py petstore_api/models/single_ref_type.py petstore_api/models/special_character_enum.py @@ -144,6 +154,7 @@ petstore_api/models/user.py petstore_api/models/with_nested_one_of.py petstore_api/rest.py petstore_api/signing.py +pyproject.toml requirements.txt setup.cfg setup.py diff --git a/samples/openapi3/client/petstore/python-nextgen/README.md b/samples/openapi3/client/petstore/python-nextgen/README.md index 0f1d86506a4..a7b98f0887e 100755 --- a/samples/openapi3/client/petstore/python-nextgen/README.md +++ b/samples/openapi3/client/petstore/python-nextgen/README.md @@ -40,6 +40,10 @@ Then import the package: import petstore_api ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: @@ -84,6 +88,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_any_type_request_body**](docs/FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | @@ -141,6 +146,7 @@ Class | Method | HTTP request | Description - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) - [Category](docs/Category.md) + - [CircularReferenceModel](docs/CircularReferenceModel.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) - [Color](docs/Color.md) @@ -154,11 +160,13 @@ Class | Method | HTTP request | Description - [EnumTest](docs/EnumTest.md) - [File](docs/File.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FirstRef](docs/FirstRef.md) - [Foo](docs/Foo.md) - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) + - [InnerDictWithProperty](docs/InnerDictWithProperty.md) - [List](docs/List.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -175,9 +183,11 @@ Class | Method | HTTP request | Description - [OuterEnumInteger](docs/OuterEnumInteger.md) - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md) + - [ParentWithOptionalDict](docs/ParentWithOptionalDict.md) - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SecondRef](docs/SecondRef.md) - [SelfReferenceModel](docs/SelfReferenceModel.md) - [SingleRefType](docs/SingleRefType.md) - [SpecialCharacterEnum](docs/SpecialCharacterEnum.md) diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/CircularReferenceModel.md b/samples/openapi3/client/petstore/python-nextgen/docs/CircularReferenceModel.md new file mode 100644 index 00000000000..d5e97934d2b --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/docs/CircularReferenceModel.md @@ -0,0 +1,29 @@ +# CircularReferenceModel + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | | [optional] +**nested** | [**FirstRef**](FirstRef.md) | | [optional] + +## Example + +```python +from petstore_api.models.circular_reference_model import CircularReferenceModel + +# TODO update the JSON string below +json = "{}" +# create an instance of CircularReferenceModel from a JSON string +circular_reference_model_instance = CircularReferenceModel.from_json(json) +# print the JSON string representation of the object +print CircularReferenceModel.to_json() + +# convert the object into a dict +circular_reference_model_dict = circular_reference_model_instance.to_dict() +# create an instance of CircularReferenceModel from a dict +circular_reference_model_form_dict = circular_reference_model.from_dict(circular_reference_model_dict) +``` +[[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/openapi3/client/petstore/python-nextgen/docs/FakeApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md index 4407e642760..fc6167ff8b9 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fake_any_type_request_body**](FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | @@ -23,6 +24,66 @@ Method | HTTP request | Description [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | +# **fake_any_type_request_body** +> fake_any_type_request_body(body=body) + +test any type request body + +### Example + +```python +from __future__ import print_function +import time +import os +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + + +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = None # object | (optional) + + try: + # test any type request body + api_instance.fake_any_type_request_body(body=body) + except Exception as e: + print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **object**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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_health_get** > HealthCheckResult fake_health_get() @@ -551,7 +612,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) - body = 'body_example' # str | image to upload + body = None # bytearray | image to upload try: api_instance.test_body_with_binary(body) @@ -563,7 +624,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **str**| image to upload | + **body** | **bytearray**| image to upload | ### Return type @@ -873,13 +934,13 @@ with petstore_api.ApiClient(configuration) as api_client: number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None - byte = 'byte_example' # str | None + byte = None # bytearray | None integer = 56 # int | None (optional) int32 = 56 # int | None (optional) int64 = 56 # int | None (optional) float = 3.4 # float | None (optional) string = 'string_example' # str | None (optional) - binary = 'binary_example' # str | None (optional) + binary = None # bytearray | None (optional) var_date = '2013-10-20' # date | None (optional) date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) @@ -899,13 +960,13 @@ Name | Type | Description | Notes **number** | **float**| None | **double** | **float**| None | **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | + **byte** | **bytearray**| None | **integer** | **int**| None | [optional] **int32** | **int**| None | [optional] **int64** | **int**| None | [optional] **float** | **float**| None | [optional] **string** | **str**| None | [optional] - **binary** | **str**| None | [optional] + **binary** | **bytearray**| None | [optional] **var_date** | **date**| None | [optional] **date_time** | **datetime**| None | [optional] **password** | **str**| None | [optional] diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/FirstRef.md b/samples/openapi3/client/petstore/python-nextgen/docs/FirstRef.md new file mode 100644 index 00000000000..b5e7ab766b4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/docs/FirstRef.md @@ -0,0 +1,29 @@ +# FirstRef + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**self_ref** | [**SecondRef**](SecondRef.md) | | [optional] + +## Example + +```python +from petstore_api.models.first_ref import FirstRef + +# TODO update the JSON string below +json = "{}" +# create an instance of FirstRef from a JSON string +first_ref_instance = FirstRef.from_json(json) +# print the JSON string representation of the object +print FirstRef.to_json() + +# convert the object into a dict +first_ref_dict = first_ref_instance.to_dict() +# create an instance of FirstRef from a dict +first_ref_form_dict = first_ref.from_dict(first_ref_dict) +``` +[[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/openapi3/client/petstore/python-nextgen/docs/FormatTest.md b/samples/openapi3/client/petstore/python-nextgen/docs/FormatTest.md index 5ea09e1908a..aa81e585952 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/FormatTest.md @@ -12,8 +12,9 @@ Name | Type | Description | Notes **double** | **float** | | [optional] **decimal** | **decimal.Decimal** | | [optional] **string** | **str** | | [optional] -**byte** | **str** | | [optional] -**binary** | **str** | | [optional] +**string_with_double_quote_pattern** | **str** | | [optional] +**byte** | **bytearray** | | [optional] +**binary** | **bytearray** | | [optional] **var_date** | **date** | | **date_time** | **datetime** | | [optional] **uuid** | **str** | | [optional] diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/InnerDictWithProperty.md b/samples/openapi3/client/petstore/python-nextgen/docs/InnerDictWithProperty.md new file mode 100644 index 00000000000..45d76ad458c --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/docs/InnerDictWithProperty.md @@ -0,0 +1,28 @@ +# InnerDictWithProperty + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**a_property** | **object** | | [optional] + +## Example + +```python +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + +# TODO update the JSON string below +json = "{}" +# create an instance of InnerDictWithProperty from a JSON string +inner_dict_with_property_instance = InnerDictWithProperty.from_json(json) +# print the JSON string representation of the object +print InnerDictWithProperty.to_json() + +# convert the object into a dict +inner_dict_with_property_dict = inner_dict_with_property_instance.to_dict() +# create an instance of InnerDictWithProperty from a dict +inner_dict_with_property_form_dict = inner_dict_with_property.from_dict(inner_dict_with_property_dict) +``` +[[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/openapi3/client/petstore/python-nextgen/docs/ParentWithOptionalDict.md b/samples/openapi3/client/petstore/python-nextgen/docs/ParentWithOptionalDict.md new file mode 100644 index 00000000000..04bf9494201 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/docs/ParentWithOptionalDict.md @@ -0,0 +1,28 @@ +# ParentWithOptionalDict + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_dict** | [**Dict[str, InnerDictWithProperty]**](InnerDictWithProperty.md) | | [optional] + +## Example + +```python +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict + +# TODO update the JSON string below +json = "{}" +# create an instance of ParentWithOptionalDict from a JSON string +parent_with_optional_dict_instance = ParentWithOptionalDict.from_json(json) +# print the JSON string representation of the object +print ParentWithOptionalDict.to_json() + +# convert the object into a dict +parent_with_optional_dict_dict = parent_with_optional_dict_instance.to_dict() +# create an instance of ParentWithOptionalDict from a dict +parent_with_optional_dict_form_dict = parent_with_optional_dict.from_dict(parent_with_optional_dict_dict) +``` +[[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/openapi3/client/petstore/python-nextgen/docs/PetApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/PetApi.md index 5b395675ee6..0321e8336bc 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/PetApi.md @@ -1176,7 +1176,7 @@ with petstore_api.ApiClient(configuration) as api_client: api_instance = petstore_api.PetApi(api_client) pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) - file = 'file_example' # str | file to upload (optional) + file = None # bytearray | file to upload (optional) try: # uploads an image @@ -1193,7 +1193,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet to update | **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **str**| file to upload | [optional] + **file** | **bytearray**| file to upload | [optional] ### Return type @@ -1250,7 +1250,7 @@ with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.PetApi(api_client) pet_id = 56 # int | ID of pet to update - required_file = 'required_file_example' # str | file to upload + required_file = None # bytearray | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) try: @@ -1267,7 +1267,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet to update | - **required_file** | **str**| file to upload | + **required_file** | **bytearray**| file to upload | **additional_metadata** | **str**| Additional data to pass to server | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/SecondRef.md b/samples/openapi3/client/petstore/python-nextgen/docs/SecondRef.md new file mode 100644 index 00000000000..e6fb1e2d4f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/docs/SecondRef.md @@ -0,0 +1,29 @@ +# SecondRef + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**circular_ref** | [**CircularReferenceModel**](CircularReferenceModel.md) | | [optional] + +## Example + +```python +from petstore_api.models.second_ref import SecondRef + +# TODO update the JSON string below +json = "{}" +# create an instance of SecondRef from a JSON string +second_ref_instance = SecondRef.from_json(json) +# print the JSON string representation of the object +print SecondRef.to_json() + +# convert the object into a dict +second_ref_dict = second_ref_instance.to_dict() +# create an instance of SecondRef from a dict +second_ref_form_dict = second_ref.from_dict(second_ref_dict) +``` +[[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/openapi3/client/petstore/python-nextgen/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/__init__.py index 2b6fe534d7b..417db16491d 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/__init__.py @@ -8,12 +8,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - __version__ = "1.0.0" # import apis into sdk package @@ -49,6 +49,7 @@ from petstore_api.models.capitalization import Capitalization from petstore_api.models.cat import Cat from petstore_api.models.cat_all_of import CatAllOf from petstore_api.models.category import Category +from petstore_api.models.circular_reference_model import CircularReferenceModel from petstore_api.models.class_model import ClassModel from petstore_api.models.client import Client from petstore_api.models.color import Color @@ -62,11 +63,13 @@ from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_test import EnumTest from petstore_api.models.file import File from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.first_ref import FirstRef from petstore_api.models.foo import Foo from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.list import List from petstore_api.models.map_test import MapTest from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass @@ -83,9 +86,11 @@ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.second_ref import SecondRef from petstore_api.models.self_reference_model import SelfReferenceModel from petstore_api.models.single_ref_type import SingleRefType from petstore_api.models.special_character_enum import SpecialCharacterEnum diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/__init__.py index bc45197c40f..7a2616975a2 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/__init__.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/__init__.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - # flake8: noqa # import apis into api package @@ -10,3 +8,4 @@ from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api from petstore_api.api.pet_api import PetApi from petstore_api.api.store_api import StoreApi from petstore_api.api.user_api import UserApi + diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/another_fake_api.py index 60809cd8225..a52190eaf36 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/another_fake_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/default_api.py index e6e6c36aeeb..cb77b64734c 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/default_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py index 591605fca58..44c7b2d4e0a 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError @@ -21,7 +21,7 @@ from datetime import date, datetime from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, confloat, conint, conlist, constr, validator -from typing import Dict, Optional +from typing import Any, Dict, Optional from petstore_api.models.client import Client from petstore_api.models.file_schema_test_class import FileSchemaTestClass @@ -50,6 +50,145 @@ class FakeApi(object): api_client = ApiClient.get_default() self.api_client = api_client + @validate_arguments + def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, **kwargs) -> None: # noqa: E501 + """test any type request body # 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_any_type_request_body(body, async_req=True) + >>> result = thread.get() + + :param body: + :type body: object + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :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: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + return self.fake_any_type_request_body_with_http_info(body, **kwargs) # noqa: E501 + + @validate_arguments + def fake_any_type_request_body_with_http_info(self, body : Optional[Dict[str, Any]] = None, **kwargs): # noqa: E501 + """test any type request body # 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_any_type_request_body_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: + :type body: object + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :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. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'body' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_any_type_request_body" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['body']: + _body_params = _params['body'] + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/fake/any_type_body', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments def fake_health_get(self, **kwargs) -> HealthCheckResult: # noqa: E501 """Health check endpoint # noqa: E501 @@ -1082,7 +1221,7 @@ class FakeApi(object): >>> result = thread.get() :param body: image to upload (required) - :type body: str + :type body: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1113,7 +1252,7 @@ class FakeApi(object): >>> result = thread.get() :param body: image to upload (required) - :type body: str + :type body: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -1790,7 +1929,7 @@ class FakeApi(object): _request_auth=_params.get('_request_auth')) @validate_arguments - def test_endpoint_parameters(self, number : Annotated[confloat(ge=543.2, le=32.1, strict=True), Field(..., description="None")], double : Annotated[confloat(ge=123.4, le=67.8, strict=True), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(ge=987.6, strict=True)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs) -> None: # noqa: E501 + def test_endpoint_parameters(self, number : Annotated[confloat(le=543.2, ge=32.1, strict=True), Field(..., description="None")], double : Annotated[confloat(le=123.4, ge=67.8, strict=True), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(le=987.6, strict=True)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs) -> None: # noqa: E501 """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 @@ -1807,7 +1946,7 @@ class FakeApi(object): :param pattern_without_delimiter: None (required) :type pattern_without_delimiter: str :param byte: None (required) - :type byte: str + :type byte: bytearray :param integer: None :type integer: int :param int32: None @@ -1819,7 +1958,7 @@ class FakeApi(object): :param string: None :type string: str :param binary: None - :type binary: str + :type binary: bytearray :param var_date: None :type var_date: date :param date_time: None @@ -1847,7 +1986,7 @@ class FakeApi(object): return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, var_date, date_time, password, param_callback, **kwargs) # noqa: E501 @validate_arguments - def test_endpoint_parameters_with_http_info(self, number : Annotated[confloat(ge=543.2, le=32.1, strict=True), Field(..., description="None")], double : Annotated[confloat(ge=123.4, le=67.8, strict=True), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(ge=987.6, strict=True)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs): # noqa: E501 + def test_endpoint_parameters_with_http_info(self, number : Annotated[confloat(le=543.2, ge=32.1, strict=True), Field(..., description="None")], double : Annotated[confloat(le=123.4, ge=67.8, strict=True), Field(..., description="None")], pattern_without_delimiter : Annotated[constr(strict=True), Field(..., description="None")], byte : Annotated[StrictStr, Field(..., description="None")], integer : Annotated[Optional[conint(strict=True, le=100, ge=10)], Field(description="None")] = None, int32 : Annotated[Optional[conint(strict=True, le=200, ge=20)], Field(description="None")] = None, int64 : Annotated[Optional[StrictInt], Field(description="None")] = None, float : Annotated[Optional[confloat(le=987.6, strict=True)], Field(description="None")] = None, string : Annotated[Optional[constr(strict=True)], Field(description="None")] = None, binary : Annotated[Optional[StrictStr], Field(description="None")] = None, var_date : Annotated[Optional[date], Field(description="None")] = None, date_time : Annotated[Optional[datetime], Field(description="None")] = None, password : Annotated[Optional[constr(strict=True, max_length=64, min_length=10)], Field(description="None")] = None, param_callback : Annotated[Optional[StrictStr], Field(description="None")] = None, **kwargs): # noqa: E501 """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 @@ -1864,7 +2003,7 @@ class FakeApi(object): :param pattern_without_delimiter: None (required) :type pattern_without_delimiter: str :param byte: None (required) - :type byte: str + :type byte: bytearray :param integer: None :type integer: int :param int32: None @@ -1876,7 +2015,7 @@ class FakeApi(object): :param string: None :type string: str :param binary: None - :type binary: str + :type binary: bytearray :param var_date: None :type var_date: date :param date_time: None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags123_api.py index f2c7f023834..3221e3783b2 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_classname_tags123_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/pet_api.py index 560ce557f35..e375a7c5559 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/pet_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError @@ -1066,7 +1066,7 @@ class PetApi(object): :param additional_metadata: Additional data to pass to server :type additional_metadata: str :param file: file to upload - :type file: str + :type file: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1101,7 +1101,7 @@ class PetApi(object): :param additional_metadata: Additional data to pass to server :type additional_metadata: str :param file: file to upload - :type file: str + :type file: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _return_http_data_only: response data without head status code @@ -1227,7 +1227,7 @@ class PetApi(object): :param pet_id: ID of pet to update (required) :type pet_id: int :param required_file: file to upload (required) - :type required_file: str + :type required_file: bytearray :param additional_metadata: Additional data to pass to server :type additional_metadata: str :param async_req: Whether to execute the request asynchronously. @@ -1262,7 +1262,7 @@ class PetApi(object): :param pet_id: ID of pet to update (required) :type pet_id: int :param required_file: file to upload (required) - :type required_file: str + :type required_file: bytearray :param additional_metadata: Additional data to pass to server :type additional_metadata: str :param async_req: Whether to execute the request asynchronously. diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/store_api.py index 26063f3cc5c..79931477f78 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/store_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/user_api.py index 87a63b7e019..bfa36bf0134 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/user_api.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import re # noqa: F401 from pydantic import validate_arguments, ValidationError diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api_client.py index 96652c49087..96347377863 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api_client.py @@ -1,14 +1,16 @@ # 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import import atexit import datetime @@ -36,10 +38,6 @@ class ApiClient(object): 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 @@ -65,7 +63,7 @@ class ApiClient(object): def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): - # use default configuraiton if none is provided + # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration @@ -230,7 +228,9 @@ class ApiClient(object): response_type = response_types_map.get(str(response_data.status), None) - if response_type not in ["file", "bytes"]: + if response_type == "bytearray": + response_data.data = response_data.data + else: match = None content_type = response_data.getheader('content-type') if content_type is not None: @@ -239,8 +239,9 @@ class ApiClient(object): response_data.data = response_data.data.decode(encoding) # deserialize response data - - if response_type: + if response_type == "bytearray": + return_data = response_data.data + elif response_type: return_data = self.deserialize(response_data, response_type) else: return_data = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/configuration.py index 5f667ed5f1c..a466557ad57 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/configuration.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import copy import logging import multiprocessing @@ -21,7 +21,6 @@ import urllib3 import http.client as httplib from petstore_api.exceptions import ApiValueError - JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', @@ -29,10 +28,7 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { } class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. + """This class contains various settings of the API client. :param host: Base url. :param api_key: Dict to store API key(s). diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/exceptions.py index b81fd7505ff..cb957db48b9 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/exceptions.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/__init__.py index fe6f65f77ba..212f2096311 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/__init__.py @@ -7,12 +7,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - # import models into model package from petstore_api.models.additional_properties_class import AdditionalPropertiesClass from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef @@ -28,6 +28,7 @@ from petstore_api.models.capitalization import Capitalization from petstore_api.models.cat import Cat from petstore_api.models.cat_all_of import CatAllOf from petstore_api.models.category import Category +from petstore_api.models.circular_reference_model import CircularReferenceModel from petstore_api.models.class_model import ClassModel from petstore_api.models.client import Client from petstore_api.models.color import Color @@ -41,11 +42,13 @@ from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_test import EnumTest from petstore_api.models.file import File from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.first_ref import FirstRef from petstore_api.models.foo import Foo from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.list import List from petstore_api.models.map_test import MapTest from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass @@ -62,9 +65,11 @@ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.second_ref import SecondRef from petstore_api.models.self_reference_model import SelfReferenceModel from petstore_api.models.single_ref_type import SingleRefType from petstore_api.models.special_character_enum import SpecialCharacterEnum diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py index e73e6ca7022..e99d1d384d5 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/additional_properties_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Dict, Optional from pydantic import BaseModel, StrictStr class AdditionalPropertiesClass(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + AdditionalPropertiesClass """ map_property: Optional[Dict[str, StrictStr]] = None map_of_map_property: Optional[Dict[str, Dict[str, StrictStr]]] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py index d46e7528735..7480ccec361 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/all_of_with_single_ref.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -17,17 +19,16 @@ import re # noqa: F401 import json -from typing import Any, Optional +from typing import Optional from pydantic import BaseModel, Field, StrictStr +from petstore_api.models.single_ref_type import SingleRefType class AllOfWithSingleRef(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + AllOfWithSingleRef """ username: Optional[StrictStr] = None - single_ref_type: Optional[Any] = Field(None, alias="SingleRefType") + single_ref_type: Optional[SingleRefType] = Field(None, alias="SingleRefType") additional_properties: Dict[str, Any] = {} __properties = ["username", "SingleRefType"] @@ -55,9 +56,6 @@ class AllOfWithSingleRef(BaseModel): "additional_properties" }, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of single_ref_type - if self.single_ref_type: - _dict['SingleRefType'] = self.single_ref_type.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -76,7 +74,7 @@ class AllOfWithSingleRef(BaseModel): _obj = AllOfWithSingleRef.parse_obj({ "username": obj.get("username"), - "single_ref_type": SingleRefType.from_dict(obj.get("SingleRefType")) if obj.get("SingleRefType") is not None else None + "single_ref_type": obj.get("SingleRefType") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py index e5885a40c20..c37cccbf446 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/animal.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class Animal(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Animal """ class_name: StrictStr = Field(..., alias="className") color: Optional[StrictStr] = 'red' diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_color.py index 2a44d37581b..61dffbb4c50 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_color.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -24,11 +26,10 @@ from pydantic import StrictStr, Field ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] class AnyOfColor(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ + Any of RGB array, RGBA array, or hex string. + """ + # data type: List[int] anyof_schema_1_validator: Optional[conlist(conint(strict=True, le=255, ge=0), max_items=3, min_items=3)] = Field(None, description="RGB three element array with values 0-255.") # data type: List[int] diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py index d96f44bfdf8..e9e97b7d404 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/any_of_pig.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -26,11 +28,10 @@ from pydantic import StrictStr, Field ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] class AnyOfPig(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. """ + AnyOfPig + """ + # data type: BasquePig anyof_schema_1_validator: Optional[BasquePig] = None # data type: DanishPig diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py index ad9080c88ed..da810c92086 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/api_response.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class ApiResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ApiResponse """ code: Optional[StrictInt] = None type: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py index 6ad248d5613..981ec9cebd9 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_array_of_number_only.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictFloat, conlist class ArrayOfArrayOfNumberOnly(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ArrayOfArrayOfNumberOnly """ array_array_number: Optional[conlist(conlist(StrictFloat))] = Field(None, alias="ArrayArrayNumber") additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py index b0bade0c265..89a4169e085 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_of_number_only.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictFloat, conlist class ArrayOfNumberOnly(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ArrayOfNumberOnly """ array_number: Optional[conlist(StrictFloat)] = Field(None, alias="ArrayNumber") additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py index 23024b0959c..9fe1c047ecb 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/array_test.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, StrictInt, StrictStr, conlist from petstore_api.models.read_only_first import ReadOnlyFirst class ArrayTest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ArrayTest """ array_of_string: Optional[conlist(StrictStr, max_items=3, min_items=0)] = None array_array_of_integer: Optional[conlist(conlist(StrictInt))] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py index 2dfbf9c68e8..48ac4d818b7 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/basque_pig.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ import json from pydantic import BaseModel, Field, StrictStr class BasquePig(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + BasquePig """ class_name: StrictStr = Field(..., alias="className") color: StrictStr = ... diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py index edf62140d5f..92695072b18 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/capitalization.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class Capitalization(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Capitalization """ small_camel: Optional[StrictStr] = Field(None, alias="smallCamel") capital_camel: Optional[StrictStr] = Field(None, alias="CapitalCamel") diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py index 54c92e534d6..f2aca668519 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, StrictBool from petstore_api.models.animal import Animal class Cat(Animal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Cat """ declawed: Optional[StrictBool] = None additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py index 17029865e8b..349fcc17b58 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/cat_all_of.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictBool class CatAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + CatAllOf """ declawed: Optional[StrictBool] = None additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py index d2f04fbf284..65579839f32 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/category.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class Category(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Category """ id: Optional[StrictInt] = None name: StrictStr = ... diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/circular_reference_model.py new file mode 100644 index 00000000000..eacb22736b3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/circular_reference_model.py @@ -0,0 +1,87 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictInt + +class CircularReferenceModel(BaseModel): + """ + CircularReferenceModel + """ + size: Optional[StrictInt] = None + nested: Optional[FirstRef] = None + additional_properties: Dict[str, Any] = {} + __properties = ["size", "nested"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> CircularReferenceModel: + """Create an instance of CircularReferenceModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of nested + if self.nested: + _dict['nested'] = self.nested.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> CircularReferenceModel: + """Create an instance of CircularReferenceModel from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return CircularReferenceModel.parse_obj(obj) + + _obj = CircularReferenceModel.parse_obj({ + "size": obj.get("size"), + "nested": FirstRef.from_dict(obj.get("nested")) if obj.get("nested") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py index 6a10ec1d707..b20fe9ca213 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/class_model.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class ClassModel(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Model for testing model with \"_class\" property """ var_class: Optional[StrictStr] = Field(None, alias="_class") additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py index 811d6be903c..a2d08564732 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/client.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class Client(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Client """ client: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/color.py index 45d2d0d8f43..2cc4abc9757 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/color.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -24,10 +26,8 @@ from pydantic import StrictStr, Field COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"] class Color(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + RGB array, RGBA array, or hex string. """ # data type: List[int] oneof_schema_1_validator: Optional[conlist(conint(strict=True, le=255, ge=0), max_items=3, min_items=3)] = Field(None, description="RGB three element array with values 0-255.") diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py index 0f9aa3c03c6..93e6105b2b2 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/danish_pig.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ import json from pydantic import BaseModel, Field, StrictInt, StrictStr class DanishPig(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DanishPig """ class_name: StrictStr = Field(..., alias="className") size: StrictInt = ... diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py index 40e4919b342..870fec8e859 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/deprecated_object.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class DeprecatedObject(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DeprecatedObject """ name: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py index 9465c10bfdc..eb6510a7a17 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, StrictStr from petstore_api.models.animal import Animal class Dog(Animal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Dog """ breed: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py index 526dd6c3578..50b2b59ac0f 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dog_all_of.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class DogAllOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DogAllOf """ breed: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py index ef11b61a2ea..d0db2bdc188 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/dummy_model.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class DummyModel(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + DummyModel """ category: Optional[StrictStr] = None self_ref: Optional[SelfReferenceModel] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py index b1754281dee..82b7bcfc92d 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_arrays.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import List, Optional from pydantic import BaseModel, StrictStr, conlist, validator class EnumArrays(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + EnumArrays """ just_symbol: Optional[StrictStr] = None array_enum: Optional[conlist(StrictStr)] = None @@ -35,18 +35,17 @@ class EnumArrays(BaseModel): def just_symbol_validate_enum(cls, v): if v is None: return v - if v not in ('>=', '$'): - raise ValueError("must validate the enum values ('>=', '$')") + raise ValueError("must be one of enum values ('>=', '$')") return v @validator('array_enum') def array_enum_validate_enum(cls, v): if v is None: return v - - if v not in ('fish', 'crab'): - raise ValueError("must validate the enum values ('fish', 'crab')") + for i in v: + if i not in ('fish', 'crab'): + raise ValueError("each list item must be one of ('fish', 'crab')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_class.py index 9fd2fcc13cd..8f013917f4c 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class EnumClass(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + EnumClass """ """ allowed enum values """ - ABC = '_abc' MINUS_EFG = '-efg' LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS = '(xyz)' diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py index ab30c140963..20db0d562a7 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/enum_test.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -25,10 +27,8 @@ from petstore_api.models.outer_enum_integer import OuterEnumInteger from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue class EnumTest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + EnumTest """ enum_string: Optional[StrictStr] = None enum_string_required: StrictStr = ... @@ -46,42 +46,38 @@ class EnumTest(BaseModel): def enum_string_validate_enum(cls, v): if v is None: return v - if v not in ('UPPER', 'lower', ''): - raise ValueError("must validate the enum values ('UPPER', 'lower', '')") + raise ValueError("must be one of enum values ('UPPER', 'lower', '')") return v @validator('enum_string_required') def enum_string_required_validate_enum(cls, v): if v not in ('UPPER', 'lower', ''): - raise ValueError("must validate the enum values ('UPPER', 'lower', '')") + raise ValueError("must be one of enum values ('UPPER', 'lower', '')") return v @validator('enum_integer_default') def enum_integer_default_validate_enum(cls, v): if v is None: return v - if v not in (1, 5, 14): - raise ValueError("must validate the enum values (1, 5, 14)") + raise ValueError("must be one of enum values (1, 5, 14)") return v @validator('enum_integer') def enum_integer_validate_enum(cls, v): if v is None: return v - if v not in (1, -1): - raise ValueError("must validate the enum values (1, -1)") + raise ValueError("must be one of enum values (1, -1)") return v @validator('enum_number') def enum_number_validate_enum(cls, v): if v is None: return v - if v not in (1.1, -1.2): - raise ValueError("must validate the enum values (1.1, -1.2)") + raise ValueError("must be one of enum values (1.1, -1.2)") return v class Config: @@ -114,7 +110,8 @@ class EnumTest(BaseModel): _dict[_key] = _value # set to None if outer_enum (nullable) is None - if self.outer_enum is None: + # and __fields_set__ contains the field + if self.outer_enum is None and "outer_enum" in self.__fields_set__: _dict['outerEnum'] = None return _dict diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py index 6217ee78824..182d9cd0fc0 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class File(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Must be named `File` for test. """ source_uri: Optional[StrictStr] = Field(None, alias="sourceURI", description="Test capitalization") additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py index 7e8f5b1cc34..f822f4599b3 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/file_schema_test_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, conlist from petstore_api.models.file import File class FileSchemaTestClass(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + FileSchemaTestClass """ file: Optional[File] = None files: Optional[conlist(File)] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/first_ref.py new file mode 100644 index 00000000000..31ac2390677 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/first_ref.py @@ -0,0 +1,87 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr + +class FirstRef(BaseModel): + """ + FirstRef + """ + category: Optional[StrictStr] = None + self_ref: Optional[SecondRef] = None + additional_properties: Dict[str, Any] = {} + __properties = ["category", "self_ref"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> FirstRef: + """Create an instance of FirstRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of self_ref + if self.self_ref: + _dict['self_ref'] = self.self_ref.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> FirstRef: + """Create an instance of FirstRef from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return FirstRef.parse_obj(obj) + + _obj = FirstRef.parse_obj({ + "category": obj.get("category"), + "self_ref": SecondRef.from_dict(obj.get("self_ref")) if obj.get("self_ref") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py index bcb183fae04..7a29b7f5728 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class Foo(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Foo """ bar: Optional[StrictStr] = 'bar' additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py index 0cb3f6286e1..99b2dca4723 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/foo_get_default_response.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel from petstore_api.models.foo import Foo class FooGetDefaultResponse(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + FooGetDefaultResponse """ string: Optional[Foo] = None additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py index 30a49901824..89f85aa14cd 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/format_test.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBytes, StrictInt, StrictStr, condecimal, confloat, conint, constr, validator class FormatTest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + FormatTest """ integer: Optional[conint(strict=True, le=100, ge=10)] = None int32: Optional[conint(strict=True, le=200, ge=20)] = None @@ -34,6 +34,7 @@ class FormatTest(BaseModel): double: Optional[confloat(le=123.4, ge=67.8, strict=True)] = None decimal: Optional[condecimal()] = None string: Optional[constr(strict=True)] = None + string_with_double_quote_pattern: Optional[constr(strict=True)] = None byte: Optional[StrictBytes] = None binary: Optional[StrictBytes] = None var_date: date = Field(..., alias="date") @@ -43,7 +44,7 @@ class FormatTest(BaseModel): pattern_with_digits: Optional[constr(strict=True)] = Field(None, description="A string that is a 10 digit number. Can have leading zeros.") pattern_with_digits_and_delimiter: Optional[constr(strict=True)] = Field(None, description="A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") additional_properties: Dict[str, Any] = {} - __properties = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"] + __properties = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "string_with_double_quote_pattern", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"] @validator('string') def string_validate_regular_expression(cls, v): @@ -51,6 +52,12 @@ class FormatTest(BaseModel): raise ValueError(r"must validate the regular expression /[a-z]/i") return v + @validator('string_with_double_quote_pattern') + def string_with_double_quote_pattern_validate_regular_expression(cls, v): + if not re.match(r"this is \"something\"", v): + raise ValueError(r"must validate the regular expression /this is \"something\"/") + return v + @validator('pattern_with_digits') def pattern_with_digits_validate_regular_expression(cls, v): if not re.match(r"^\d{10}$", v): @@ -112,6 +119,7 @@ class FormatTest(BaseModel): "double": obj.get("double"), "decimal": obj.get("decimal"), "string": obj.get("string"), + "string_with_double_quote_pattern": obj.get("string_with_double_quote_pattern"), "byte": obj.get("byte"), "binary": obj.get("binary"), "var_date": obj.get("date"), diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py index 9a236e34bf1..6207f7f2ece 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/has_only_read_only.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class HasOnlyReadOnly(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + HasOnlyReadOnly """ bar: Optional[StrictStr] = None foo: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py index d6d2aca0baa..51dcd4cdccf 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/health_check_result.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class HealthCheckResult(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. """ nullable_message: Optional[StrictStr] = Field(None, alias="NullableMessage") additional_properties: Dict[str, Any] = {} @@ -60,7 +60,8 @@ class HealthCheckResult(BaseModel): _dict[_key] = _value # set to None if nullable_message (nullable) is None - if self.nullable_message is None: + # and __fields_set__ contains the field + if self.nullable_message is None and "nullable_message" in self.__fields_set__: _dict['NullableMessage'] = None return _dict diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/inner_dict_with_property.py new file mode 100644 index 00000000000..23cc8e6a3a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/inner_dict_with_property.py @@ -0,0 +1,82 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import BaseModel, Field + +class InnerDictWithProperty(BaseModel): + """ + InnerDictWithProperty + """ + a_property: Optional[Dict[str, Any]] = Field(None, alias="aProperty") + additional_properties: Dict[str, Any] = {} + __properties = ["aProperty"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> InnerDictWithProperty: + """Create an instance of InnerDictWithProperty from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> InnerDictWithProperty: + """Create an instance of InnerDictWithProperty from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return InnerDictWithProperty.parse_obj(obj) + + _obj = InnerDictWithProperty.parse_obj({ + "a_property": obj.get("aProperty") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py index bd0b49bc447..27daff87ea4 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/list.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr class List(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + List """ var_123_list: Optional[StrictStr] = Field(None, alias="123-list") additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py index 679a29dc053..ac702eb0a7f 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/map_test.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Dict, Optional from pydantic import BaseModel, StrictBool, StrictStr, validator class MapTest(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + MapTest """ map_map_of_string: Optional[Dict[str, Dict[str, StrictStr]]] = None map_of_enum_string: Optional[Dict[str, StrictStr]] = None @@ -37,9 +37,8 @@ class MapTest(BaseModel): def map_of_enum_string_validate_enum(cls, v): if v is None: return v - if v not in ('UPPER', 'lower'): - raise ValueError("must validate the enum values ('UPPER', 'lower')") + raise ValueError("must be one of enum values ('UPPER', 'lower')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py index 633dbf1da8d..cd9c0204841 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, Field, StrictStr from petstore_api.models.animal import Animal class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + MixedPropertiesAndAdditionalPropertiesClass """ uuid: Optional[StrictStr] = None date_time: Optional[datetime] = Field(None, alias="dateTime") @@ -83,7 +83,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(BaseModel): _obj = MixedPropertiesAndAdditionalPropertiesClass.parse_obj({ "uuid": obj.get("uuid"), "date_time": obj.get("dateTime"), - "map": dict((_k, Dict[str, Animal].from_dict(_v)) for _k, _v in obj.get("map").items()) + "map": dict((_k, Animal.from_dict(_v)) for _k, _v in obj.get("map").items()) if obj.get("map") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py index c6f91f79c3f..30425febafa 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model200_response.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class Model200Response(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Model for testing model name starting with number """ name: Optional[StrictInt] = None var_class: Optional[StrictStr] = Field(None, alias="class") diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py index 53ffd8c2617..e26375be4f7 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/model_return.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt class ModelReturn(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Model for testing reserved words """ var_return: Optional[StrictInt] = Field(None, alias="return") additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py index 0c48837381d..08ad6361c5e 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/name.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class Name(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Model for testing model name same as property name """ name: StrictInt = ... snake_case: Optional[StrictInt] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py index d3e41b7fa00..6c77bc263fa 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/nullable_class.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Any, Dict, List, Optional from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr, conlist class NullableClass(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + NullableClass """ required_integer_prop: Optional[StrictInt] = ... integer_prop: Optional[StrictInt] = None @@ -65,47 +65,58 @@ class NullableClass(BaseModel): }, exclude_none=True) # set to None if required_integer_prop (nullable) is None - if self.required_integer_prop is None: + # and __fields_set__ contains the field + if self.required_integer_prop is None and "required_integer_prop" in self.__fields_set__: _dict['required_integer_prop'] = None # set to None if integer_prop (nullable) is None - if self.integer_prop is None: + # and __fields_set__ contains the field + if self.integer_prop is None and "integer_prop" in self.__fields_set__: _dict['integer_prop'] = None # set to None if number_prop (nullable) is None - if self.number_prop is None: + # and __fields_set__ contains the field + if self.number_prop is None and "number_prop" in self.__fields_set__: _dict['number_prop'] = None # set to None if boolean_prop (nullable) is None - if self.boolean_prop is None: + # and __fields_set__ contains the field + if self.boolean_prop is None and "boolean_prop" in self.__fields_set__: _dict['boolean_prop'] = None # set to None if string_prop (nullable) is None - if self.string_prop is None: + # and __fields_set__ contains the field + if self.string_prop is None and "string_prop" in self.__fields_set__: _dict['string_prop'] = None # set to None if date_prop (nullable) is None - if self.date_prop is None: + # and __fields_set__ contains the field + if self.date_prop is None and "date_prop" in self.__fields_set__: _dict['date_prop'] = None # set to None if datetime_prop (nullable) is None - if self.datetime_prop is None: + # and __fields_set__ contains the field + if self.datetime_prop is None and "datetime_prop" in self.__fields_set__: _dict['datetime_prop'] = None # set to None if array_nullable_prop (nullable) is None - if self.array_nullable_prop is None: + # and __fields_set__ contains the field + if self.array_nullable_prop is None and "array_nullable_prop" in self.__fields_set__: _dict['array_nullable_prop'] = None # set to None if array_and_items_nullable_prop (nullable) is None - if self.array_and_items_nullable_prop is None: + # and __fields_set__ contains the field + if self.array_and_items_nullable_prop is None and "array_and_items_nullable_prop" in self.__fields_set__: _dict['array_and_items_nullable_prop'] = None # set to None if object_nullable_prop (nullable) is None - if self.object_nullable_prop is None: + # and __fields_set__ contains the field + if self.object_nullable_prop is None and "object_nullable_prop" in self.__fields_set__: _dict['object_nullable_prop'] = None # set to None if object_and_items_nullable_prop (nullable) is None - if self.object_and_items_nullable_prop is None: + # and __fields_set__ contains the field + if self.object_and_items_nullable_prop is None and "object_and_items_nullable_prop" in self.__fields_set__: _dict['object_and_items_nullable_prop'] = None return _dict diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py index 563edbe9c86..65809405f19 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/number_only.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictFloat class NumberOnly(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + NumberOnly """ just_number: Optional[StrictFloat] = Field(None, alias="JustNumber") additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py index 7f4fef2a658..7904c259858 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/object_with_deprecated_fields.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, Field, StrictFloat, StrictStr, conlist from petstore_api.models.deprecated_object import DeprecatedObject class ObjectWithDeprecatedFields(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ObjectWithDeprecatedFields """ uuid: Optional[StrictStr] = None id: Optional[StrictFloat] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py index ff917f3ff06..cdd825329e9 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/order.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator class Order(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Order """ id: Optional[StrictInt] = None pet_id: Optional[StrictInt] = Field(None, alias="petId") @@ -39,9 +39,8 @@ class Order(BaseModel): def status_validate_enum(cls, v): if v is None: return v - if v not in ('placed', 'approved', 'delivered'): - raise ValueError("must validate the enum values ('placed', 'approved', 'delivered')") + raise ValueError("must be one of enum values ('placed', 'approved', 'delivered')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py index 609e6edc4f7..855fb1a585e 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_composite.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictBool, StrictFloat, StrictStr class OuterComposite(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterComposite """ my_number: Optional[StrictFloat] = None my_string: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum.py index 179e822d35d..befbdfdaa67 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class OuterEnum(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterEnum """ """ allowed enum values """ - PLACED = 'placed' APPROVED = 'approved' DELIVERED = 'delivered' diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_default_value.py index 4a93cbda580..b8937b43c42 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_default_value.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class OuterEnumDefaultValue(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterEnumDefaultValue """ """ allowed enum values """ - PLACED = 'placed' APPROVED = 'approved' DELIVERED = 'delivered' diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer.py index 4a4347e3106..72aa99814d4 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class OuterEnumInteger(int, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterEnumInteger """ """ allowed enum values """ - NUMBER_0 = 0 NUMBER_1 = 1 NUMBER_2 = 2 diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer_default_value.py index b0e86076d16..09a945f73c3 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_enum_integer_default_value.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class OuterEnumIntegerDefaultValue(int, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterEnumIntegerDefaultValue """ """ allowed enum values """ - NUMBER_0 = 0 NUMBER_1 = 1 NUMBER_2 = 2 diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py index 049fa5026e7..93e47d8b48b 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/outer_object_with_enum_property.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -23,10 +25,8 @@ from petstore_api.models.outer_enum import OuterEnum from petstore_api.models.outer_enum_integer import OuterEnumInteger class OuterObjectWithEnumProperty(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + OuterObjectWithEnumProperty """ str_value: Optional[OuterEnum] = None value: OuterEnumInteger = ... @@ -63,7 +63,8 @@ class OuterObjectWithEnumProperty(BaseModel): _dict[_key] = _value # set to None if str_value (nullable) is None - if self.str_value is None: + # and __fields_set__ contains the field + if self.str_value is None and "str_value" in self.__fields_set__: _dict['str_value'] = None return _dict diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent_with_optional_dict.py new file mode 100644 index 00000000000..9c18456d3b8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/parent_with_optional_dict.py @@ -0,0 +1,90 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Dict, Optional +from pydantic import BaseModel, Field +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty + +class ParentWithOptionalDict(BaseModel): + """ + ParentWithOptionalDict + """ + optional_dict: Optional[Dict[str, InnerDictWithProperty]] = Field(None, alias="optionalDict") + additional_properties: Dict[str, Any] = {} + __properties = ["optionalDict"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ParentWithOptionalDict: + """Create an instance of ParentWithOptionalDict from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each value in optional_dict (dict) + _field_dict = {} + if self.optional_dict: + for _key in self.optional_dict: + if self.optional_dict[_key]: + _field_dict[_key] = self.optional_dict[_key].to_dict() + _dict['optionalDict'] = _field_dict + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ParentWithOptionalDict: + """Create an instance of ParentWithOptionalDict from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return ParentWithOptionalDict.parse_obj(obj) + + _obj = ParentWithOptionalDict.parse_obj({ + "optional_dict": dict((_k, InnerDictWithProperty.from_dict(_v)) for _k, _v in obj.get("optionalDict").items()) if obj.get("optionalDict") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py index de8df07a07f..ae46c225407 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pet.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -23,10 +25,8 @@ from petstore_api.models.category import Category from petstore_api.models.tag import Tag class Pet(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Pet """ id: Optional[StrictInt] = None category: Optional[Category] = None @@ -41,9 +41,8 @@ class Pet(BaseModel): def status_validate_enum(cls, v): if v is None: return v - if v not in ('available', 'pending', 'sold'): - raise ValueError("must validate the enum values ('available', 'pending', 'sold')") + raise ValueError("must be one of enum values ('available', 'pending', 'sold')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py index 0799371faa4..66cebdd798c 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/pig.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -26,10 +28,8 @@ from pydantic import StrictStr, Field PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"] class Pig(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Pig """ # data type: BasquePig oneof_schema_1_validator: Optional[BasquePig] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py index 5323927c4c3..73a9c98aec4 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/read_only_first.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictStr class ReadOnlyFirst(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + ReadOnlyFirst """ bar: Optional[StrictStr] = None baz: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/second_ref.py new file mode 100644 index 00000000000..228c8b24b92 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/second_ref.py @@ -0,0 +1,87 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import annotations +from inspect import getfullargspec +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr + +class SecondRef(BaseModel): + """ + SecondRef + """ + category: Optional[StrictStr] = None + circular_ref: Optional[CircularReferenceModel] = None + additional_properties: Dict[str, Any] = {} + __properties = ["category", "circular_ref"] + + class Config: + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> SecondRef: + """Create an instance of SecondRef from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of circular_ref + if self.circular_ref: + _dict['circular_ref'] = self.circular_ref.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> SecondRef: + """Create an instance of SecondRef from a dict""" + if obj is None: + return None + + if type(obj) is not dict: + return SecondRef.parse_obj(obj) + + _obj = SecondRef.parse_obj({ + "category": obj.get("category"), + "circular_ref": CircularReferenceModel.from_dict(obj.get("circular_ref")) if obj.get("circular_ref") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py index c97efa222a4..faca1f2f565 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/self_reference_model.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt class SelfReferenceModel(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SelfReferenceModel """ size: Optional[StrictInt] = None nested: Optional[DummyModel] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/single_ref_type.py index 67ae5e41be3..e5879e62968 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/single_ref_type.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/single_ref_type.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class SingleRefType(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SingleRefType """ """ allowed enum values """ - ADMIN = 'admin' USER = 'user' diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_character_enum.py index 374ac242de6..8ecf8ac3d69 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_character_enum.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_character_enum.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -20,16 +22,13 @@ from aenum import Enum, no_arg class SpecialCharacterEnum(str, Enum): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SpecialCharacterEnum """ """ allowed enum values """ - ENUM_456 = '456' ENUM_123ABC = '123abc' UNDERSCORE = '_' diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py index aeb308dd45b..0f7f93facf7 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_model_name.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt class SpecialModelName(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SpecialModelName """ special_property_name: Optional[StrictInt] = Field(None, alias="$special[property.name]") additional_properties: Dict[str, Any] = {} diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py index bd3b377e886..e0a6c30fa77 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/special_name.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from petstore_api.models.category import Category class SpecialName(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + SpecialName """ var_property: Optional[StrictInt] = Field(None, alias="property") var_async: Optional[Category] = Field(None, alias="async") @@ -37,9 +37,8 @@ class SpecialName(BaseModel): def var_schema_validate_enum(cls, v): if v is None: return v - if v not in ('available', 'pending', 'sold'): - raise ValueError("must validate the enum values ('available', 'pending', 'sold')") + raise ValueError("must be one of enum values ('available', 'pending', 'sold')") return v class Config: diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py index b3af7e9e49c..4b01f942e82 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/tag.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr class Tag(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + Tag """ id: Optional[StrictInt] = None name: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py index 6426d6c8aee..c52f49d337a 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/user.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -21,10 +23,8 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr class User(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + User """ id: Optional[StrictInt] = None username: Optional[StrictStr] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py index 0e80a8a9020..52a535dcef2 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/models/with_nested_one_of.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -22,10 +24,8 @@ from pydantic import BaseModel, StrictInt from petstore_api.models.pig import Pig class WithNestedOneOf(BaseModel): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. + """ + WithNestedOneOf """ size: Optional[StrictInt] = None nested_pig: Optional[Pig] = None diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/rest.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/rest.py index c2c0630f61f..e26c0b96ea2 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/rest.py @@ -6,12 +6,12 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ -from __future__ import absolute_import - import io import json import logging diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/signing.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/signing.py index 5060f6edbcd..cc1a0c9d6f7 100644 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/signing.py @@ -4,7 +4,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -72,11 +74,6 @@ class HttpSigningConfiguration(object): and optionally the body of the HTTP request, then signing the hash value using a private key. The 'Authorization' header is added to outbound HTTP requests. - NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param key_id: A string value specifying the identifier of the cryptographic key, when signing HTTP requests. :param signing_scheme: A string value specifying the signature scheme, when diff --git a/samples/openapi3/client/petstore/python-nextgen/pyproject.toml b/samples/openapi3/client/petstore/python-nextgen/pyproject.toml new file mode 100644 index 00000000000..b31e8940819 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/pyproject.toml @@ -0,0 +1,29 @@ +[tool.poetry] +name = "petstore_api" +version = "1.0.0" +description = "OpenAPI Petstore" +authors = ["OpenAPI Generator Community "] +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/GIT_REPO_ID/GIT_USER_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +pydantic = "^1.10.5" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + diff --git a/samples/openapi3/client/petstore/python-nextgen/requirements.txt b/samples/openapi3/client/petstore/python-nextgen/requirements.txt index b98ff3e6069..74ede174a0a 100755 --- a/samples/openapi3/client/petstore/python-nextgen/requirements.txt +++ b/samples/openapi3/client/petstore/python-nextgen/requirements.txt @@ -1,5 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.25.3 -pydantic >= 1.10.2 +pydantic >= 1.10.5, < 2 aenum >= 3.1.11 diff --git a/samples/openapi3/client/petstore/python-nextgen/setup.py b/samples/openapi3/client/petstore/python-nextgen/setup.py index cfffce8e317..10a96353933 100755 --- a/samples/openapi3/client/petstore/python-nextgen/setup.py +++ b/samples/openapi3/client/petstore/python-nextgen/setup.py @@ -6,7 +6,9 @@ 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 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. """ @@ -26,7 +28,7 @@ REQUIRES = [ "python-dateutil", "pem>=19.3.0", "pycryptodome>=3.9.0", - "pydantic", + "pydantic >= 1.10.5, < 2", "aenum" ] diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_circular_reference_model.py b/samples/openapi3/client/petstore/python-nextgen/test/test_circular_reference_model.py new file mode 100644 index 00000000000..f734d3fc0ff --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/test/test_circular_reference_model.py @@ -0,0 +1,64 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.circular_reference_model import CircularReferenceModel # noqa: E501 +from petstore_api.rest import ApiException + +class TestCircularReferenceModel(unittest.TestCase): + """CircularReferenceModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test CircularReferenceModel + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CircularReferenceModel` + """ + model = petstore_api.models.circular_reference_model.CircularReferenceModel() # noqa: E501 + if include_optional : + return CircularReferenceModel( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', ), ), ), ) + ) + else : + return CircularReferenceModel( + ) + """ + + def testCircularReferenceModel(self): + """Test CircularReferenceModel""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_first_ref.py b/samples/openapi3/client/petstore/python-nextgen/test/test_first_ref.py new file mode 100644 index 00000000000..bcec1c0334b --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/test/test_first_ref.py @@ -0,0 +1,62 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.first_ref import FirstRef # noqa: E501 +from petstore_api.rest import ApiException + +class TestFirstRef(unittest.TestCase): + """FirstRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test FirstRef + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FirstRef` + """ + model = petstore_api.models.first_ref.FirstRef() # noqa: E501 + if include_optional : + return FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', ), ), ) + ) + else : + return FirstRef( + ) + """ + + def testFirstRef(self): + """Test FirstRef""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_inner_dict_with_property.py b/samples/openapi3/client/petstore/python-nextgen/test/test_inner_dict_with_property.py new file mode 100644 index 00000000000..8a63b70d552 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/test/test_inner_dict_with_property.py @@ -0,0 +1,56 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.inner_dict_with_property import InnerDictWithProperty # noqa: E501 +from petstore_api.rest import ApiException + +class TestInnerDictWithProperty(unittest.TestCase): + """InnerDictWithProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test InnerDictWithProperty + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InnerDictWithProperty` + """ + model = petstore_api.models.inner_dict_with_property.InnerDictWithProperty() # noqa: E501 + if include_optional : + return InnerDictWithProperty( + a_property = None + ) + else : + return InnerDictWithProperty( + ) + """ + + def testInnerDictWithProperty(self): + """Test InnerDictWithProperty""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-nextgen/test/test_parent_with_optional_dict.py new file mode 100644 index 00000000000..25b769e3d39 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/test/test_parent_with_optional_dict.py @@ -0,0 +1,59 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict # noqa: E501 +from petstore_api.rest import ApiException + +class TestParentWithOptionalDict(unittest.TestCase): + """ParentWithOptionalDict unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test ParentWithOptionalDict + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ParentWithOptionalDict` + """ + model = petstore_api.models.parent_with_optional_dict.ParentWithOptionalDict() # noqa: E501 + if include_optional : + return ParentWithOptionalDict( + optional_dict = { + 'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty( + a_property = petstore_api.models.a_property.aProperty(), ) + } + ) + else : + return ParentWithOptionalDict( + ) + """ + + def testParentWithOptionalDict(self): + """Test ParentWithOptionalDict""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen/test/test_second_ref.py b/samples/openapi3/client/petstore/python-nextgen/test/test_second_ref.py new file mode 100644 index 00000000000..782892fd4e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/test/test_second_ref.py @@ -0,0 +1,62 @@ +# 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 OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.second_ref import SecondRef # noqa: E501 +from petstore_api.rest import ApiException + +class TestSecondRef(unittest.TestCase): + """SecondRef unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test SecondRef + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SecondRef` + """ + model = petstore_api.models.second_ref.SecondRef() # noqa: E501 + if include_optional : + return SecondRef( + category = '', + circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model( + size = 56, + nested = petstore_api.models.first_ref.FirstRef( + category = '', + self_ref = petstore_api.models.second_ref.SecondRef( + category = '', ), ), ) + ) + else : + return SecondRef( + ) + """ + + def testSecondRef(self): + """Test SecondRef""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_client.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_client.py index 2a9bbc69510..318545d6e8f 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_client.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_client.py @@ -4,9 +4,9 @@ """ Run the tests. -$ pip install nose (optional) +$ pip install -U pytest $ cd OpenAPIetstore-python -$ nosetests -v +$ pytest """ import os diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_exception.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_exception.py index d517910174c..73915b0d5fc 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_exception.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_exception.py @@ -4,9 +4,9 @@ """ Run the tests. -$ pip install nose (optional) +$ pip install -U pytest $ cd petstore_api-python -$ nosetests -v +$ pytest """ import os diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_validation.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_validation.py index b42e6e50179..dc7da96329c 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_api_validation.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_api_validation.py @@ -4,9 +4,9 @@ """ Run the tests. -$ pip install nose (optional) +$ pip install -U pytest $ cd petstore_api-python -$ nosetests -v +$ pytest """ import os diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_configuration.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_configuration.py index 21ab0219e01..df5f4f3b106 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_configuration.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_configuration.py @@ -4,9 +4,9 @@ """ Run the tests. -$ pip install nose (optional) +$ pip install -U pytest $ cd petstore_api-python -$ nosetests -v +$ pytest """ from __future__ import absolute_import diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_deserialization.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_deserialization.py index 213e7000f63..c5fb6866382 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_deserialization.py @@ -4,9 +4,9 @@ """ Run the tests. -$ pip install nose (optional) +$ pip install -U pytest $ cd OpenAPIPetstore-python -$ nosetests -v +$ pytest """ from collections import namedtuple import json diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_map_test.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_map_test.py index 4b2c6d5069e..8c0cb48f432 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_map_test.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_map_test.py @@ -4,9 +4,9 @@ """ Run the tests. -$ pip install nose (optional) +$ pip install -U pytest $ cd petstore_api-python -$ nosetests -v +$ pytest """ import os diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_model.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_model.py index e437c7b6d80..c32a36c7460 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_model.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_model.py @@ -289,7 +289,7 @@ class ModelTests(unittest.TestCase): # test enum ref property # test to_json d = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1) - self.assertEqual(d.to_json(), '{"value": 1, "str_value": null}') + self.assertEqual(d.to_json(), '{"value": 1}') d2 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=petstore_api.OuterEnum.DELIVERED) self.assertEqual(d2.to_json(), '{"str_value": "delivered", "value": 1}') # test from_json (round trip) @@ -297,6 +297,13 @@ class ModelTests(unittest.TestCase): self.assertEqual(d3.str_value, petstore_api.OuterEnum.DELIVERED) self.assertEqual(d3.value, petstore_api.OuterEnumInteger.NUMBER_1) self.assertEqual(d3.to_json(), '{"str_value": "delivered", "value": 1}') + d4 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=None) + self.assertEqual(d4.to_json(), '{"value": 1, "str_value": null}') + d5 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1) + self.assertEqual(d5.__fields_set__, {'value'}) + d5.str_value = None # set None explicitly + self.assertEqual(d5.__fields_set__, {'value', 'str_value'}) + self.assertEqual(d5.to_json(), '{"value": 1, "str_value": null}') def test_valdiator(self): # test regular expression @@ -319,7 +326,7 @@ class ModelTests(unittest.TestCase): self.pet.status = "error" self.assertTrue(False) # this line shouldn't execute except ValueError as e: - self.assertTrue("must validate the enum values ('available', 'pending', 'sold')" in str(e)) + self.assertTrue("must be one of enum values ('available', 'pending', 'sold')" in str(e)) def test_object_id(self): pet_ap = petstore_api.Pet(name="test name", photo_urls=["string"]) @@ -387,3 +394,12 @@ class ModelTests(unittest.TestCase): enum_test = petstore_api.EnumTest(enum_string_required="lower") self.assertEqual(enum_test.enum_integer_default, 5) + def test_object_with_optional_dict(self): + # for https://github.com/OpenAPITools/openapi-generator/issues/14913 + # shouldn't throw exception by the optional dict property + a = petstore_api.ParentWithOptionalDict.from_dict({}) + self.assertFalse(a is None) + + b = petstore_api.ParentWithOptionalDict.from_dict({"optionalDict": {"key": {"aProperty": {"a": "b"}}}}) + self.assertFalse(b is None) + self.assertEqual(b.optional_dict["key"].a_property["a"], "b") diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_api.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_api.py index 60302f0a776..073e5e5c6f2 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_pet_api.py @@ -6,9 +6,9 @@ Run the tests. $ docker pull swaggerapi/petstore $ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -$ pip install nose (optional) +$ pip install -U pytest $ cd petstore_api-python -$ nosetests -v +$ pytest """ import os diff --git a/samples/openapi3/client/petstore/python-nextgen/tests/test_store_api.py b/samples/openapi3/client/petstore/python-nextgen/tests/test_store_api.py index 1817477aba6..178e44fd1fe 100644 --- a/samples/openapi3/client/petstore/python-nextgen/tests/test_store_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/tests/test_store_api.py @@ -4,9 +4,9 @@ """ Run the tests. -$ pip install nose (optional) +$ pip install -U pytest $ cd OpenAP/Petstore-python -$ nosetests -v +$ pytest """ import os diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Category.java index e2206012211..f288a0edde9 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Category { */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/ModelApiResponse.java index 6f12dac83ae..369df105a62 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Order.java index 8e9325fbea4..906d04ddd72 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java index 16a192536ec..52bb7a983b1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Tag.java index 98c023bf698..2f0f6cb4760 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/User.java index 753145eb0b3..55f1824b941 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index d5f141a9b72..49df694cced 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -41,15 +41,22 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid input (status code 405) + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "405", description = "Invalid input") }, security = { @@ -59,15 +66,17 @@ public interface PetApi { @RequestMapping( method = RequestMethod.POST, value = "/pet", + produces = "application/json", consumes = "application/json" ) - CompletableFuture> addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + CompletableFuture> addPet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -76,6 +85,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "400", description = "Invalid pet value") @@ -115,7 +125,7 @@ public interface PetApi { @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" }) } ) @RequestMapping( @@ -151,7 +161,7 @@ public interface PetApi { @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" }) } ) @RequestMapping( @@ -202,37 +212,49 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid ID supplied (status code 400) + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) + * API documentation for the updatePet operation + * @see Update an existing pet Documentation */ @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found"), @ApiResponse(responseCode = "405", description = "Validation exception") }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } + }, + externalDocs = @ExternalDocumentation(description = "API documentation for the updatePet operation", url = "http://petstore.swagger.io/v2/doc/updatePet") ) @RequestMapping( method = RequestMethod.PUT, value = "/pet", + produces = "application/json", consumes = "application/json" ) - CompletableFuture> updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + CompletableFuture> updatePet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -242,6 +264,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -264,6 +287,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -273,6 +297,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 0f8f80da8e5..a761961df8d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -131,14 +131,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -151,10 +153,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = "application/json" + produces = "application/json", + consumes = "application/json" ) CompletableFuture> placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 97d5cda1174..dc736e5c5d4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -44,7 +44,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -54,60 +54,76 @@ public interface UserApi { tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = "application/json" ) CompletableFuture> createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ); /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = "application/json" ) CompletableFuture> createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = "application/json" ) CompletableFuture> createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -127,6 +143,9 @@ public interface UserApi { responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( @@ -140,6 +159,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -149,6 +169,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -171,6 +192,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -180,6 +202,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -195,22 +218,27 @@ public interface UserApi { produces = "application/json" ) CompletableFuture> loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( @@ -227,7 +255,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -239,15 +267,19 @@ public interface UserApi { responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = "application/json" ) CompletableFuture> updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java index 2a90a2f0a4f..0c0e8e8e72a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -56,8 +55,9 @@ public class Category { * Get name * @return name */ - + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java index e18ac769bd2..00924b168ab 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java index 317082440c6..4c1bb184a39 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..7ed29b5a5c0 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java index b748650e3c0..adea27d0193 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java index ac6ddb97bbc..9ec0b712b14 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java index d4de6f24409..004fa56cd11 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java @@ -25,23 +25,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("@type") private String atType = "Pet"; - @JsonProperty("age") private Integer age = 4; - @JsonProperty("happy") private Boolean happy = true; - @JsonProperty("price") private BigDecimal price = new BigDecimal("32000000000"); - @JsonProperty("lastFeed") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime lastFeed = OffsetDateTime.parse("1973-12-19T11:39:57Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault())); - @JsonProperty("dateOfBirth") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate dateOfBirth = LocalDate.parse("2021-01-01"); @@ -72,6 +66,7 @@ public class Pet { */ @NotNull @Schema(name = "@type", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("@type") public String getAtType() { return atType; } @@ -91,6 +86,7 @@ public class Pet { */ @Schema(name = "age", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("age") public Integer getAge() { return age; } @@ -110,6 +106,7 @@ public class Pet { */ @Schema(name = "happy", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("happy") public Boolean getHappy() { return happy; } @@ -129,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "price", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("price") public BigDecimal getPrice() { return price; } @@ -148,6 +146,7 @@ public class Pet { */ @Valid @Schema(name = "lastFeed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastFeed") public OffsetDateTime getLastFeed() { return lastFeed; } @@ -167,6 +166,7 @@ public class Pet { */ @Valid @Schema(name = "dateOfBirth", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateOfBirth") public LocalDate getDateOfBirth() { return dateOfBirth; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/.openapi-generator/FILES b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/.openapi-generator/FILES index 682ec1ebc9a..5ebc7f2a19f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/.openapi-generator/FILES @@ -26,6 +26,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -48,6 +49,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java index 36c107b4672..c2da7881602 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -62,7 +62,7 @@ public interface AnotherFakeApi { consumes = "application/json" ) ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index 1d438584d86..753b0920996 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -92,7 +92,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = "*/*" + produces = "*/*", + consumes = "application/json" ) ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -103,7 +104,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @Operation( @@ -119,10 +120,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = "*/*" + produces = "*/*", + consumes = "application/json" ) ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ); @@ -146,7 +148,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = "*/*" + produces = "*/*", + consumes = "application/json" ) ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -173,7 +176,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = "*/*" + produces = "*/*", + consumes = "application/json" ) ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -184,7 +188,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @Operation( @@ -201,7 +205,7 @@ public interface FakeApi { consumes = "application/json" ) ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ); @@ -209,7 +213,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @Operation( @@ -226,7 +230,7 @@ public interface FakeApi { ) ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ); @@ -234,7 +238,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -255,7 +259,7 @@ public interface FakeApi { consumes = "application/json" ) ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); @@ -395,13 +399,15 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -413,12 +419,13 @@ public interface FakeApi { consumes = "application/json" ) ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ); /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -427,6 +434,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -448,7 +456,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -468,7 +475,6 @@ public interface FakeApi { ) ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 324cfc2c05c..f198c4c3c7f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -41,7 +41,7 @@ public interface FakeClassnameTags123Api { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -65,7 +65,7 @@ public interface FakeClassnameTags123Api { consumes = "application/json" ) ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java index e915c89795e..b7f854fb0d5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import java.util.Set; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; @@ -41,14 +42,16 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -64,12 +67,13 @@ public interface PetApi { consumes = "application/json" ) ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -79,6 +83,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -205,9 +210,35 @@ public interface PetApi { /** - * PUT /pet : Update an existing pet + * GET /fake/{petId}/response-object-different-names * - * @param body Pet object that needs to be added to the store (required) + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "responseObjectDifferentNames", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNames.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = "application/json" + ) + ResponseEntity responseObjectDifferentNames( + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId + ); + + + /** + * PUT /pet : Update an existing pet + * + * + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -216,6 +247,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -233,12 +265,13 @@ public interface PetApi { consumes = "application/json" ) ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -248,6 +281,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -270,6 +304,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -279,6 +314,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -304,6 +340,7 @@ public interface PetApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -313,6 +350,7 @@ public interface PetApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java index 9a8f78009ec..473a259c087 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java @@ -130,14 +130,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -150,10 +152,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = "application/json" + produces = "application/json", + consumes = "application/json" ) ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java index ff311c8da70..9118249f8d8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java @@ -43,7 +43,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -57,22 +57,25 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = "application/json" ) ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ); /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -80,22 +83,25 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = "application/json" ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -103,10 +109,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = "application/json" ) ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -139,6 +146,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -148,6 +156,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -170,6 +179,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -179,6 +189,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -201,12 +212,14 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -226,7 +239,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -242,11 +255,12 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = "application/json" ) ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0661c1a9a8d..690bd609d23 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index a3f9c905789..db5353d2d35 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index db5f8d3ce35..5beed6563d9 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 14e13504a8c..eff5bd5fa4b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -25,45 +28,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -85,6 +77,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -112,6 +105,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -139,6 +133,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -166,6 +161,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -193,6 +189,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -220,6 +217,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -247,6 +245,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -274,6 +273,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -293,6 +293,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -302,7 +303,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +313,12 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -331,6 +333,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index ff0d6d7241e..e3d835a5124 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index cc212be855d..6cde3b272d2 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 7c74b7de08d..948a430c814 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 6087e70dba7..d59141c231c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesString extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java index 1ecf10efc5c..01d2e481148 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java @@ -7,9 +7,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -38,28 +35,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; - /** - * Default constructor - * @deprecated Use {@link Animal#Animal(String)} - */ - @Deprecated - public Animal() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Animal(String className) { - this.className = className; - } - public Animal className(String className) { this.className = className; return this; @@ -71,6 +50,7 @@ public class Animal { */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("className") public String getClassName() { return className; } @@ -90,6 +70,7 @@ public class Animal { */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 42600354f74..d7f3b9f37fa 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 2f6c19a8344..6215ba771a0 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java index 23ee84ce8b5..d53a9e07ad8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java @@ -24,17 +24,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -55,6 +52,7 @@ public class ArrayTest { */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -82,6 +80,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -109,6 +108,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java index 8c5453c4a5b..1185161d530 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java @@ -66,25 +66,8 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; - /** - * Default constructor - * @deprecated Use {@link BigCat#BigCat(String)} - */ - @Deprecated - public BigCat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public BigCat(String className) { - super(className); - } - public BigCat kind(KindEnum kind) { this.kind = kind; return this; @@ -96,6 +79,7 @@ public class BigCat extends Cat { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java index 741de9f41a3..bff7b148aa2 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -63,7 +63,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -77,6 +76,7 @@ public class BigCatAllOf { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java index 0c56400050b..31142a864ec 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java @@ -21,22 +21,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -50,6 +44,7 @@ public class Capitalization { */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -69,6 +64,7 @@ public class Capitalization { */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -88,6 +84,7 @@ public class Capitalization { */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -107,6 +104,7 @@ public class Capitalization { */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -126,6 +124,7 @@ public class Capitalization { */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,6 +144,7 @@ public class Capitalization { */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java index a2feece8de8..19aef83bf5d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -35,25 +34,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; - /** - * Default constructor - * @deprecated Use {@link Cat#Cat(String)} - */ - @Deprecated - public Cat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Cat(String className) { - super(className); - } - public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; @@ -65,6 +47,7 @@ public class Cat extends Animal { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java index 50a9c2cdce9..0bd8697513e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -37,6 +36,7 @@ public class CatAllOf { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java index 7ee1fde0646..89a67825e64 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java @@ -21,28 +21,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; - /** - * Default constructor - * @deprecated Use {@link Category#Category(String)} - */ - @Deprecated - public Category() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Category(String name) { - this.name = name; - } - public Category id(Long id) { this.id = id; return this; @@ -54,6 +36,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -73,6 +56,7 @@ public class Category { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java index a1942e9c404..95bad44f680 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -36,6 +35,7 @@ public class ClassModel { */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java index c38b26829be..c070bc9214b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -35,6 +34,7 @@ public class Client { */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..6c5b41d66d4 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,207 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java index 1bb3d6b5102..9c16eaab598 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java @@ -26,25 +26,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; - /** - * Default constructor - * @deprecated Use {@link Dog#Dog(String)} - */ - @Deprecated - public Dog() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Dog(String className) { - super(className); - } - public Dog breed(String breed) { this.breed = breed; return this; @@ -56,6 +39,7 @@ public class Dog extends Animal { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java index 256925a7841..6b11905f99a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -37,6 +36,7 @@ public class DogAllOf { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java index 2720e81c227..3d3280a42dc 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java @@ -59,7 +59,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -97,9 +96,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -112,6 +110,7 @@ public class EnumArrays { */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -139,6 +138,7 @@ public class EnumArrays { */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java index 6f08d4ee9fb..3b9b41f5acf 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java @@ -62,7 +62,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -102,7 +101,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -140,7 +138,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -178,28 +175,10 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; - /** - * Default constructor - * @deprecated Use {@link EnumTest#EnumTest(EnumStringRequiredEnum)} - */ - @Deprecated - public EnumTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EnumTest(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; @@ -211,6 +190,7 @@ public class EnumTest { */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -230,6 +210,7 @@ public class EnumTest { */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -249,6 +230,7 @@ public class EnumTest { */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -268,6 +250,7 @@ public class EnumTest { */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -287,6 +270,7 @@ public class EnumTest { */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java index bf750ccdcb7..7b04101a36a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -36,6 +35,7 @@ public class File { */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b196d5d7de..be6e37a7aba 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -24,12 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -42,6 +40,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("file") public File getFile() { return file; } @@ -69,6 +68,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java index 06e9dde8e89..81c7dcc4e28 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java @@ -29,69 +29,36 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; - /** - * Default constructor - * @deprecated Use {@link FormatTest#FormatTest(BigDecimal, byte[], LocalDate, String)} - */ - @Deprecated - public FormatTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) { - this.number = number; - this._byte = _byte; - this.date = date; - this.password = password; - } - public FormatTest integer(Integer integer) { this.integer = integer; return this; @@ -105,6 +72,7 @@ public class FormatTest { */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -126,6 +94,7 @@ public class FormatTest { */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -145,6 +114,7 @@ public class FormatTest { */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -166,6 +136,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -187,6 +158,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("float") public Float getFloat() { return _float; } @@ -208,6 +180,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("double") public Double getDouble() { return _double; } @@ -227,6 +200,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("string") public String getString() { return string; } @@ -246,6 +220,7 @@ public class FormatTest { */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -265,6 +240,7 @@ public class FormatTest { */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -284,6 +260,7 @@ public class FormatTest { */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -303,6 +280,7 @@ public class FormatTest { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -322,6 +300,7 @@ public class FormatTest { */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -341,6 +320,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -360,6 +340,7 @@ public class FormatTest { */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c218d0e02b8..196214695a1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -40,6 +38,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -59,6 +58,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java index 9811806e0c8..7215fd65d7a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -63,17 +62,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -94,6 +90,7 @@ public class MapTest { */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -121,6 +118,7 @@ public class MapTest { */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,6 +146,7 @@ public class MapTest { */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -175,6 +174,7 @@ public class MapTest { */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bcf0155a1b2..7dd078dbaa8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -27,16 +27,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -49,6 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -68,6 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -95,6 +94,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java index 9ca96d114aa..32198c000f1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -41,6 +39,7 @@ public class Model200Response { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -60,6 +59,7 @@ public class Model200Response { */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java index 06c806057b5..0a803038551 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -43,6 +40,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -62,6 +60,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -81,6 +80,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java index f168748f6a2..c2ac56a57a7 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -37,6 +36,7 @@ public class ModelList { */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java index 641c56cd81c..83da161c83f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -38,6 +37,7 @@ public class ModelReturn { */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java index d6dcb665651..85808ddbaa4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java @@ -22,34 +22,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; - /** - * Default constructor - * @deprecated Use {@link Name#Name(Integer)} - */ - @Deprecated - public Name() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Name(Integer name) { - this.name = name; - } - public Name name(Integer name) { this.name = name; return this; @@ -61,6 +41,7 @@ public class Name { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -80,6 +61,7 @@ public class Name { */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -99,6 +81,7 @@ public class Name { */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property") public String getProperty() { return property; } @@ -118,6 +101,7 @@ public class Name { */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java index 4a3b6beffa2..1ec233732c3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -36,6 +35,7 @@ public class NumberOnly { */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java index 9a5b61bad43..9566edcbed8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java @@ -24,16 +24,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -74,10 +70,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -91,6 +85,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -110,6 +105,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -129,6 +125,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -148,6 +145,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -167,6 +165,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -186,6 +185,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java index b66d6d38afb..6b611504866 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java @@ -22,13 +22,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -42,6 +39,7 @@ public class OuterComposite { */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -61,6 +59,7 @@ public class OuterComposite { */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -80,6 +79,7 @@ public class OuterComposite { */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java index 6adaaba97d7..b313f7bb7e2 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java @@ -29,22 +29,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -83,26 +78,8 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; - /** - * Default constructor - * @deprecated Use {@link Pet#Pet(String, Set)} - */ - @Deprecated - public Pet() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Pet(String name, Set photoUrls) { - this.name = name; - this.photoUrls = photoUrls; - } - public Pet id(Long id) { this.id = id; return this; @@ -114,6 +91,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -133,6 +111,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -152,6 +131,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -166,6 +146,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -176,6 +159,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -204,6 +188,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -223,6 +208,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 8c43e7e8c30..8891d8dac55 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -38,6 +36,7 @@ public class ReadOnlyFirst { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -57,6 +56,7 @@ public class ReadOnlyFirst { */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..c681122f5f8 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,155 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java index c3d3aa9182e..51dfdf9de43 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,11 +19,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -37,6 +36,7 @@ public class SpecialModelName { */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java index 03d5607e29b..b6dd153652a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -38,6 +36,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -57,6 +56,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java index 67ef036857d..eda3e4f43d3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -24,41 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderDefault#TypeHolderDefault(String, BigDecimal, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderDefault() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; @@ -71,6 +46,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -90,6 +66,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -109,6 +86,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -128,6 +106,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -142,6 +121,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -152,6 +134,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java index 5b77bee14c1..fe3412f3358 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -24,46 +24,19 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); - /** - * Default constructor - * @deprecated Use {@link TypeHolderExample#TypeHolderExample(String, BigDecimal, Float, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderExample() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.floatItem = floatItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; return this; @@ -75,6 +48,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -94,6 +68,7 @@ public class TypeHolderExample { */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -113,6 +88,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -132,6 +108,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -151,6 +128,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -165,6 +143,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +155,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java index e09df9be7b7..cf6f9233680 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java @@ -21,28 +21,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -56,6 +48,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -75,6 +68,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -94,6 +88,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -113,6 +108,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -132,6 +128,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -151,6 +148,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -170,6 +168,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -189,6 +188,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java index 1a4455cdaa8..cf49606e181 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java @@ -24,101 +24,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -131,6 +102,7 @@ public class XmlItem { */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -150,6 +122,7 @@ public class XmlItem { */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -169,6 +142,7 @@ public class XmlItem { */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -188,6 +162,7 @@ public class XmlItem { */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,6 +190,7 @@ public class XmlItem { */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -234,6 +210,7 @@ public class XmlItem { */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -253,6 +230,7 @@ public class XmlItem { */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -272,6 +250,7 @@ public class XmlItem { */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -291,6 +270,7 @@ public class XmlItem { */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -318,6 +298,7 @@ public class XmlItem { */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -345,6 +326,7 @@ public class XmlItem { */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -364,6 +346,7 @@ public class XmlItem { */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -383,6 +366,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -402,6 +386,7 @@ public class XmlItem { */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -421,6 +406,7 @@ public class XmlItem { */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -448,6 +434,7 @@ public class XmlItem { */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -475,6 +462,7 @@ public class XmlItem { */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -494,6 +482,7 @@ public class XmlItem { */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -513,6 +502,7 @@ public class XmlItem { */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -532,6 +522,7 @@ public class XmlItem { */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -551,6 +542,7 @@ public class XmlItem { */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -578,6 +570,7 @@ public class XmlItem { */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -605,6 +598,7 @@ public class XmlItem { */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -624,6 +618,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -643,6 +638,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -662,6 +658,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -681,6 +678,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -708,6 +706,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -735,6 +734,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java index 2a90a2f0a4f..43a8c980585 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Category { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index e18ac769bd2..00924b168ab 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java index 317082440c6..4c1bb184a39 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..7ed29b5a5c0 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java index b748650e3c0..adea27d0193 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java index ac6ddb97bbc..9ec0b712b14 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java index 18b55b13d16..0c0e8e8e72a 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Category { */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index e18ac769bd2..00924b168ab 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java index 317082440c6..4c1bb184a39 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..7ed29b5a5c0 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java index b748650e3c0..adea27d0193 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java index ac6ddb97bbc..9ec0b712b14 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java index 31344641b00..ed25fb031a0 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java @@ -40,15 +40,22 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid input (status code 405) + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "405", description = "Invalid input") }, security = { @@ -58,15 +65,17 @@ public interface PetApi { @RequestMapping( method = RequestMethod.POST, value = "/pet", + produces = "application/json", consumes = "application/json" ) - ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ResponseEntity addPet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -75,6 +84,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "400", description = "Invalid pet value") @@ -114,7 +124,7 @@ public interface PetApi { @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" }) } ) @RequestMapping( @@ -150,7 +160,7 @@ public interface PetApi { @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" }) } ) @RequestMapping( @@ -201,37 +211,49 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid ID supplied (status code 400) + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) + * API documentation for the updatePet operation + * @see Update an existing pet Documentation */ @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found"), @ApiResponse(responseCode = "405", description = "Validation exception") }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } + }, + externalDocs = @ExternalDocumentation(description = "API documentation for the updatePet operation", url = "http://petstore.swagger.io/v2/doc/updatePet") ) @RequestMapping( method = RequestMethod.PUT, value = "/pet", + produces = "application/json", consumes = "application/json" ) - ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + ResponseEntity updatePet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -241,6 +263,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -263,6 +286,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -272,6 +296,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java index 4da564ed4b4..b22286c5f7f 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java @@ -130,14 +130,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -150,10 +152,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = "application/json" + produces = "application/json", + consumes = "application/json" ) ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) throws Exception; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java index b048db1af26..3baba89f535 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java @@ -43,7 +43,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -53,60 +53,76 @@ public interface UserApi { tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = "application/json" ) ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) throws Exception; /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = "application/json" ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = "application/json" ) ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; @@ -126,6 +142,9 @@ public interface UserApi { responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( @@ -139,6 +158,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -148,6 +168,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -170,6 +191,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -179,6 +201,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -194,22 +217,27 @@ public interface UserApi { produces = "application/json" ) ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) throws Exception; /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( @@ -226,7 +254,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -238,15 +266,19 @@ public interface UserApi { responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = "application/json" ) ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) throws Exception; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java index 2a90a2f0a4f..0c0e8e8e72a 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -56,8 +55,9 @@ public class Category { * Get name * @return name */ - + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java index e18ac769bd2..00924b168ab 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java index 317082440c6..4c1bb184a39 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..7ed29b5a5c0 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java index b748650e3c0..adea27d0193 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java index ac6ddb97bbc..9ec0b712b14 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 4657908d5f6..ac3664b17fb 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -44,15 +44,22 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid input (status code 405) + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "405", description = "Invalid input") }, security = { @@ -62,11 +69,26 @@ public interface PetApi { @RequestMapping( method = RequestMethod.POST, value = "/pet", + produces = "application/json", consumes = "application/json" ) - default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + default ResponseEntity addPet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -74,6 +96,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -82,6 +105,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "400", description = "Invalid pet value") @@ -124,7 +148,7 @@ public interface PetApi { @ApiResponse(responseCode = "400", description = "Invalid status value") }, security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" }) } ) @RequestMapping( @@ -177,7 +201,7 @@ public interface PetApi { @ApiResponse(responseCode = "400", description = "Invalid tag value") }, security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" }) } ) @RequestMapping( @@ -262,33 +286,58 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid ID supplied (status code 400) + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) + * API documentation for the updatePet operation + * @see Update an existing pet Documentation */ @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) + }), @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), @ApiResponse(responseCode = "404", description = "Pet not found"), @ApiResponse(responseCode = "405", description = "Validation exception") }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } + }, + externalDocs = @ExternalDocumentation(description = "API documentation for the updatePet operation", url = "http://petstore.swagger.io/v2/doc/updatePet") ) @RequestMapping( method = RequestMethod.PUT, value = "/pet", + produces = "application/json", consumes = "application/json" ) - default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + default ResponseEntity updatePet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -296,6 +345,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -305,6 +355,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -330,6 +381,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -339,6 +391,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index dded9850227..6cd67112640 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -157,14 +157,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -177,10 +179,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = "application/json" + produces = "application/json", + consumes = "application/json" ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 399fcda339c..003ff249a5a 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -47,7 +47,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -57,14 +57,18 @@ public interface UserApi { tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = "application/json" ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -73,24 +77,30 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = "application/json" ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -99,24 +109,30 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = "application/json" ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -139,6 +155,9 @@ public interface UserApi { responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied"), @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( @@ -155,6 +174,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -164,6 +184,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -203,6 +224,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -212,6 +234,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -227,7 +250,7 @@ public interface UserApi { produces = "application/json" ) default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -237,15 +260,20 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( @@ -265,7 +293,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -277,15 +305,19 @@ public interface UserApi { responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied"), @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "api_key") } ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = "application/json" ) default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java index 2a90a2f0a4f..0c0e8e8e72a 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -56,8 +55,9 @@ public class Category { * Get name * @return name */ - + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java index e18ac769bd2..00924b168ab 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java index 317082440c6..4c1bb184a39 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..7ed29b5a5c0 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java index b748650e3c0..adea27d0193 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java index ac6ddb97bbc..9ec0b712b14 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/client/petstore/typescript/tests/jquery/test-runner.ts b/samples/openapi3/client/petstore/typescript/tests/jquery/test-runner.ts index 7a08e997835..6f958ffbf65 100644 --- a/samples/openapi3/client/petstore/typescript/tests/jquery/test-runner.ts +++ b/samples/openapi3/client/petstore/typescript/tests/jquery/test-runner.ts @@ -7,7 +7,7 @@ const qunitArgs = { // Path to qunit tests suite targetUrl: `file://${path.join(__dirname, '../index.html')}`, // (optional, 30000 by default) global timeout for the tests suite - timeout: 10000, + timeout: 30000, // (optional, false by default) should the browser console be redirected or not redirectConsole: true, puppeteerArgs: [ '--disable-web-security'] @@ -26,4 +26,4 @@ runQunitPuppeteer(qunitArgs) .catch((ex: any) => { console.error(ex); process.exit(2) - }); \ No newline at end of file + }); diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java index 0feef057e32..fd5cd5a64ce 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Addressable { - @JsonProperty("href") private String href; - @JsonProperty("id") private String id; public Addressable href(String href) { @@ -39,6 +37,7 @@ public class Addressable { */ @Schema(name = "href", description = "Hyperlink reference", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("href") public String getHref() { return href; } @@ -58,6 +57,7 @@ public class Addressable { */ @Schema(name = "id", description = "unique identifier", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public String getId() { return id; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java index 39979e84ce8..803778570b2 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java @@ -27,16 +27,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Bar extends Entity implements BarRefOrValue { - @JsonProperty("id") private String id; - @JsonProperty("barPropA") private String barPropA; - @JsonProperty("fooPropB") private String fooPropB; - @JsonProperty("foo") private FooRefOrValue foo; /** @@ -67,6 +63,7 @@ public class Bar extends Entity implements BarRefOrValue { */ @NotNull @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("id") public String getId() { return id; } @@ -86,6 +83,7 @@ public class Bar extends Entity implements BarRefOrValue { */ @Schema(name = "barPropA", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("barPropA") public String getBarPropA() { return barPropA; } @@ -105,6 +103,7 @@ public class Bar extends Entity implements BarRefOrValue { */ @Schema(name = "fooPropB", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("fooPropB") public String getFooPropB() { return fooPropB; } @@ -124,6 +123,7 @@ public class Bar extends Entity implements BarRefOrValue { */ @Valid @Schema(name = "foo", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("foo") public FooRefOrValue getFoo() { return foo; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java index 2e54e090ba2..7d81d917f19 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java @@ -29,13 +29,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BarCreate extends Entity { - @JsonProperty("barPropA") private String barPropA; - @JsonProperty("fooPropB") private String fooPropB; - @JsonProperty("foo") private FooRefOrValue foo; /** @@ -65,6 +62,7 @@ public class BarCreate extends Entity { */ @Schema(name = "barPropA", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("barPropA") public String getBarPropA() { return barPropA; } @@ -84,6 +82,7 @@ public class BarCreate extends Entity { */ @Schema(name = "fooPropB", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("fooPropB") public String getFooPropB() { return fooPropB; } @@ -103,6 +102,7 @@ public class BarCreate extends Entity { */ @Valid @Schema(name = "foo", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("foo") public FooRefOrValue getFoo() { return foo; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java index f562753ad8a..afb12504042 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java @@ -7,12 +7,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Bar; -import org.openapitools.model.BarCreate; -import org.openapitools.model.Foo; -import org.openapitools.model.Pasta; -import org.openapitools.model.Pizza; -import org.openapitools.model.PizzaSpeziale; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -44,19 +38,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Entity { - @JsonProperty("href") private String href; - @JsonProperty("id") private String id; - @JsonProperty("@schemaLocation") private String atSchemaLocation; - @JsonProperty("@baseType") private String atBaseType; - @JsonProperty("@type") private String atType; /** @@ -86,6 +75,7 @@ public class Entity { */ @Schema(name = "href", description = "Hyperlink reference", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("href") public String getHref() { return href; } @@ -105,6 +95,7 @@ public class Entity { */ @Schema(name = "id", description = "unique identifier", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public String getId() { return id; } @@ -124,6 +115,7 @@ public class Entity { */ @Schema(name = "@schemaLocation", description = "A URI to a JSON-Schema file that defines additional attributes and relationships", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("@schemaLocation") public String getAtSchemaLocation() { return atSchemaLocation; } @@ -143,6 +135,7 @@ public class Entity { */ @Schema(name = "@baseType", description = "When sub-classing, this defines the super-class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("@baseType") public String getAtBaseType() { return atBaseType; } @@ -162,6 +155,7 @@ public class Entity { */ @NotNull @Schema(name = "@type", description = "When sub-classing, this defines the sub-class Extensible name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("@type") public String getAtType() { return atType; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java index aa5d638da28..344c05038b1 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java @@ -7,8 +7,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BarRef; -import org.openapitools.model.FooRef; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -37,25 +35,18 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EntityRef { - @JsonProperty("name") private String name; - @JsonProperty("@referredType") private String atReferredType; - @JsonProperty("href") private String href; - @JsonProperty("id") private String id; - @JsonProperty("@schemaLocation") private String atSchemaLocation; - @JsonProperty("@baseType") private String atBaseType; - @JsonProperty("@type") private String atType; /** @@ -85,6 +76,7 @@ public class EntityRef { */ @Schema(name = "name", description = "Name of the related entity.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -104,6 +96,7 @@ public class EntityRef { */ @Schema(name = "@referredType", description = "The actual type of the target instance when needed for disambiguation.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("@referredType") public String getAtReferredType() { return atReferredType; } @@ -123,6 +116,7 @@ public class EntityRef { */ @Schema(name = "href", description = "Hyperlink reference", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("href") public String getHref() { return href; } @@ -142,6 +136,7 @@ public class EntityRef { */ @Schema(name = "id", description = "unique identifier", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public String getId() { return id; } @@ -161,6 +156,7 @@ public class EntityRef { */ @Schema(name = "@schemaLocation", description = "A URI to a JSON-Schema file that defines additional attributes and relationships", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("@schemaLocation") public String getAtSchemaLocation() { return atSchemaLocation; } @@ -180,6 +176,7 @@ public class EntityRef { */ @Schema(name = "@baseType", description = "When sub-classing, this defines the super-class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("@baseType") public String getAtBaseType() { return atBaseType; } @@ -199,6 +196,7 @@ public class EntityRef { */ @NotNull @Schema(name = "@type", description = "When sub-classing, this defines the sub-class Extensible name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("@type") public String getAtType() { return atType; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java index 1a441eee6e8..f62ccc5c6a0 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java @@ -21,13 +21,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Extensible { - @JsonProperty("@schemaLocation") private String atSchemaLocation; - @JsonProperty("@baseType") private String atBaseType; - @JsonProperty("@type") private String atType; /** @@ -57,6 +54,7 @@ public class Extensible { */ @Schema(name = "@schemaLocation", description = "A URI to a JSON-Schema file that defines additional attributes and relationships", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("@schemaLocation") public String getAtSchemaLocation() { return atSchemaLocation; } @@ -76,6 +74,7 @@ public class Extensible { */ @Schema(name = "@baseType", description = "When sub-classing, this defines the super-class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("@baseType") public String getAtBaseType() { return atBaseType; } @@ -95,6 +94,7 @@ public class Extensible { */ @NotNull @Schema(name = "@type", description = "When sub-classing, this defines the sub-class Extensible name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("@type") public String getAtType() { return atType; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java index 2a62b82f81d..76ef9bac7f4 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java @@ -26,10 +26,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Foo extends Entity implements FooRefOrValue { - @JsonProperty("fooPropA") private String fooPropA; - @JsonProperty("fooPropB") private String fooPropB; /** @@ -59,6 +57,7 @@ public class Foo extends Entity implements FooRefOrValue { */ @Schema(name = "fooPropA", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("fooPropA") public String getFooPropA() { return fooPropA; } @@ -78,6 +77,7 @@ public class Foo extends Entity implements FooRefOrValue { */ @Schema(name = "fooPropB", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("fooPropB") public String getFooPropB() { return fooPropB; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java index f0386a82498..b62f240056d 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FooRef extends EntityRef implements FooRefOrValue { - @JsonProperty("foorefPropA") private String foorefPropA; /** @@ -56,6 +55,7 @@ public class FooRef extends EntityRef implements FooRefOrValue { */ @Schema(name = "foorefPropA", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("foorefPropA") public String getFoorefPropA() { return foorefPropA; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java index ad530678535..20611d5541b 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pasta extends Entity { - @JsonProperty("vendor") private String vendor; /** @@ -56,6 +55,7 @@ public class Pasta extends Entity { */ @Schema(name = "vendor", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("vendor") public String getVendor() { return vendor; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java index a8710951406..43e68be6336 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import java.math.BigDecimal; import org.openapitools.model.Entity; -import org.openapitools.model.PizzaSpeziale; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -36,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pizza extends Entity { - @JsonProperty("pizzaSize") private BigDecimal pizzaSize; /** @@ -66,6 +64,7 @@ public class Pizza extends Entity { */ @Valid @Schema(name = "pizzaSize", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("pizzaSize") public BigDecimal getPizzaSize() { return pizzaSize; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java index a4c5f53565e..3109ecf660d 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class PizzaSpeziale extends Pizza { - @JsonProperty("toppings") private String toppings; /** @@ -57,6 +56,7 @@ public class PizzaSpeziale extends Pizza { */ @Schema(name = "toppings", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("toppings") public String getToppings() { return toppings; } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java index 18b55b13d16..0c0e8e8e72a 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Category { */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java index e18ac769bd2..00924b168ab 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java index 317082440c6..4c1bb184a39 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..7ed29b5a5c0 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java index b748650e3c0..adea27d0193 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java index ac6ddb97bbc..9ec0b712b14 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java index e2206012211..f288a0edde9 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Category { */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java index 6f12dac83ae..369df105a62 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java index 8e9325fbea4..906d04ddd72 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java index 16a192536ec..52bb7a983b1 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java index 98c023bf698..2f0f6cb4760 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java index 753145eb0b3..55f1824b941 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES deleted file mode 100644 index 5d716a83385..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ /dev/null @@ -1,71 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/OpenApiGeneratorApplication.java -src/main/java/org/openapitools/RFC3339DateFormat.java -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/SpringDocConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml -src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md deleted file mode 100644 index e6de7e038ce..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# OpenAPI generated server - -Spring Boot Server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. -This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. - - -The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). -Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. -The specification is available to download using the following url: -http://localhost:80/v3/api-docs/ - -Start your server as a simple java application - -You can view the api documentation in swagger-ui by pointing to -http://localhost:80/swagger-ui.html - -Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml deleted file mode 100644 index 8a69ba3cda0..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - 4.0.0 - org.openapitools.openapi3 - spring-boot-beanvalidation-no-nullable - jar - spring-boot-beanvalidation-no-nullable - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 1.6.14 - 4.15.5 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.6 - - - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.data - spring-data-commons - - - - org.springdoc - springdoc-openapi-ui - ${springdoc.version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - - org.springframework.boot - spring-boot-starter-validation - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java deleted file mode 100644 index 63641a4e97a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.FilterType; -import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; - -@SpringBootApplication( - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -@ComponentScan( - basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -public class OpenApiGeneratorApplication { - - public static void main(String[] args) { - SpringApplication.run(OpenApiGeneratorApplication.class, args); - } - - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index c2db7ca5a81..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index 5ae5d5fed98..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 65b695629d4..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index ea6c56e02c1..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class PetApiController implements PetApi { - - private final NativeWebRequest request; - - @Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index 1292dc0b721..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index ca00184d2a5..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java deleted file mode 100644 index b257cf0a16c..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openapitools.configuration; - -import org.openapitools.model.EnumClass; -import org.openapitools.model.OuterEnum; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.convert.converter.Converter; - -@Configuration -public class EnumConverterConfiguration { - - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter") - Converter enumClassConverter() { - return new Converter() { - @Override - public EnumClass convert(String source) { - return EnumClass.fromValue(source); - } - }; - } - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter") - Converter outerEnumConverter() { - return new Converter() { - @Override - public OuterEnum convert(String source) { - return OuterEnum.fromValue(source); - } - }; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java deleted file mode 100644 index a32f1f67787..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.security.SecurityScheme; - -@Configuration -public class SpringDocConfiguration { - - @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo") - OpenAPI apiInfo() { - return new OpenAPI() - .info( - new 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( - new License() - .name("Apache-2.0") - .url("https://www.apache.org/licenses/LICENSE-2.0.html") - ) - .version("1.0.0") - ) - .components( - new Components() - .addSecuritySchemes("petstore_auth", new SecurityScheme() - .type(SecurityScheme.Type.OAUTH2) - ) - .addSecuritySchemes("api_key", new SecurityScheme() - .type(SecurityScheme.Type.APIKEY) - .in(SecurityScheme.In.HEADER) - .name("api_key") - ) - .addSecuritySchemes("api_key_query", new SecurityScheme() - .type(SecurityScheme.Type.APIKEY) - .in(SecurityScheme.In.QUERY) - .name("api_key_query") - ) - .addSecuritySchemes("http_basic_test", new SecurityScheme() - .type(SecurityScheme.Type.HTTP) - .scheme("basic") - ) - ) - ; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index d905906f7bf..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index 3d02e9dd46a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index b7a841170a2..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index c3a18f03786..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,398 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - 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 putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\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(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index 9434294daf4..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index 2e3760d2115..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index d4d88060405..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index a4fb298c33b..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index 269a4170ff7..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - /** - * Default constructor - * @deprecated Use {@link Animal#Animal(String)} - */ - @Deprecated - public Animal() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Animal(String className) { - this.className = className; - } - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 82f57b75f44..38c62f8a00e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -34,7 +33,7 @@ public class ArrayOfArrayOfNumberOnly { public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); + this.arrayArrayNumber = ; } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; @@ -46,6 +45,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 30fd1ee2f00..fb6a073750a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -34,7 +33,7 @@ public class ArrayOfNumberOnly { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); + this.arrayNumber = ; } this.arrayNumber.add(arrayNumberItem); return this; @@ -46,6 +45,7 @@ public class ArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 69d0c66293d..54c8c21ef28 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -23,15 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid private List arrayOfString = null; - @JsonProperty("array_array_of_integer") @Valid private List> arrayArrayOfInteger = null; - @JsonProperty("array_array_of_model") @Valid private List> arrayArrayOfModel = null; @@ -42,7 +39,7 @@ public class ArrayTest { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); + this.arrayOfString = ; } this.arrayOfString.add(arrayOfStringItem); return this; @@ -54,6 +51,7 @@ public class ArrayTest { */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -69,7 +67,7 @@ public class ArrayTest { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); + this.arrayArrayOfInteger = ; } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -81,6 +79,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -96,7 +95,7 @@ public class ArrayTest { public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); + this.arrayArrayOfModel = ; } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; @@ -108,6 +107,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index f07e9f4b562..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.Cat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - /** - * Default constructor - * @deprecated Use {@link BigCat#BigCat(String)} - */ - @Deprecated - public BigCat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public BigCat(String className) { - super(className); - } - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public BigCat declawed(Boolean declawed) { - super.setDeclawed(declawed); - return this; - } - - public BigCat className(String className) { - super.setClassName(className); - return this; - } - - public BigCat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index c9532c1e3f1..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index eb734357980..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,202 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index c6048b1335a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - /** - * Default constructor - * @deprecated Use {@link Cat#Cat(String)} - */ - @Deprecated - public Cat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Cat(String className) { - super(className); - } - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - public Cat className(String className) { - super.setClassName(className); - return this; - } - - public Cat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index df8376c4a99..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 155f4416d9f..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,122 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - /** - * Default constructor - * @deprecated Use {@link Category#Category(String)} - */ - @Deprecated - public Category() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Category(String name) { - this.name = name; - } - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index 348a9826cbf..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index 082355c8ef4..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 0de88edc8ab..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - /** - * Default constructor - * @deprecated Use {@link Dog#Dog(String)} - */ - @Deprecated - public Dog() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Dog(String className) { - super(className); - } - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - public Dog className(String className) { - super.setClassName(className); - return this; - } - - public Dog color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index 318dcd160d8..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 5c87c8ab9e8..88a67562412 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -58,7 +58,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -96,7 +95,6 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid private List arrayEnum = null; @@ -111,6 +109,7 @@ public class EnumArrays { */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -126,7 +125,7 @@ public class EnumArrays { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); + this.arrayEnum = ; } this.arrayEnum.add(arrayEnumItem); return this; @@ -138,6 +137,7 @@ public class EnumArrays { */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index ee89c0fd200..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index cbd60e48575..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,342 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.OuterEnum; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - /** - * Default constructor - * @deprecated Use {@link EnumTest#EnumTest(EnumStringRequiredEnum)} - */ - @Deprecated - public EnumTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EnumTest(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index 87a7c66e2be..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@Schema(name = "File", description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 1c05208a474..2562c3ab08f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -56,7 +56,7 @@ public class FileSchemaTestClass { public FileSchemaTestClass addFilesItem(File filesItem) { if (this.files == null) { - this.files = new ArrayList<>(); + this.files = ; } this.files.add(filesItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index ae54e71df26..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,433 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - /** - * Default constructor - * @deprecated Use {@link FormatTest#FormatTest(BigDecimal, byte[], LocalDate, String)} - */ - @Deprecated - public FormatTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) { - this.number = number; - this._byte = _byte; - this.date = date; - this.password = password; - } - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index b89d14273dd..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 0655a757b5b..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,228 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - 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 - */ - - @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index 5247bfb7123..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 2e6f7a15434..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@Schema(name = "200_response", description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index f807aba2ada..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelFile.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index f269b47311d..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index d6dc995cbfb..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index 8529857c782..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@Schema(name = "Return", description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index 7835f479ed3..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@Schema(name = "Name", description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - /** - * Default constructor - * @deprecated Use {@link Name#Name(Integer)} - */ - @Deprecated - public Name() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Name(Integer name) { - this.name = name; - } - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index 6baa3007a5c..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 780632475ec..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,243 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index aad108f959c..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 86327bcf4e9..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 551a899b72c..abae02f7f68 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -194,7 +194,7 @@ public class Pet { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList<>(); + this.tags = ; } this.tags.add(tagsItem); return this; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index 20f99f09046..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index 5832d6c123e..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index a194f91e1a7..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 3f6d4a259b8..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,210 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -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") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderDefault#TypeHolderDefault(String, BigDecimal, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderDefault() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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) { - if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); - } - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index 6365a70bc6e..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,235 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -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") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderExample#TypeHolderExample(String, BigDecimal, Float, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderExample() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.floatItem = floatItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) - 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) { - if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); - } - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index 5d6889ef891..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,250 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 6d4d39acfa2..bed4f577bd2 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -23,99 +23,70 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid 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") @Valid private List nameArray = null; - @JsonProperty("name_wrapped_array") @Valid 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") @Valid private List prefixArray = null; - @JsonProperty("prefix_wrapped_array") @Valid 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") @Valid private List namespaceArray = null; - @JsonProperty("namespace_wrapped_array") @Valid 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") @Valid private List prefixNsArray = null; - @JsonProperty("prefix_ns_wrapped_array") @Valid private List prefixNsWrappedArray = null; @@ -130,6 +101,7 @@ public class XmlItem { */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -149,6 +121,7 @@ public class XmlItem { */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,6 +141,7 @@ public class XmlItem { */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -187,6 +161,7 @@ public class XmlItem { */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -202,7 +177,7 @@ public class XmlItem { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); + this.wrappedArray = ; } this.wrappedArray.add(wrappedArrayItem); return this; @@ -214,6 +189,7 @@ public class XmlItem { */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -233,6 +209,7 @@ public class XmlItem { */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -252,6 +229,7 @@ public class XmlItem { */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -271,6 +249,7 @@ public class XmlItem { */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -290,6 +269,7 @@ public class XmlItem { */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -305,7 +285,7 @@ public class XmlItem { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); + this.nameArray = ; } this.nameArray.add(nameArrayItem); return this; @@ -317,6 +297,7 @@ public class XmlItem { */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -332,7 +313,7 @@ public class XmlItem { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); + this.nameWrappedArray = ; } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -344,6 +325,7 @@ public class XmlItem { */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -363,6 +345,7 @@ public class XmlItem { */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -382,6 +365,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -401,6 +385,7 @@ public class XmlItem { */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -420,6 +405,7 @@ public class XmlItem { */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -435,7 +421,7 @@ public class XmlItem { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); + this.prefixArray = ; } this.prefixArray.add(prefixArrayItem); return this; @@ -447,6 +433,7 @@ public class XmlItem { */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -462,7 +449,7 @@ public class XmlItem { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); + this.prefixWrappedArray = ; } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -474,6 +461,7 @@ public class XmlItem { */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -493,6 +481,7 @@ public class XmlItem { */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -512,6 +501,7 @@ public class XmlItem { */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -531,6 +521,7 @@ public class XmlItem { */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -550,6 +541,7 @@ public class XmlItem { */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -565,7 +557,7 @@ public class XmlItem { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); + this.namespaceArray = ; } this.namespaceArray.add(namespaceArrayItem); return this; @@ -577,6 +569,7 @@ public class XmlItem { */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -592,7 +585,7 @@ public class XmlItem { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); + this.namespaceWrappedArray = ; } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -604,6 +597,7 @@ public class XmlItem { */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -623,6 +617,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -642,6 +637,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -661,6 +657,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -680,6 +677,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -695,7 +693,7 @@ public class XmlItem { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); + this.prefixNsArray = ; } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -707,6 +705,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -722,7 +721,7 @@ public class XmlItem { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); + this.prefixNsWrappedArray = ; } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; @@ -734,6 +733,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator-ignore index 7484ee590a3..b7d19e03b54 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator-ignore +++ b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + +src/test/java/org/openapitools/ResponseObjectWithDifferentFieldNamesJsonSerializationTest.java \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES index 3299b46a7b2..50815c779dc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -44,6 +44,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -66,6 +67,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index dde543dd6d5..843cfe78a87 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -62,9 +62,9 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().call123testSpecialTags(body); + return getDelegate().call123testSpecialTags(client); } } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 2d5e24bcd5f..740965f1686 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -27,11 +27,11 @@ public interface AnotherFakeApiDelegate { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client body) { + default ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 7866c753709..0217cfdeffc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.ExternalDocumentation; @@ -95,7 +96,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -108,7 +110,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @Operation( @@ -124,12 +126,13 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { - return getDelegate().fakeOuterCompositeSerialize(body); + return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -153,7 +156,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -182,7 +186,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -191,11 +196,38 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "responseObjectDifferentNames", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNames.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId + ) { + return getDelegate().responseObjectDifferentNames(petId); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @Operation( @@ -212,9 +244,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { - return getDelegate().testBodyWithFileSchema(body); + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -222,7 +254,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @Operation( @@ -239,9 +271,9 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ) { - return getDelegate().testBodyWithQueryParams(query, body); + return getDelegate().testBodyWithQueryParams(query, user); } @@ -249,7 +281,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -270,9 +302,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClientModel(body); + return getDelegate().testClientModel(client); } @@ -418,13 +450,15 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -436,14 +470,15 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { - return getDelegate().testInlineAdditionalProperties(param); + return getDelegate().testInlineAdditionalProperties(requestBody); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -452,6 +487,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -475,7 +511,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -495,17 +530,17 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context ) { - return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -515,6 +550,7 @@ public interface FakeApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 726b17779f1..b88f6171955 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index 2cd684b90f5..65ea3c13eae 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -63,11 +64,11 @@ public interface FakeApiDelegate { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -107,15 +108,36 @@ public interface FakeApiDelegate { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + * @see FakeApi#responseObjectDifferentNames + */ + default ResponseEntity responseObjectDifferentNames(Long petId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -124,12 +146,12 @@ public interface FakeApiDelegate { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ default ResponseEntity testBodyWithQueryParams(String query, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,11 +160,11 @@ public interface FakeApiDelegate { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client body) { + default ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -249,18 +271,20 @@ public interface FakeApiDelegate { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - default ResponseEntity testInlineAdditionalProperties(Map param) { + default ResponseEntity testInlineAdditionalProperties(Map requestBody) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -278,7 +302,6 @@ public interface FakeApiDelegate { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -286,7 +309,6 @@ public interface FakeApiDelegate { * @see FakeApi#testQueryParameterCollectionFormat */ default ResponseEntity testQueryParameterCollectionFormat(List pipe, - List ioutil, List http, List url, List context) { @@ -296,6 +318,7 @@ public interface FakeApiDelegate { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 12b9bd98bb8..461540edefa 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -41,7 +41,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -65,9 +65,9 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClassname(body); + return getDelegate().testClassname(client); } } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index fb689b13f94..a15fd1b7728 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -27,11 +27,11 @@ public interface FakeClassnameTestApiDelegate { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client body) { + default ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index ac8483a11ed..b558f46ff91 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -41,14 +41,16 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -64,14 +66,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().addPet(body); + return getDelegate().addPet(pet); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -81,6 +84,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -216,8 +220,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -226,6 +231,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -243,14 +249,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().updatePet(body); + return getDelegate().updatePet(pet); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -260,6 +267,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -284,6 +292,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -293,6 +302,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index 1e9ad7f94f4..aded0c3fefc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -27,19 +27,21 @@ public interface PetApiDelegate { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) * @see PetApi#addPet */ - default ResponseEntity addPet(Pet body) { + default ResponseEntity addPet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -142,21 +144,23 @@ public interface PetApiDelegate { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) * @see PetApi#updatePet */ - default ResponseEntity updatePet(Pet body) { + default ResponseEntity updatePet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -173,6 +177,7 @@ public interface PetApiDelegate { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 5a79e8dac78..4fbea119094 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -136,14 +136,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -156,12 +158,13 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { - return getDelegate().placeOrder(body); + return getDelegate().placeOrder(order); } } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index c4c812a9bb2..84623f79f76 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -81,13 +81,14 @@ public interface StoreApiDelegate { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order body) { + default ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index a61b53a2040..bf19ebd8296 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -43,7 +43,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -57,24 +57,27 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().createUser(body); + return getDelegate().createUser(user); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -82,24 +85,27 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithArrayInput(body); + return getDelegate().createUsersWithArrayInput(user); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -107,12 +113,13 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithListInput(body); + return getDelegate().createUsersWithListInput(user); } @@ -147,6 +154,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -156,6 +164,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -180,6 +189,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -189,6 +199,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -213,12 +224,14 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -240,7 +253,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -256,13 +269,14 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().updateUser(username, body); + return getDelegate().updateUser(username, user); } } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index c39231c6b29..f0630c08541 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -29,35 +29,37 @@ public interface UserApiDelegate { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) * @see UserApi#createUser */ - default ResponseEntity createUser(User body) { + default ResponseEntity createUser(User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - default ResponseEntity createUsersWithArrayInput(List body) { + default ResponseEntity createUsersWithArrayInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - default ResponseEntity createUsersWithListInput(List body) { + default ResponseEntity createUsersWithListInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,6 +80,7 @@ public interface UserApiDelegate { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -106,6 +109,7 @@ public interface UserApiDelegate { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -121,6 +125,7 @@ public interface UserApiDelegate { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) * @see UserApi#logoutUser @@ -135,13 +140,13 @@ public interface UserApiDelegate { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) * @see UserApi#updateUser */ default ResponseEntity updateUser(String username, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0661c1a9a8d..690bd609d23 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index a3f9c905789..db5353d2d35 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index db5f8d3ce35..5beed6563d9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 14e13504a8c..eff5bd5fa4b 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -25,45 +28,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -85,6 +77,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -112,6 +105,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -139,6 +133,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -166,6 +161,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -193,6 +189,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -220,6 +217,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -247,6 +245,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -274,6 +273,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -293,6 +293,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -302,7 +303,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +313,12 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -331,6 +333,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index ff0d6d7241e..e3d835a5124 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index cc212be855d..6cde3b272d2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 7c74b7de08d..948a430c814 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 6087e70dba7..d59141c231c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesString extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index 1ecf10efc5c..1d3881d9572 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -7,9 +7,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -38,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -71,6 +66,7 @@ public class Animal { */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("className") public String getClassName() { return className; } @@ -90,6 +86,7 @@ public class Animal { */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 42600354f74..d7f3b9f37fa 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 2f6c19a8344..6215ba771a0 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 23ee84ce8b5..d53a9e07ad8 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -24,17 +24,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -55,6 +52,7 @@ public class ArrayTest { */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -82,6 +80,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -109,6 +108,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java index 8c5453c4a5b..52359888607 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java @@ -66,7 +66,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -96,6 +95,7 @@ public class BigCat extends Cat { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java index 741de9f41a3..bff7b148aa2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -63,7 +63,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -77,6 +76,7 @@ public class BigCatAllOf { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java index 0c56400050b..31142a864ec 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java @@ -21,22 +21,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -50,6 +44,7 @@ public class Capitalization { */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -69,6 +64,7 @@ public class Capitalization { */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -88,6 +84,7 @@ public class Capitalization { */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -107,6 +104,7 @@ public class Capitalization { */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -126,6 +124,7 @@ public class Capitalization { */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,6 +144,7 @@ public class Capitalization { */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java index a2feece8de8..a9d13f1b2bf 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -35,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -65,6 +63,7 @@ public class Cat extends Animal { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java index 50a9c2cdce9..0bd8697513e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -37,6 +36,7 @@ public class CatAllOf { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index 7ee1fde0646..745935143d1 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -54,6 +52,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -73,6 +72,7 @@ public class Category { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java index a1942e9c404..95bad44f680 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -36,6 +35,7 @@ public class ClassModel { */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java index c38b26829be..c070bc9214b 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -35,6 +34,7 @@ public class Client { */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..ebcd1eede94 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,224 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java index 1bb3d6b5102..b339978e542 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -56,6 +55,7 @@ public class Dog extends Animal { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java index 256925a7841..6b11905f99a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -37,6 +36,7 @@ public class DogAllOf { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index 2720e81c227..3d3280a42dc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -59,7 +59,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -97,9 +96,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -112,6 +110,7 @@ public class EnumArrays { */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -139,6 +138,7 @@ public class EnumArrays { */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 6f08d4ee9fb..e785606f0e1 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -62,7 +62,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -102,7 +101,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -140,7 +138,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -178,10 +175,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -211,6 +206,7 @@ public class EnumTest { */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -230,6 +226,7 @@ public class EnumTest { */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -249,6 +246,7 @@ public class EnumTest { */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -268,6 +266,7 @@ public class EnumTest { */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -287,6 +286,7 @@ public class EnumTest { */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java index bf750ccdcb7..7b04101a36a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -36,6 +35,7 @@ public class File { */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b196d5d7de..be6e37a7aba 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -24,12 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -42,6 +40,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("file") public File getFile() { return file; } @@ -69,6 +68,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index 06e9dde8e89..bc4f1de88e6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -29,48 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -105,6 +91,7 @@ public class FormatTest { */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -126,6 +113,7 @@ public class FormatTest { */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -145,6 +133,7 @@ public class FormatTest { */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -166,6 +155,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -187,6 +177,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("float") public Float getFloat() { return _float; } @@ -208,6 +199,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("double") public Double getDouble() { return _double; } @@ -227,6 +219,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("string") public String getString() { return string; } @@ -246,6 +239,7 @@ public class FormatTest { */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -265,6 +259,7 @@ public class FormatTest { */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -284,6 +279,7 @@ public class FormatTest { */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -303,6 +299,7 @@ public class FormatTest { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -322,6 +319,7 @@ public class FormatTest { */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -341,6 +339,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -360,6 +359,7 @@ public class FormatTest { */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c218d0e02b8..196214695a1 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -40,6 +38,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -59,6 +58,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index 9811806e0c8..7215fd65d7a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -63,17 +62,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -94,6 +90,7 @@ public class MapTest { */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -121,6 +118,7 @@ public class MapTest { */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,6 +146,7 @@ public class MapTest { */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -175,6 +174,7 @@ public class MapTest { */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bcf0155a1b2..7dd078dbaa8 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -27,16 +27,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -49,6 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -68,6 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -95,6 +94,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 9ca96d114aa..32198c000f1 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -41,6 +39,7 @@ public class Model200Response { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -60,6 +59,7 @@ public class Model200Response { */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index 06c806057b5..0a803038551 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -43,6 +40,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -62,6 +60,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -81,6 +80,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index f168748f6a2..c2ac56a57a7 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -37,6 +36,7 @@ public class ModelList { */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index 641c56cd81c..83da161c83f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -38,6 +37,7 @@ public class ModelReturn { */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index d6dcb665651..ed42396e815 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -22,16 +22,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -61,6 +57,7 @@ public class Name { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -80,6 +77,7 @@ public class Name { */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -99,6 +97,7 @@ public class Name { */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property") public String getProperty() { return property; } @@ -118,6 +117,7 @@ public class Name { */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java index 4a3b6beffa2..1ec233732c3 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -36,6 +35,7 @@ public class NumberOnly { */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java index 9a5b61bad43..9566edcbed8 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java @@ -24,16 +24,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -74,10 +70,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -91,6 +85,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -110,6 +105,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -129,6 +125,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -148,6 +145,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -167,6 +165,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -186,6 +185,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index b66d6d38afb..6b611504866 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -22,13 +22,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -42,6 +39,7 @@ public class OuterComposite { */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -61,6 +59,7 @@ public class OuterComposite { */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -80,6 +79,7 @@ public class OuterComposite { */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 6adaaba97d7..0e76707f06f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -29,22 +29,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -83,7 +78,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -114,6 +108,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -133,6 +128,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -152,6 +148,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -166,6 +163,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -176,6 +176,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -204,6 +205,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -223,6 +225,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 8c43e7e8c30..8891d8dac55 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -38,6 +36,7 @@ public class ReadOnlyFirst { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -57,6 +56,7 @@ public class ReadOnlyFirst { */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..c681122f5f8 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,155 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index c3d3aa9182e..51dfdf9de43 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,11 +19,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -37,6 +36,7 @@ public class SpecialModelName { */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java index 03d5607e29b..b6dd153652a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -38,6 +36,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -57,6 +56,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 67ef036857d..c2217970131 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -24,21 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -71,6 +66,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -90,6 +86,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -109,6 +106,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -128,6 +126,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -142,6 +141,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -152,6 +154,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 5b77bee14c1..96efe9c2627 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -24,22 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -75,6 +69,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -94,6 +89,7 @@ public class TypeHolderExample { */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -113,6 +109,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -132,6 +129,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -151,6 +149,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -165,6 +164,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +176,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java index e09df9be7b7..cf6f9233680 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java @@ -21,28 +21,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -56,6 +48,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -75,6 +68,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -94,6 +88,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -113,6 +108,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -132,6 +128,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -151,6 +148,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -170,6 +168,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -189,6 +188,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 1a4455cdaa8..cf49606e181 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -24,101 +24,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -131,6 +102,7 @@ public class XmlItem { */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -150,6 +122,7 @@ public class XmlItem { */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -169,6 +142,7 @@ public class XmlItem { */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -188,6 +162,7 @@ public class XmlItem { */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,6 +190,7 @@ public class XmlItem { */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -234,6 +210,7 @@ public class XmlItem { */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -253,6 +230,7 @@ public class XmlItem { */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -272,6 +250,7 @@ public class XmlItem { */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -291,6 +270,7 @@ public class XmlItem { */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -318,6 +298,7 @@ public class XmlItem { */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -345,6 +326,7 @@ public class XmlItem { */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -364,6 +346,7 @@ public class XmlItem { */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -383,6 +366,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -402,6 +386,7 @@ public class XmlItem { */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -421,6 +406,7 @@ public class XmlItem { */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -448,6 +434,7 @@ public class XmlItem { */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -475,6 +462,7 @@ public class XmlItem { */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -494,6 +482,7 @@ public class XmlItem { */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -513,6 +502,7 @@ public class XmlItem { */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -532,6 +522,7 @@ public class XmlItem { */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -551,6 +542,7 @@ public class XmlItem { */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -578,6 +570,7 @@ public class XmlItem { */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -605,6 +598,7 @@ public class XmlItem { */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -624,6 +618,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -643,6 +638,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -662,6 +658,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -681,6 +678,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -708,6 +706,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -735,6 +734,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/ResponseObjectWithDifferentFieldNamesJsonSerializationTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/ResponseObjectWithDifferentFieldNamesJsonSerializationTest.java new file mode 100644 index 00000000000..7b2e5702ed6 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/ResponseObjectWithDifferentFieldNamesJsonSerializationTest.java @@ -0,0 +1,57 @@ +package org.openapitools; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.assertj.core.api.Assertions; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; +import org.skyscreamer.jsonassert.JSONAssert; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +public class ResponseObjectWithDifferentFieldNamesJsonSerializationTest { + + private static final String JSON_STRING = "{" + + "\"normalPropertyName\": \"normalPropertyName_value\"," + + "\"lower-case-property-dashes\": \"lowerCasePropertyDashes_value\"," + + "\"property name with spaces\": \"propertyNameWithSpaces_value\"," + + "\"UPPER_CASE_PROPERTY_SNAKE\": \"UPPER_CASE_PROPERTY_SNAKE_value\"" + + "}"; + + @Autowired + private ObjectMapper objectMapper; + + @Test + void shouldSerializedModelToJson() throws JsonProcessingException, JSONException { + ResponseObjectWithDifferentFieldNames object = new ResponseObjectWithDifferentFieldNames() + .normalPropertyName("normalPropertyName_value") + .UPPER_CASE_PROPERTY_SNAKE("UPPER_CASE_PROPERTY_SNAKE_value") + .lowerCasePropertyDashes("lowerCasePropertyDashes_value") + .propertyNameWithSpaces("propertyNameWithSpaces_value"); + + String actualJson = objectMapper.writeValueAsString(object); + + JSONAssert.assertEquals(JSON_STRING, actualJson, true); + } + + @Test + void shouldDeserializedJsonToModel() throws JsonProcessingException { + String json = "{" + + "\"normalPropertyName\": \"normalPropertyName_value\"," + + "\"lower-case-property-dashes\": \"lowerCasePropertyDashes_value\"," + + "\"property name with spaces\": \"propertyNameWithSpaces_value\"," + + "\"UPPER_CASE_PROPERTY_SNAKE\": \"UPPER_CASE_PROPERTY_SNAKE_value\"" + + "}"; + + ResponseObjectWithDifferentFieldNames object = objectMapper.readValue(json, ResponseObjectWithDifferentFieldNames.class); + + Assertions.assertThat(object) + .returns("normalPropertyName_value", ResponseObjectWithDifferentFieldNames::getNormalPropertyName) + .returns("UPPER_CASE_PROPERTY_SNAKE_value", ResponseObjectWithDifferentFieldNames::getUPPERCASEPROPERTYSNAKE) + .returns("lowerCasePropertyDashes_value", ResponseObjectWithDifferentFieldNames::getLowerCasePropertyDashes) + .returns("propertyNameWithSpaces_value", ResponseObjectWithDifferentFieldNames::getPropertyNameWithSpaces); + } + +} diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 5d716a83385..c904db3800a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -60,6 +61,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 35ea30e5650..4843738ef54 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -45,7 +45,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -66,7 +66,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 441c8f3b51a..21a18204650 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.ExternalDocumentation; @@ -100,7 +101,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -114,7 +116,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @Operation( @@ -130,10 +132,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -169,7 +172,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -199,7 +203,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -209,11 +214,48 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "responseObjectDifferentNames", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNames.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @Operation( @@ -230,7 +272,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -241,7 +283,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @Operation( @@ -258,7 +300,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -269,7 +311,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -290,7 +332,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -451,13 +493,15 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -469,7 +513,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -478,6 +522,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -486,6 +531,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -510,7 +556,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -530,7 +575,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context @@ -542,6 +586,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -551,6 +596,7 @@ public interface FakeApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java index 5ae5d5fed98..9121a395182 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index edd955ebd4b..5f7497998a2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -45,7 +45,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -69,7 +69,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index d0518a4e66e..d93c47efde7 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -45,14 +45,16 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -68,7 +70,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -77,6 +79,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @return successful operation (status code 200) @@ -85,6 +88,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -268,8 +272,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -278,6 +283,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -295,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -304,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -313,6 +320,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -338,6 +346,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -347,6 +356,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 287e254e09b..03bf38309f4 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -157,14 +157,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -177,10 +179,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 6210f9fdc5a..4d759745098 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -47,7 +47,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -61,10 +61,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -73,13 +74,15 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -87,10 +90,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -99,13 +103,15 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -113,10 +119,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -155,6 +162,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -164,6 +172,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -203,6 +212,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -212,6 +222,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -237,12 +248,14 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -265,7 +278,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -281,11 +294,12 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0661c1a9a8d..690bd609d23 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index a3f9c905789..db5353d2d35 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index db5f8d3ce35..5beed6563d9 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 14e13504a8c..eff5bd5fa4b 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -25,45 +28,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -85,6 +77,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -112,6 +105,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -139,6 +133,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -166,6 +161,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -193,6 +189,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -220,6 +217,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -247,6 +245,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -274,6 +273,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -293,6 +293,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -302,7 +303,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +313,12 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -331,6 +333,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index ff0d6d7241e..e3d835a5124 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index cc212be855d..6cde3b272d2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 7c74b7de08d..948a430c814 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 6087e70dba7..d59141c231c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesString extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 1ecf10efc5c..1d3881d9572 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -7,9 +7,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -38,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -71,6 +66,7 @@ public class Animal { */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("className") public String getClassName() { return className; } @@ -90,6 +86,7 @@ public class Animal { */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 42600354f74..d7f3b9f37fa 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 2f6c19a8344..6215ba771a0 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 23ee84ce8b5..d53a9e07ad8 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -24,17 +24,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -55,6 +52,7 @@ public class ArrayTest { */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -82,6 +80,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -109,6 +108,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java index 8c5453c4a5b..52359888607 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java @@ -66,7 +66,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -96,6 +95,7 @@ public class BigCat extends Cat { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java index 741de9f41a3..bff7b148aa2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -63,7 +63,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -77,6 +76,7 @@ public class BigCatAllOf { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java index 0c56400050b..31142a864ec 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java @@ -21,22 +21,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -50,6 +44,7 @@ public class Capitalization { */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -69,6 +64,7 @@ public class Capitalization { */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -88,6 +84,7 @@ public class Capitalization { */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -107,6 +104,7 @@ public class Capitalization { */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -126,6 +124,7 @@ public class Capitalization { */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,6 +144,7 @@ public class Capitalization { */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java index a2feece8de8..a9d13f1b2bf 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -35,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -65,6 +63,7 @@ public class Cat extends Animal { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java index 50a9c2cdce9..0bd8697513e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -37,6 +36,7 @@ public class CatAllOf { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index 7ee1fde0646..745935143d1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -54,6 +52,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -73,6 +72,7 @@ public class Category { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java index a1942e9c404..95bad44f680 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -36,6 +35,7 @@ public class ClassModel { */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java index c38b26829be..c070bc9214b 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -35,6 +34,7 @@ public class Client { */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..ebcd1eede94 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,224 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java index 1bb3d6b5102..b339978e542 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -56,6 +55,7 @@ public class Dog extends Animal { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java index 256925a7841..6b11905f99a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -37,6 +36,7 @@ public class DogAllOf { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index 2720e81c227..3d3280a42dc 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -59,7 +59,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -97,9 +96,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -112,6 +110,7 @@ public class EnumArrays { */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -139,6 +138,7 @@ public class EnumArrays { */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 6f08d4ee9fb..e785606f0e1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -62,7 +62,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -102,7 +101,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -140,7 +138,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -178,10 +175,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -211,6 +206,7 @@ public class EnumTest { */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -230,6 +226,7 @@ public class EnumTest { */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -249,6 +246,7 @@ public class EnumTest { */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -268,6 +266,7 @@ public class EnumTest { */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -287,6 +286,7 @@ public class EnumTest { */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java index bf750ccdcb7..7b04101a36a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -36,6 +35,7 @@ public class File { */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b196d5d7de..be6e37a7aba 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -24,12 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -42,6 +40,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("file") public File getFile() { return file; } @@ -69,6 +68,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index 06e9dde8e89..bc4f1de88e6 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -29,48 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -105,6 +91,7 @@ public class FormatTest { */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -126,6 +113,7 @@ public class FormatTest { */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -145,6 +133,7 @@ public class FormatTest { */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -166,6 +155,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -187,6 +177,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("float") public Float getFloat() { return _float; } @@ -208,6 +199,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("double") public Double getDouble() { return _double; } @@ -227,6 +219,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("string") public String getString() { return string; } @@ -246,6 +239,7 @@ public class FormatTest { */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -265,6 +259,7 @@ public class FormatTest { */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -284,6 +279,7 @@ public class FormatTest { */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -303,6 +299,7 @@ public class FormatTest { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -322,6 +319,7 @@ public class FormatTest { */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -341,6 +339,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -360,6 +359,7 @@ public class FormatTest { */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c218d0e02b8..196214695a1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -40,6 +38,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -59,6 +58,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index 9811806e0c8..7215fd65d7a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -63,17 +62,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -94,6 +90,7 @@ public class MapTest { */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -121,6 +118,7 @@ public class MapTest { */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,6 +146,7 @@ public class MapTest { */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -175,6 +174,7 @@ public class MapTest { */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bcf0155a1b2..7dd078dbaa8 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -27,16 +27,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -49,6 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -68,6 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -95,6 +94,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 9ca96d114aa..32198c000f1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -41,6 +39,7 @@ public class Model200Response { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -60,6 +59,7 @@ public class Model200Response { */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 06c806057b5..0a803038551 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -43,6 +40,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -62,6 +60,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -81,6 +80,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index f168748f6a2..c2ac56a57a7 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -37,6 +36,7 @@ public class ModelList { */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index 641c56cd81c..83da161c83f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -38,6 +37,7 @@ public class ModelReturn { */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index d6dcb665651..ed42396e815 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -22,16 +22,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -61,6 +57,7 @@ public class Name { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -80,6 +77,7 @@ public class Name { */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -99,6 +97,7 @@ public class Name { */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property") public String getProperty() { return property; } @@ -118,6 +117,7 @@ public class Name { */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java index 4a3b6beffa2..1ec233732c3 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -36,6 +35,7 @@ public class NumberOnly { */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java index 9a5b61bad43..9566edcbed8 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java @@ -24,16 +24,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -74,10 +70,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -91,6 +85,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -110,6 +105,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -129,6 +125,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -148,6 +145,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -167,6 +165,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -186,6 +185,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index b66d6d38afb..6b611504866 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -22,13 +22,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -42,6 +39,7 @@ public class OuterComposite { */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -61,6 +59,7 @@ public class OuterComposite { */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -80,6 +79,7 @@ public class OuterComposite { */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 6adaaba97d7..0e76707f06f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -29,22 +29,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -83,7 +78,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -114,6 +108,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -133,6 +128,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -152,6 +148,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -166,6 +163,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -176,6 +176,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -204,6 +205,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -223,6 +225,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 8c43e7e8c30..8891d8dac55 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -38,6 +36,7 @@ public class ReadOnlyFirst { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -57,6 +56,7 @@ public class ReadOnlyFirst { */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..c681122f5f8 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,155 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index c3d3aa9182e..51dfdf9de43 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,11 +19,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -37,6 +36,7 @@ public class SpecialModelName { */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java index 03d5607e29b..b6dd153652a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -38,6 +36,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -57,6 +56,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 67ef036857d..c2217970131 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -24,21 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -71,6 +66,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -90,6 +86,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -109,6 +106,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -128,6 +126,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -142,6 +141,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -152,6 +154,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 5b77bee14c1..96efe9c2627 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -24,22 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -75,6 +69,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -94,6 +89,7 @@ public class TypeHolderExample { */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -113,6 +109,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -132,6 +129,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -151,6 +149,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -165,6 +164,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +176,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java index e09df9be7b7..cf6f9233680 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java @@ -21,28 +21,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -56,6 +48,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -75,6 +68,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -94,6 +88,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -113,6 +108,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -132,6 +128,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -151,6 +148,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -170,6 +168,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -189,6 +188,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 1a4455cdaa8..cf49606e181 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -24,101 +24,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -131,6 +102,7 @@ public class XmlItem { */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -150,6 +122,7 @@ public class XmlItem { */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -169,6 +142,7 @@ public class XmlItem { */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -188,6 +162,7 @@ public class XmlItem { */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,6 +190,7 @@ public class XmlItem { */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -234,6 +210,7 @@ public class XmlItem { */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -253,6 +230,7 @@ public class XmlItem { */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -272,6 +250,7 @@ public class XmlItem { */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -291,6 +270,7 @@ public class XmlItem { */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -318,6 +298,7 @@ public class XmlItem { */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -345,6 +326,7 @@ public class XmlItem { */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -364,6 +346,7 @@ public class XmlItem { */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -383,6 +366,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -402,6 +386,7 @@ public class XmlItem { */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -421,6 +406,7 @@ public class XmlItem { */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -448,6 +434,7 @@ public class XmlItem { */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -475,6 +462,7 @@ public class XmlItem { */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -494,6 +482,7 @@ public class XmlItem { */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -513,6 +502,7 @@ public class XmlItem { */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -532,6 +522,7 @@ public class XmlItem { */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -551,6 +542,7 @@ public class XmlItem { */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -578,6 +570,7 @@ public class XmlItem { */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -605,6 +598,7 @@ public class XmlItem { */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -624,6 +618,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -643,6 +638,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -662,6 +658,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -681,6 +678,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -708,6 +706,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -735,6 +734,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES deleted file mode 100644 index 1fc07e54e68..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES +++ /dev/null @@ -1,76 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/OpenApiGeneratorApplication.java -src/main/java/org/openapitools/RFC3339DateFormat.java -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeApiDelegate.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/PetApiDelegate.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/StoreApiDelegate.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/api/UserApiDelegate.java -src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml -src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-reactive/README.md b/samples/openapi3/server/petstore/springboot-reactive/README.md deleted file mode 100644 index e6de7e038ce..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# OpenAPI generated server - -Spring Boot Server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. -This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. - - -The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). -Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. -The specification is available to download using the following url: -http://localhost:80/v3/api-docs/ - -Start your server as a simple java application - -You can view the api documentation in swagger-ui by pointing to -http://localhost:80/swagger-ui.html - -Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/pom.xml b/samples/openapi3/server/petstore/springboot-reactive/pom.xml deleted file mode 100644 index 2a16a7b42b7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - 4.0.0 - org.openapitools.openapi3 - springboot-reactive - jar - springboot-reactive - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 1.6.14 - 4.15.5 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.6 - - - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - org.springframework.boot - spring-boot-starter-webflux - - - org.springframework.data - spring-data-commons - - - - org.springdoc - springdoc-openapi-webflux-ui - ${springdoc.version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - org.openapitools - jackson-databind-nullable - 0.2.6 - - - - org.springframework.boot - spring-boot-starter-validation - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/RFC3339DateFormat.java deleted file mode 100644 index bcd3936d8b3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index e27e2fc20ea..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final AnotherFakeApiDelegate delegate; - - public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); - } - - @Override - public AnotherFakeApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java deleted file mode 100644 index 55b8ba0da1d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link AnotherFakeApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface AnotherFakeApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - default Mono> call123testSpecialTags(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 7ed3b0ab28d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.api; - -import java.nio.charset.StandardCharsets; -import org.springframework.core.io.buffer.DefaultDataBuffer; -import org.springframework.core.io.buffer.DefaultDataBufferFactory; -import org.springframework.http.MediaType; -import org.springframework.http.server.reactive.ServerHttpResponse; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Mono; - -public class ApiUtil { - public static Mono getExampleResponse(ServerWebExchange exchange, MediaType mediaType, String example) { - ServerHttpResponse response = exchange.getResponse(); - response.getHeaders().setContentType(mediaType); - - byte[] exampleBytes = example.getBytes(StandardCharsets.UTF_8); - DefaultDataBuffer data = new DefaultDataBufferFactory().wrap(exampleBytes); - return response.writeWith(Mono.just(data)); - } -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index 726b17779f1..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeApiController implements FakeApi { - - private final FakeApiDelegate delegate; - - public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); - } - - @Override - public FakeApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java deleted file mode 100644 index 98fba4fc3d0..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ /dev/null @@ -1,365 +0,0 @@ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link FakeApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface FakeApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - default Mono> createXmlItem(Mono xmlItem, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(xmlItem).then(Mono.empty()); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - default Mono> fakeOuterBooleanSerialize(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - default Mono> fakeOuterCompositeSerialize(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - default Mono> fakeOuterNumberSerialize(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - default Mono> fakeOuterStringSerialize(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - default Mono> testBodyWithFileSchema(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - default Mono> testBodyWithQueryParams(String query, - Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - default Mono> testClientModel(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @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 Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - default Mono> testEndpointParameters(BigDecimal number, - Double _double, - String patternWithoutDelimiter, - byte[] _byte, - Integer integer, - Integer int32, - Long int64, - Float _float, - String string, - Flux binary, - LocalDate date, - OffsetDateTime dateTime, - String password, - String paramCallback, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /fake : 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 Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - default Mono> testEnumParameters(List enumHeaderStringArray, - String enumHeaderString, - List enumQueryStringArray, - String enumQueryString, - Integer enumQueryInteger, - Double enumQueryDouble, - List enumFormStringArray, - String enumFormString, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Something wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - default Mono> testGroupParameters(Integer requiredStringGroup, - Boolean requiredBooleanGroup, - Long requiredInt64Group, - Integer stringGroup, - Boolean booleanGroup, - Long int64Group, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - default Mono> testInlineAdditionalProperties(Mono> param, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(param).then(Mono.empty()); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - default Mono> testJsonFormData(String param, - String param2, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @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()); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - default Mono> uploadFileWithRequiredFile(Long petId, - Flux requiredFile, - String additionalMetadata, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 21e28fe8b21..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final FakeClassnameTestApiDelegate delegate; - - public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); - } - - @Override - public FakeClassnameTestApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java deleted file mode 100644 index 0c2f87127f9..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link FakeClassnameTestApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface FakeClassnameTestApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - default Mono> testClassname(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java deleted file mode 100644 index b53ef4a0fa5..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ /dev/null @@ -1,219 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link PetApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface PetApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - default Mono> addPet(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - default Mono> deletePet(Long petId, - String apiKey, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /pet/findByStatus : 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 (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - default Mono>> findPetsByStatus(List status, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * GET /pet/findByTags : 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 (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - @Deprecated - default Mono>> findPetsByTags(Set tags, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - default Mono> getPetById(Long petId, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - default Mono> updatePet(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - default Mono> updatePetWithForm(Long petId, - String name, - String status, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - default Mono> uploadFile(Long petId, - String additionalMetadata, - Flux file, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java deleted file mode 100644 index ec665c3cd61..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link StoreApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface StoreApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : 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 (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - default Mono> deleteOrder(String orderId, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - default Mono>> getInventory(ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - default Mono> getOrderById(Long orderId, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - default Mono> placeOrder(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java deleted file mode 100644 index 8a589951350..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link UserApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface UserApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - default Mono> createUser(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - default Mono> createUsersWithArrayInput(Flux body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.thenMany(body).then(Mono.empty()); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - default Mono> createUsersWithListInput(Flux body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.thenMany(body).then(Mono.empty()); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - default Mono> deleteUser(String username, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - default Mono> getUserByName(String username, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - default Mono> loginUser(String username, - String password, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - default Mono> logoutUser(ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - default Mono> updateUser(String username, - Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java deleted file mode 100644 index b257cf0a16c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openapitools.configuration; - -import org.openapitools.model.EnumClass; -import org.openapitools.model.OuterEnum; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.convert.converter.Converter; - -@Configuration -public class EnumConverterConfiguration { - - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter") - Converter enumClassConverter() { - return new Converter() { - @Override - public EnumClass convert(String source) { - return EnumClass.fromValue(source); - } - }; - } - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter") - Converter outerEnumConverter() { - return new Converter() { - @Override - public OuterEnum convert(String source) { - return OuterEnum.fromValue(source); - } - }; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index cf658246a9d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; -import java.net.URI; - -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @Bean - RouterFunction index() { - return route( - GET("/"), - req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build() - ); - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index 0661c1a9a8d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index a3f9c905789..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index db5f8d3ce35..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index 14e13504a8c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,399 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - 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 putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\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(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index ff0d6d7241e..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index cc212be855d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index 7c74b7de08d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index 6087e70dba7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index 1ecf10efc5c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - /** - * Default constructor - * @deprecated Use {@link Animal#Animal(String)} - */ - @Deprecated - public Animal() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Animal(String className) { - this.className = className; - } - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 42600354f74..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index 2f6c19a8344..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index 23ee84ce8b5..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 8c5453c4a5b..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.Cat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - /** - * Default constructor - * @deprecated Use {@link BigCat#BigCat(String)} - */ - @Deprecated - public BigCat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public BigCat(String className) { - super(className); - } - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public BigCat declawed(Boolean declawed) { - super.setDeclawed(declawed); - return this; - } - - public BigCat className(String className) { - super.setClassName(className); - return this; - } - - public BigCat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index 741de9f41a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 0c56400050b..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index a2feece8de8..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - /** - * Default constructor - * @deprecated Use {@link Cat#Cat(String)} - */ - @Deprecated - public Cat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Cat(String className) { - super(className); - } - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - public Cat className(String className) { - super.setClassName(className); - return this; - } - - public Cat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index 50a9c2cdce9..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 7ee1fde0646..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - /** - * Default constructor - * @deprecated Use {@link Category#Category(String)} - */ - @Deprecated - public Category() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Category(String name) { - this.name = name; - } - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index a1942e9c404..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index c38b26829be..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 1bb3d6b5102..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - /** - * Default constructor - * @deprecated Use {@link Dog#Dog(String)} - */ - @Deprecated - public Dog() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Dog(String className) { - super(className); - } - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - public Dog className(String className) { - super.setClassName(className); - return this; - } - - public Dog color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index 256925a7841..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index 2720e81c227..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index 4e6027d16c4..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index 6f08d4ee9fb..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,343 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.OuterEnum; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - /** - * Default constructor - * @deprecated Use {@link EnumTest#EnumTest(EnumStringRequiredEnum)} - */ - @Deprecated - public EnumTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EnumTest(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index bf750ccdcb7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@Schema(name = "File", description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 8b196d5d7de..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List<@Valid File> files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List<@Valid File> files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid File> getFiles() { - return files; - } - - public void setFiles(List<@Valid File> files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 06e9dde8e89..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,434 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - /** - * Default constructor - * @deprecated Use {@link FormatTest#FormatTest(BigDecimal, byte[], LocalDate, String)} - */ - @Deprecated - public FormatTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) { - this.number = number; - this._byte = _byte; - this.date = date; - this.password = password; - } - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index c218d0e02b8..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 9811806e0c8..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - 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 - */ - - @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index bcf0155a1b2..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 9ca96d114aa..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@Schema(name = "200_response", description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 06c806057b5..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index de11d272cc3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index f168748f6a2..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index 641c56cd81c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@Schema(name = "Return", description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index d6dcb665651..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,172 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@Schema(name = "Name", description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - /** - * Default constructor - * @deprecated Use {@link Name#Name(Integer)} - */ - @Deprecated - public Name() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Name(Integer name) { - this.name = name; - } - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index 4a3b6beffa2..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 9a5b61bad43..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,244 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index b66d6d38afb..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 7fdf6f47de3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index 8c43e7e8c30..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index c3d3aa9182e..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index 03d5607e29b..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 67ef036857d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -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") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderDefault#TypeHolderDefault(String, BigDecimal, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderDefault() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index 5b77bee14c1..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,233 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -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") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderExample#TypeHolderExample(String, BigDecimal, Float, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderExample() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.floatItem = floatItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) - 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) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index e09df9be7b7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 1a4455cdaa8..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,839 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -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") - @Valid - 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") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - 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") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - 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") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - 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") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.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); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/application.properties b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/application.properties deleted file mode 100644 index 9d06609db66..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port=80 -spring.jackson.date-format=org.openapitools.RFC3339DateFormat -spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java deleted file mode 100644 index 3681f67e770..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class OpenApiGeneratorApplicationTests { - - @Test - void contextLoads() { - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java index 0d2e56dfa3d..d48f33e470b 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java @@ -20,10 +20,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -36,6 +34,7 @@ public class Category { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -54,6 +53,7 @@ public class Category { * @return name */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java index f66ed8b5941..5376fa62cc3 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -22,13 +22,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -41,6 +38,7 @@ public class ModelApiResponse { * @return code */ + @JsonProperty("code") public Integer getCode() { return code; } @@ -59,6 +57,7 @@ public class ModelApiResponse { * @return type */ + @JsonProperty("type") public String getType() { return type; } @@ -77,6 +76,7 @@ public class ModelApiResponse { * @return message */ + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java index aafcfc0cc19..ad7ddb21736 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -73,10 +69,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -89,6 +83,7 @@ public class Order { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -107,6 +102,7 @@ public class Order { * @return petId */ + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -125,6 +121,7 @@ public class Order { * @return quantity */ + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -143,6 +140,7 @@ public class Order { * @return shipDate */ @Valid + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -161,6 +159,7 @@ public class Order { * @return status */ + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -179,6 +178,7 @@ public class Order { * @return complete */ + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java index 4f55bcef672..f72251ebac0 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java @@ -25,22 +25,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -79,7 +74,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -109,6 +103,7 @@ public class Pet { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -127,6 +122,7 @@ public class Pet { * @return category */ @Valid + @JsonProperty("category") public Category getCategory() { return category; } @@ -145,6 +141,7 @@ public class Pet { * @return name */ @NotNull + @JsonProperty("name") public String getName() { return name; } @@ -159,6 +156,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -168,6 +168,7 @@ public class Pet { * @return photoUrls */ @NotNull + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -194,6 +195,7 @@ public class Pet { * @return tags */ @Valid + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -212,6 +214,7 @@ public class Pet { * @return status */ + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java index 32f55514e08..ae8b17e7792 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java @@ -20,10 +20,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -36,6 +34,7 @@ public class Tag { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -54,6 +53,7 @@ public class Tag { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java index 16f35830e84..f825d42b636 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java @@ -20,28 +20,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -54,6 +46,7 @@ public class User { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -72,6 +65,7 @@ public class User { * @return username */ + @JsonProperty("username") public String getUsername() { return username; } @@ -90,6 +84,7 @@ public class User { * @return firstName */ + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -108,6 +103,7 @@ public class User { * @return lastName */ + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -126,6 +122,7 @@ public class User { * @return email */ + @JsonProperty("email") public String getEmail() { return email; } @@ -144,6 +141,7 @@ public class User { * @return password */ + @JsonProperty("password") public String getPassword() { return password; } @@ -162,6 +160,7 @@ public class User { * @return phone */ + @JsonProperty("phone") public String getPhone() { return phone; } @@ -180,6 +179,7 @@ public class User { * @return userStatus */ + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES deleted file mode 100644 index 5d716a83385..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ /dev/null @@ -1,71 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/OpenApiGeneratorApplication.java -src/main/java/org/openapitools/RFC3339DateFormat.java -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/SpringDocConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml -src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-useoptional/README.md b/samples/openapi3/server/petstore/springboot-useoptional/README.md deleted file mode 100644 index e6de7e038ce..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# OpenAPI generated server - -Spring Boot Server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. -This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. - - -The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). -Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. -The specification is available to download using the following url: -http://localhost:80/v3/api-docs/ - -Start your server as a simple java application - -You can view the api documentation in swagger-ui by pointing to -http://localhost:80/swagger-ui.html - -Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml b/samples/openapi3/server/petstore/springboot-useoptional/pom.xml deleted file mode 100644 index 93fdc77cc30..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - 4.0.0 - org.openapitools.openapi3 - spring-boot-useoptional - jar - spring-boot-useoptional - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 1.6.14 - 4.15.5 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.6 - - - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.data - spring-data-commons - - - - org.springdoc - springdoc-openapi-ui - ${springdoc.version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - org.openapitools - jackson-databind-nullable - 0.2.6 - - - - org.springframework.boot - spring-boot-starter-validation - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java deleted file mode 100644 index 97252a8a940..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.FilterType; -import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; - -@SpringBootApplication( - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -@ComponentScan( - basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -public class OpenApiGeneratorApplication { - - public static void main(String[] args) { - SpringApplication.run(OpenApiGeneratorApplication.class, args); - } - - @Bean(name = "org.openapitools.OpenApiGeneratorApplication.jsonNullableModule") - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/RFC3339DateFormat.java deleted file mode 100644 index bcd3936d8b3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index c2db7ca5a81..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0cc..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index 5ae5d5fed98..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 65b695629d4..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index ea6c56e02c1..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class PetApiController implements PetApi { - - private final NativeWebRequest request; - - @Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index 1292dc0b721..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index ca00184d2a5..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java deleted file mode 100644 index b257cf0a16c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openapitools.configuration; - -import org.openapitools.model.EnumClass; -import org.openapitools.model.OuterEnum; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.convert.converter.Converter; - -@Configuration -public class EnumConverterConfiguration { - - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter") - Converter enumClassConverter() { - return new Converter() { - @Override - public EnumClass convert(String source) { - return EnumClass.fromValue(source); - } - }; - } - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter") - Converter outerEnumConverter() { - return new Converter() { - @Override - public OuterEnum convert(String source) { - return OuterEnum.fromValue(source); - } - }; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 9aa29284ab5..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.GetMapping; - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java deleted file mode 100644 index a32f1f67787..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.security.SecurityScheme; - -@Configuration -public class SpringDocConfiguration { - - @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo") - OpenAPI apiInfo() { - return new OpenAPI() - .info( - new 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( - new License() - .name("Apache-2.0") - .url("https://www.apache.org/licenses/LICENSE-2.0.html") - ) - .version("1.0.0") - ) - .components( - new Components() - .addSecuritySchemes("petstore_auth", new SecurityScheme() - .type(SecurityScheme.Type.OAUTH2) - ) - .addSecuritySchemes("api_key", new SecurityScheme() - .type(SecurityScheme.Type.APIKEY) - .in(SecurityScheme.In.HEADER) - .name("api_key") - ) - .addSecuritySchemes("api_key_query", new SecurityScheme() - .type(SecurityScheme.Type.APIKEY) - .in(SecurityScheme.In.QUERY) - .name("api_key_query") - ) - .addSecuritySchemes("http_basic_test", new SecurityScheme() - .type(SecurityScheme.Type.HTTP) - .scheme("basic") - ) - ) - ; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index 0661c1a9a8d..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index a3f9c905789..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index db5f8d3ce35..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index 14e13504a8c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,399 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - 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 putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\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(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index ff0d6d7241e..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index cc212be855d..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index 7c74b7de08d..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index 6087e70dba7..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index 1ecf10efc5c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - /** - * Default constructor - * @deprecated Use {@link Animal#Animal(String)} - */ - @Deprecated - public Animal() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Animal(String className) { - this.className = className; - } - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 42600354f74..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index 2f6c19a8344..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index 23ee84ce8b5..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 8c5453c4a5b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.Cat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - /** - * Default constructor - * @deprecated Use {@link BigCat#BigCat(String)} - */ - @Deprecated - public BigCat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public BigCat(String className) { - super(className); - } - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public BigCat declawed(Boolean declawed) { - super.setDeclawed(declawed); - return this; - } - - public BigCat className(String className) { - super.setClassName(className); - return this; - } - - public BigCat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index 741de9f41a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 0c56400050b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index a2feece8de8..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - /** - * Default constructor - * @deprecated Use {@link Cat#Cat(String)} - */ - @Deprecated - public Cat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Cat(String className) { - super(className); - } - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - public Cat className(String className) { - super.setClassName(className); - return this; - } - - public Cat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index 50a9c2cdce9..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 7ee1fde0646..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - /** - * Default constructor - * @deprecated Use {@link Category#Category(String)} - */ - @Deprecated - public Category() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Category(String name) { - this.name = name; - } - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index a1942e9c404..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index c38b26829be..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 1bb3d6b5102..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - /** - * Default constructor - * @deprecated Use {@link Dog#Dog(String)} - */ - @Deprecated - public Dog() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Dog(String className) { - super(className); - } - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - public Dog className(String className) { - super.setClassName(className); - return this; - } - - public Dog color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index 256925a7841..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index 2720e81c227..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index 4e6027d16c4..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index 6f08d4ee9fb..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,343 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.OuterEnum; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - /** - * Default constructor - * @deprecated Use {@link EnumTest#EnumTest(EnumStringRequiredEnum)} - */ - @Deprecated - public EnumTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EnumTest(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index bf750ccdcb7..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@Schema(name = "File", description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 8b196d5d7de..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List<@Valid File> files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List<@Valid File> files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid File> getFiles() { - return files; - } - - public void setFiles(List<@Valid File> files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 06e9dde8e89..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,434 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - /** - * Default constructor - * @deprecated Use {@link FormatTest#FormatTest(BigDecimal, byte[], LocalDate, String)} - */ - @Deprecated - public FormatTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) { - this.number = number; - this._byte = _byte; - this.date = date; - this.password = password; - } - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index c218d0e02b8..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 9811806e0c8..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - 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 - */ - - @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index bcf0155a1b2..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 9ca96d114aa..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@Schema(name = "200_response", description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 06c806057b5..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index de11d272cc3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index f168748f6a2..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index 641c56cd81c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@Schema(name = "Return", description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index d6dcb665651..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,172 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@Schema(name = "Name", description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - /** - * Default constructor - * @deprecated Use {@link Name#Name(Integer)} - */ - @Deprecated - public Name() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Name(Integer name) { - this.name = name; - } - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index 4a3b6beffa2..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 9a5b61bad43..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,244 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index b66d6d38afb..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 7fdf6f47de3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 6adaaba97d7..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,281 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List<@Valid Tag> tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - /** - * Default constructor - * @deprecated Use {@link Pet#Pet(String, Set)} - */ - @Deprecated - public Pet() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Pet(String name, Set photoUrls) { - this.name = name; - this.photoUrls = photoUrls; - } - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List<@Valid Tag> tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid Tag> getTags() { - return tags; - } - - public void setTags(List<@Valid Tag> tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index 8c43e7e8c30..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index c3d3aa9182e..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index 03d5607e29b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 67ef036857d..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -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") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderDefault#TypeHolderDefault(String, BigDecimal, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderDefault() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) - 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) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index 5b77bee14c1..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,233 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -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") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderExample#TypeHolderExample(String, BigDecimal, Float, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderExample() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.floatItem = floatItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) - 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 - @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) - 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) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - 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); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index e09df9be7b7..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 1a4455cdaa8..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,839 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -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") - @Valid - 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") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - 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") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - 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") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - 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") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 - */ - - @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - 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 (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.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); - } - - @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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/application.properties b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/application.properties deleted file mode 100644 index 9d06609db66..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port=80 -spring.jackson.date-format=org.openapitools.RFC3339DateFormat -spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java deleted file mode 100644 index 3681f67e770..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class OpenApiGeneratorApplicationTests { - - @Test - void contextLoads() { - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java index 18b55b13d16..0c0e8e8e72a 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -39,6 +37,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Category { */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index e18ac769bd2..00924b168ab 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java index 317082440c6..4c1bb184a39 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..7ed29b5a5c0 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java index b748650e3c0..adea27d0193 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java index ac6ddb97bbc..9ec0b712b14 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES index 8dc5fd25605..f36d2528d09 100644 --- a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES @@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile src/Org.OpenAPITools/Filters/BasePathFilter.cs src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/CatAllOf.cs src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/DogAllOf.cs src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..01f525396dc --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,142 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..9bb95fe5a4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/CatAllOf.cs new file mode 100644 index 00000000000..ca2b213b0cf --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/CatAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class CatAllOf : IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((CatAllOf)obj); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(CatAllOf left, CatAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(CatAllOf left, CatAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..ff3a582cc13 --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/DogAllOf.cs new file mode 100644 index 00000000000..6be8ff2fe4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/DogAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class DogAllOf : IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DogAllOf)obj); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DogAllOf left, DogAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(DogAllOf left, DogAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Pet.cs index 762279e4d6d..c54bbe4fd64 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Pet.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets Name /// + /// "doggie" [Required] [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index 0ccbb4c793c..53d1a8e9b10 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -1048,6 +1048,40 @@ "title" : "An uploaded response", "type" : "object" }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Dog_allOf" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] + }, + "Animal" : { + "discriminator" : { + "mapping" : { + "DOG" : "#/components/schemas/Dog", + "CAT" : "#/components/schemas/Cat" + }, + "propertyName" : "className" + }, + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "default" : "red", + "type" : "string" + } + }, + "required" : [ "className" ], + "type" : "object" + }, "updatePetWithForm_request" : { "properties" : { "name" : { @@ -1074,6 +1108,24 @@ } }, "type" : "object" + }, + "Dog_allOf" : { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object", + "example" : null + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object", + "example" : null } }, "securitySchemes" : { diff --git a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES index 8dc5fd25605..f36d2528d09 100644 --- a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES @@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile src/Org.OpenAPITools/Filters/BasePathFilter.cs src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/CatAllOf.cs src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/DogAllOf.cs src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..01f525396dc --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,142 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..9bb95fe5a4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/CatAllOf.cs new file mode 100644 index 00000000000..ca2b213b0cf --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/CatAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class CatAllOf : IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((CatAllOf)obj); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(CatAllOf left, CatAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(CatAllOf left, CatAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..ff3a582cc13 --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/DogAllOf.cs new file mode 100644 index 00000000000..6be8ff2fe4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/DogAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class DogAllOf : IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DogAllOf)obj); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DogAllOf left, DogAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(DogAllOf left, DogAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Pet.cs index 762279e4d6d..c54bbe4fd64 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Pet.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets Name /// + /// "doggie" [Required] [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json index 0ccbb4c793c..53d1a8e9b10 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -1048,6 +1048,40 @@ "title" : "An uploaded response", "type" : "object" }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Dog_allOf" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] + }, + "Animal" : { + "discriminator" : { + "mapping" : { + "DOG" : "#/components/schemas/Dog", + "CAT" : "#/components/schemas/Cat" + }, + "propertyName" : "className" + }, + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "default" : "red", + "type" : "string" + } + }, + "required" : [ "className" ], + "type" : "object" + }, "updatePetWithForm_request" : { "properties" : { "name" : { @@ -1074,6 +1108,24 @@ } }, "type" : "object" + }, + "Dog_allOf" : { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object", + "example" : null + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object", + "example" : null } }, "securitySchemes" : { diff --git a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES index 8dc5fd25605..f36d2528d09 100644 --- a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES @@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile src/Org.OpenAPITools/Filters/BasePathFilter.cs src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/CatAllOf.cs src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/DogAllOf.cs src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..01f525396dc --- /dev/null +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,142 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..9bb95fe5a4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/CatAllOf.cs new file mode 100644 index 00000000000..ca2b213b0cf --- /dev/null +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/CatAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class CatAllOf : IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((CatAllOf)obj); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(CatAllOf left, CatAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(CatAllOf left, CatAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..ff3a582cc13 --- /dev/null +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/DogAllOf.cs new file mode 100644 index 00000000000..6be8ff2fe4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/DogAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class DogAllOf : IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DogAllOf)obj); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DogAllOf left, DogAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(DogAllOf left, DogAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Pet.cs index 762279e4d6d..c54bbe4fd64 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Pet.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets Name /// + /// "doggie" [Required] [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index 0ccbb4c793c..53d1a8e9b10 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -1048,6 +1048,40 @@ "title" : "An uploaded response", "type" : "object" }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Dog_allOf" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] + }, + "Animal" : { + "discriminator" : { + "mapping" : { + "DOG" : "#/components/schemas/Dog", + "CAT" : "#/components/schemas/Cat" + }, + "propertyName" : "className" + }, + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "default" : "red", + "type" : "string" + } + }, + "required" : [ "className" ], + "type" : "object" + }, "updatePetWithForm_request" : { "properties" : { "name" : { @@ -1074,6 +1108,24 @@ } }, "type" : "object" + }, + "Dog_allOf" : { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object", + "example" : null + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object", + "example" : null } }, "securitySchemes" : { diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES index 9e47b8916d5..2d78823754e 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES @@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile src/Org.OpenAPITools/Filters/BasePathFilter.cs src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/CatAllOf.cs src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/DogAllOf.cs src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..c7a6ae09eaa --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,51 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..537c0f7f714 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,36 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/CatAllOf.cs new file mode 100644 index 00000000000..26eaeb38167 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/CatAllOf.cs @@ -0,0 +1,36 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class CatAllOf + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..f1a52695233 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,36 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/DogAllOf.cs new file mode 100644 index 00000000000..c4029b4d981 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/DogAllOf.cs @@ -0,0 +1,36 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class DogAllOf + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs index b573ef0eea0..f2efc4915a8 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets Name /// + /// "doggie" [Required] [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json index 0ccbb4c793c..53d1a8e9b10 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -1048,6 +1048,40 @@ "title" : "An uploaded response", "type" : "object" }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Dog_allOf" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] + }, + "Animal" : { + "discriminator" : { + "mapping" : { + "DOG" : "#/components/schemas/Dog", + "CAT" : "#/components/schemas/Cat" + }, + "propertyName" : "className" + }, + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "default" : "red", + "type" : "string" + } + }, + "required" : [ "className" ], + "type" : "object" + }, "updatePetWithForm_request" : { "properties" : { "name" : { @@ -1074,6 +1108,24 @@ } }, "type" : "object" + }, + "Dog_allOf" : { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object", + "example" : null + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object", + "example" : null } }, "securitySchemes" : { diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES index fe403832ad9..6d74d26da32 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES @@ -2,9 +2,14 @@ Org.OpenAPITools.sln README.md build.bat build.sh +src/Org.OpenAPITools.Models/Animal.cs src/Org.OpenAPITools.Models/ApiResponse.cs +src/Org.OpenAPITools.Models/Cat.cs +src/Org.OpenAPITools.Models/CatAllOf.cs src/Org.OpenAPITools.Models/Category.cs src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools.Models/Dog.cs +src/Org.OpenAPITools.Models/DogAllOf.cs src/Org.OpenAPITools.Models/Order.cs src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj src/Org.OpenAPITools.Models/Pet.cs diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs new file mode 100644 index 00000000000..01f525396dc --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs @@ -0,0 +1,142 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs new file mode 100644 index 00000000000..9bb95fe5a4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/CatAllOf.cs new file mode 100644 index 00000000000..ca2b213b0cf --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/CatAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class CatAllOf : IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((CatAllOf)obj); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(CatAllOf left, CatAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(CatAllOf left, CatAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs new file mode 100644 index 00000000000..ff3a582cc13 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/DogAllOf.cs new file mode 100644 index 00000000000..6be8ff2fe4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/DogAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class DogAllOf : IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DogAllOf)obj); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DogAllOf left, DogAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(DogAllOf left, DogAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs index 762279e4d6d..c54bbe4fd64 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Pet.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets Name /// + /// "doggie" [Required] [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json index 0ccbb4c793c..53d1a8e9b10 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -1048,6 +1048,40 @@ "title" : "An uploaded response", "type" : "object" }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Dog_allOf" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] + }, + "Animal" : { + "discriminator" : { + "mapping" : { + "DOG" : "#/components/schemas/Dog", + "CAT" : "#/components/schemas/Cat" + }, + "propertyName" : "className" + }, + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "default" : "red", + "type" : "string" + } + }, + "required" : [ "className" ], + "type" : "object" + }, "updatePetWithForm_request" : { "properties" : { "name" : { @@ -1074,6 +1108,24 @@ } }, "type" : "object" + }, + "Dog_allOf" : { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object", + "example" : null + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object", + "example" : null } }, "securitySchemes" : { diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/spring-cloud-async/.openapi-generator-ignore rename to samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator-ignore diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES new file mode 100644 index 00000000000..94dce5508ef --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES @@ -0,0 +1,27 @@ +Org.OpenAPITools.sln +README.md +build.bat +build.sh +src/Org.OpenAPITools/.gitignore +src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +src/Org.OpenAPITools/Controllers/FakeApi.cs +src/Org.OpenAPITools/Controllers/PetApi.cs +src/Org.OpenAPITools/Controllers/StoreApi.cs +src/Org.OpenAPITools/Controllers/UserApi.cs +src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs +src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/CatAllOf.cs +src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/DogAllOf.cs +src/Org.OpenAPITools/Models/Order.cs +src/Org.OpenAPITools/Models/Pet.cs +src/Org.OpenAPITools/Models/Tag.cs +src/Org.OpenAPITools/Models/User.cs +src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/VERSION new file mode 100644 index 00000000000..757e6740040 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/Org.OpenAPITools.sln new file mode 100644 index 00000000000..c2bc3876420 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/Org.OpenAPITools.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2043 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/README.md b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/README.md new file mode 100644 index 00000000000..06ddde516ac --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/README.md @@ -0,0 +1,43 @@ +# Org.OpenAPITools - ASP.NET Core 6.0 Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Upgrade NuGet Packages + +NuGet packages get frequently updated. + +To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. + + +Install dotnet-outdated tool: + +``` +dotnet tool install --global dotnet-outdated-tool +``` + +Upgrade only to new minor versions of packages + +``` +dotnet outdated --upgrade --version-lock Major +``` + +Upgrade to all new versions of packages (more likely to include breaking API changes) + +``` +dotnet outdated --upgrade +``` + + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.bat b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.bat new file mode 100644 index 00000000000..cd65518e428 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://openapi-generator.tech +:: + +@echo off + +dotnet restore src\Org.OpenAPITools +dotnet build src\Org.OpenAPITools +echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.sh b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.sh new file mode 100644 index 00000000000..afbeddb8378 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://openapi-generator.tech +# + +dotnet restore src/Org.OpenAPITools/ && \ + dotnet build src/Org.OpenAPITools/ && \ + echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore new file mode 100644 index 00000000000..1ee53850b84 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.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 + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# 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 +# Note: 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 +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable 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 +*.appx +*.appxbundle +*.appxupload + +# 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 +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# 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 +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..3ed1bc5b5ab --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace Org.OpenAPITools.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + if (descriptor != null) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + var validationAttribute = attributeInstance as ValidationAttribute; + if (validationAttribute != null) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs new file mode 100644 index 00000000000..85be8593fce --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs @@ -0,0 +1,62 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace Org.OpenAPITools.Authentication +{ + /// + /// A requirement that an ApiKey must be present. + /// + public class ApiKeyRequirement : IAuthorizationRequirement + { + /// + /// Get the list of api keys + /// + public IReadOnlyList ApiKeys { get; } + + /// + /// Get the policy name, + /// + public string PolicyName { get; } + + /// + /// Create a new instance of the class. + /// + /// + /// + public ApiKeyRequirement(IEnumerable apiKeys, string policyName) + { + ApiKeys = apiKeys?.ToList() ?? new List(); + PolicyName = policyName; + } + } + + /// + /// Enforce that an api key is present. + /// + public class ApiKeyRequirementHandler : AuthorizationHandler + { + /// + protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + SucceedRequirementIfApiKeyPresentAndValid(context, requirement); + return Task.CompletedTask; + } + + private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) + { + + if (context.Resource is AuthorizationFilterContext authorizationFilterContext) + { + var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); + if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) + { + context.Succeed(requirement); + } + } + + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs new file mode 100644 index 00000000000..07c44c86143 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs @@ -0,0 +1,38 @@ +/* + * 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 + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class FakeApiController : ControllerBase + { + /// + /// fake endpoint to test parameter example (object) + /// + /// + /// successful operation + [HttpGet] + [Route("/v2/fake/parameter_example_test")] + [ValidateModelState] + public abstract IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data); + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs new file mode 100644 index 00000000000..8cd072efb95 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -0,0 +1,136 @@ +/* + * 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 + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult AddPet([FromBody]Pet pet); + + /// + /// Deletes a pet + /// + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + public abstract IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey); + + /// + /// Finds Pets by status + /// + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter (deprecated) + /// successful operation + /// Invalid status value + [HttpGet] + [Route("/v2/pet/findByStatus")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(List))] + public abstract IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status); + + /// + /// Finds Pets by tags + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// Invalid tag value + [HttpGet] + [Route("/v2/pet/findByTags")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(List))] + [Obsolete] + public abstract IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags); + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + [HttpGet] + [Route("/v2/pet/{petId}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId); + + /// + /// Update an existing pet + /// + /// Pet object that needs to be added to the store + /// successful operation + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [Consumes("application/json", "application/xml")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Pet))] + public abstract IActionResult UpdatePet([FromBody]Pet pet); + + /// + /// Updates a pet in the store with form data + /// + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// Invalid input + [HttpPost] + [Route("/v2/pet/{petId}")] + [Consumes("application/x-www-form-urlencoded")] + [ValidateModelState] + public abstract IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status); + + /// + /// uploads an image + /// + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + [HttpPost] + [Route("/v2/pet/{petId}/uploadImage")] + [Consumes("multipart/form-data")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(ApiResponse))] + public abstract IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file); + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs new file mode 100644 index 00000000000..3ec0d549c4a --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -0,0 +1,79 @@ +/* + * 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 + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class StoreApiController : ControllerBase + { + /// + /// Delete purchase order by ID + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// ID of the order that needs to be deleted + /// Invalid ID supplied + /// Order not found + [HttpDelete] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + public abstract IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId); + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + [HttpGet] + [Route("/v2/store/inventory")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Dictionary))] + public abstract IActionResult GetInventory(); + + /// + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// ID of pet that needs to be fetched + /// successful operation + /// Invalid ID supplied + /// Order not found + [HttpGet] + [Route("/v2/store/order/{orderId}")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Order))] + public abstract IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId); + + /// + /// Place an order for a pet + /// + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + [HttpPost] + [Route("/v2/store/order")] + [Consumes("application/json")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(Order))] + public abstract IActionResult PlaceOrder([FromBody]Order order); + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs new file mode 100644 index 00000000000..2de74542f79 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -0,0 +1,129 @@ +/* + * 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 + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Org.OpenAPITools.Attributes; +using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Controllers +{ + /// + /// + /// + [ApiController] + public abstract class UserApiController : ControllerBase + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + public abstract IActionResult CreateUser([FromBody]User user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithArray")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + public abstract IActionResult CreateUsersWithArrayInput([FromBody]List user); + + /// + /// Creates list of users with given input array + /// + /// List of user object + /// successful operation + [HttpPost] + [Route("/v2/user/createWithList")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + public abstract IActionResult CreateUsersWithListInput([FromBody]List user); + + /// + /// Delete user + /// + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// Invalid username supplied + /// User not found + [HttpDelete] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + public abstract IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username); + + /// + /// Get user by user name + /// + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// Invalid username supplied + /// User not found + [HttpGet] + [Route("/v2/user/{username}")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(User))] + public abstract IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username); + + /// + /// Logs user into the system + /// + /// The user name for login + /// The password for login in clear text + /// successful operation + /// Invalid username/password supplied + [HttpGet] + [Route("/v2/user/login")] + [ValidateModelState] + [ProducesResponseType(statusCode: 200, type: typeof(string))] + public abstract IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password); + + /// + /// Logs out current logged in user session + /// + /// successful operation + [HttpGet] + [Route("/v2/user/logout")] + [Authorize(Policy = "api_key")] + [ValidateModelState] + public abstract IActionResult LogoutUser(); + + /// + /// Updated user + /// + /// This can only be done by the logged in user. + /// name that need to be deleted + /// Updated user object + /// Invalid user supplied + /// User not found + [HttpPut] + [Route("/v2/user/{username}")] + [Authorize(Policy = "api_key")] + [Consumes("application/json")] + [ValidateModelState] + public abstract IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user); + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 00000000000..00b75a3cc7c --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -0,0 +1,42 @@ +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + /// + /// Determine if we can convert a type to an enum + /// + /// + /// + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); + } + + /// + /// Convert from a type value to an enum + /// + /// + /// + /// + /// + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value.ToString() + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs new file mode 100644 index 00000000000..9c437b1919a --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs @@ -0,0 +1,32 @@ +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Formatters; + +namespace Org.OpenAPITools.Formatters +{ + // Input Type Formatter to allow model binding to Streams + public class InputFormatterStream : InputFormatter + { + public InputFormatterStream() + { + SupportedMediaTypes.Add("application/octet-stream"); + SupportedMediaTypes.Add("image/jpeg"); + } + + protected override bool CanReadType(Type type) + { + if (type == typeof(Stream)) + { + return true; + } + + return false; + } + + public override Task ReadRequestBodyAsync(InputFormatterContext context) + { + return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..fcc9a35520d --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,138 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + public class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs new file mode 100644 index 00000000000..9932c3d79ef --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -0,0 +1,147 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=true)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ApiResponse)obj); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + + Code.Equals(other.Code) + ) && + ( + Type == other.Type || + Type != null && + Type.Equals(other.Type) + ) && + ( + Message == other.Message || + Message != null && + Message.Equals(other.Message) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Code.GetHashCode(); + if (Type != null) + hashCode = hashCode * 59 + Type.GetHashCode(); + if (Message != null) + hashCode = hashCode * 59 + Message.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(ApiResponse left, ApiResponse right) + { + return Equals(left, right); + } + + public static bool operator !=(ApiResponse left, ApiResponse right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..faae4a77964 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/CatAllOf.cs new file mode 100644 index 00000000000..39cedeca0a5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/CatAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public class CatAllOf : IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((CatAllOf)obj); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(CatAllOf left, CatAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(CatAllOf left, CatAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs new file mode 100644 index 00000000000..585afaebf2f --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Category)obj); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Category left, Category right) + { + return Equals(left, right); + } + + public static bool operator !=(Category left, Category right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..db459e520a4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/DogAllOf.cs new file mode 100644 index 00000000000..b30543c4332 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/DogAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public class DogAllOf : IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DogAllOf)obj); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DogAllOf left, DogAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(DogAllOf left, DogAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs new file mode 100644 index 00000000000..e9d93703049 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs @@ -0,0 +1,219 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId", EmitDefaultValue=true)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity", EmitDefaultValue=true)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate", EmitDefaultValue=false)] + public DateTime ShipDate { get; set; } + + + /// + /// Order Status + /// + /// Order Status + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum PlacedEnum for placed + /// + [EnumMember(Value = "placed")] + PlacedEnum = 1, + + /// + /// Enum ApprovedEnum for approved + /// + [EnumMember(Value = "approved")] + ApprovedEnum = 2, + + /// + /// Enum DeliveredEnum for delivered + /// + [EnumMember(Value = "delivered")] + DeliveredEnum = 3 + } + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete", EmitDefaultValue=true)] + public bool Complete { get; set; } = false; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Order)obj); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + ShipDate != null && + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + + Complete.Equals(other.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + + hashCode = hashCode * 59 + PetId.GetHashCode(); + + hashCode = hashCode * 59 + Quantity.GetHashCode(); + if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + + hashCode = hashCode * 59 + Complete.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Order left, Order right) + { + return Equals(left, right); + } + + public static bool operator !=(Order left, Order right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs new file mode 100644 index 00000000000..c1981aa645f --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs @@ -0,0 +1,224 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category", EmitDefaultValue=false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + /// "doggie" + [Required] + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls", EmitDefaultValue=false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags", EmitDefaultValue=false)] + public List Tags { get; set; } + + + /// + /// pet status in the store + /// + /// pet status in the store + [TypeConverter(typeof(CustomEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum StatusEnum + { + + /// + /// Enum AvailableEnum for available + /// + [EnumMember(Value = "available")] + AvailableEnum = 1, + + /// + /// Enum PendingEnum for pending + /// + [EnumMember(Value = "pending")] + PendingEnum = 2, + + /// + /// Enum SoldEnum for sold + /// + [EnumMember(Value = "sold")] + SoldEnum = 3 + } + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name="status", EmitDefaultValue=true)] + public StatusEnum Status { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Pet)obj); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Category == other.Category || + Category != null && + Category.Equals(other.Category) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + PhotoUrls == other.PhotoUrls || + PhotoUrls != null && + other.PhotoUrls != null && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + other.Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + + Status.Equals(other.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Category != null) + hashCode = hashCode * 59 + Category.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (PhotoUrls != null) + hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); + if (Tags != null) + hashCode = hashCode * 59 + Tags.GetHashCode(); + + hashCode = hashCode * 59 + Status.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Pet left, Pet right) + { + return Equals(left, right); + } + + public static bool operator !=(Pet left, Pet right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs new file mode 100644 index 00000000000..18d6e092e78 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs @@ -0,0 +1,133 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Tag)obj); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Tag left, Tag right) + { + return Equals(left, right); + } + + public static bool operator !=(Tag left, Tag right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs new file mode 100644 index 00000000000..7d4aabd8251 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs @@ -0,0 +1,218 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id", EmitDefaultValue=true)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username", EmitDefaultValue=false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName", EmitDefaultValue=false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName", EmitDefaultValue=false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email", EmitDefaultValue=false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password", EmitDefaultValue=false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone", EmitDefaultValue=false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus", EmitDefaultValue=true)] + public int UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((User)obj); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + + Id.Equals(other.Id) + ) && + ( + Username == other.Username || + Username != null && + Username.Equals(other.Username) + ) && + ( + FirstName == other.FirstName || + FirstName != null && + FirstName.Equals(other.FirstName) + ) && + ( + LastName == other.LastName || + LastName != null && + LastName.Equals(other.LastName) + ) && + ( + Email == other.Email || + Email != null && + Email.Equals(other.Email) + ) && + ( + Password == other.Password || + Password != null && + Password.Equals(other.Password) + ) && + ( + Phone == other.Phone || + Phone != null && + Phone.Equals(other.Phone) + ) && + ( + UserStatus == other.UserStatus || + + UserStatus.Equals(other.UserStatus) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Username != null) + hashCode = hashCode * 59 + Username.GetHashCode(); + if (FirstName != null) + hashCode = hashCode * 59 + FirstName.GetHashCode(); + if (LastName != null) + hashCode = hashCode * 59 + LastName.GetHashCode(); + if (Email != null) + hashCode = hashCode * 59 + Email.GetHashCode(); + if (Password != null) + hashCode = hashCode * 59 + Password.GetHashCode(); + if (Phone != null) + hashCode = hashCode * 59 + Phone.GetHashCode(); + + hashCode = hashCode * 59 + UserStatus.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(User left, User right) + { + return Equals(left, right); + } + + public static bool operator !=(User left, User right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs new file mode 100644 index 00000000000..b862226f2c1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs @@ -0,0 +1,51 @@ +using System; +using System.Linq; +using System.Text; + +namespace Org.OpenAPITools.OpenApi +{ + /// + /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x + /// + public static class TypeExtensions + { + /// + /// Produce a friendly name for the type which is unique. + /// + /// + /// + public static string FriendlyId(this Type type, bool fullyQualified = false) + { + var typeName = fullyQualified + ? type.FullNameSansTypeParameters().Replace("+", ".") + : type.Name; + + if (type.IsGenericType) + { + var genericArgumentIds = type.GetGenericArguments() + .Select(t => t.FriendlyId(fullyQualified)) + .ToArray(); + + return new StringBuilder(typeName) + .Replace($"`{genericArgumentIds.Count()}", string.Empty) + .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") + .ToString(); + } + + return typeName; + } + + /// + /// Determine the fully qualified type name without type parameters. + /// + /// + public static string FullNameSansTypeParameters(this Type type) + { + var fullName = type.FullName; + if (string.IsNullOrEmpty(fullName)) + fullName = type.Name; + var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); + return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj new file mode 100644 index 00000000000..2c3b91dd954 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -0,0 +1,26 @@ + + + A library generated from a OpenAPI doc + No Copyright + OpenAPI + net6.0 + true + true + 1.0.0 + Library + Org.OpenAPITools + Org.OpenAPITools + cb87e868-8646-48ef-9bb6-344b537d0d37 + Linux + ..\.. + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec new file mode 100644 index 00000000000..b1d83a35961 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec @@ -0,0 +1,20 @@ + + + + $id$ + 1.0.0 + OpenAPI Library + OpenAPI + OpenAPI + https://www.apache.org/licenses/LICENSE-2.0.html + + false + A library generated from a OpenAPI doc + Summary of changes made in this release of the package. + No Copyright + Org.OpenAPITools + + diff --git a/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES index 9e47b8916d5..2d78823754e 100644 --- a/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES +++ b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES @@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile src/Org.OpenAPITools/Filters/BasePathFilter.cs src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +src/Org.OpenAPITools/Models/Animal.cs src/Org.OpenAPITools/Models/ApiResponse.cs +src/Org.OpenAPITools/Models/Cat.cs +src/Org.OpenAPITools/Models/CatAllOf.cs src/Org.OpenAPITools/Models/Category.cs +src/Org.OpenAPITools/Models/Dog.cs +src/Org.OpenAPITools/Models/DogAllOf.cs src/Org.OpenAPITools/Models/Order.cs src/Org.OpenAPITools/Models/Pet.cs src/Org.OpenAPITools/Models/Tag.cs diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Animal.cs new file mode 100644 index 00000000000..01f525396dc --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Animal.cs @@ -0,0 +1,142 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using JsonSubTypes; +using Swashbuckle.AspNetCore.Annotations; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] + [SwaggerDiscriminator("ClassName")] + [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] + [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] + [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] + [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] + public partial class Animal : IEquatable + { + /// + /// Gets or Sets ClassName + /// + [Required] + [DataMember(Name="className", EmitDefaultValue=false)] + public string ClassName { get; set; } + + /// + /// Gets or Sets Color + /// + [DataMember(Name="color", EmitDefaultValue=false)] + public string Color { get; set; } = "red"; + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Animal {\n"); + sb.Append(" ClassName: ").Append(ClassName).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Animal)obj); + } + + /// + /// Returns true if Animal instances are equal + /// + /// Instance of Animal to be compared + /// Boolean + public bool Equals(Animal other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ClassName == other.ClassName || + ClassName != null && + ClassName.Equals(other.ClassName) + ) && + ( + Color == other.Color || + Color != null && + Color.Equals(other.Color) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ClassName != null) + hashCode = hashCode * 59 + ClassName.GetHashCode(); + if (Color != null) + hashCode = hashCode * 59 + Color.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Animal left, Animal right) + { + return Equals(left, right); + } + + public static bool operator !=(Animal left, Animal right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Cat.cs new file mode 100644 index 00000000000..9bb95fe5a4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Cat.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Cat : Animal, IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Cat {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Cat)obj); + } + + /// + /// Returns true if Cat instances are equal + /// + /// Instance of Cat to be compared + /// Boolean + public bool Equals(Cat other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Cat left, Cat right) + { + return Equals(left, right); + } + + public static bool operator !=(Cat left, Cat right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/CatAllOf.cs new file mode 100644 index 00000000000..ca2b213b0cf --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/CatAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class CatAllOf : IEquatable + { + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=true)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((CatAllOf)obj); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Declawed == other.Declawed || + + Declawed.Equals(other.Declawed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + + hashCode = hashCode * 59 + Declawed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(CatAllOf left, CatAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(CatAllOf left, CatAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Dog.cs new file mode 100644 index 00000000000..ff3a582cc13 --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Dog.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class Dog : Animal, IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Dog {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public new string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Dog)obj); + } + + /// + /// Returns true if Dog instances are equal + /// + /// Instance of Dog to be compared + /// Boolean + public bool Equals(Dog other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Dog left, Dog right) + { + return Equals(left, right); + } + + public static bool operator !=(Dog left, Dog right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/DogAllOf.cs new file mode 100644 index 00000000000..6be8ff2fe4e --- /dev/null +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/DogAllOf.cs @@ -0,0 +1,119 @@ +/* + * 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 + */ + +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Org.OpenAPITools.Converters; + +namespace Org.OpenAPITools.Models +{ + /// + /// + /// + [DataContract] + public partial class DogAllOf : IEquatable + { + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is null) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((DogAllOf)obj); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf other) + { + if (other is null) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Breed == other.Breed || + Breed != null && + Breed.Equals(other.Breed) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Breed != null) + hashCode = hashCode * 59 + Breed.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(DogAllOf left, DogAllOf right) + { + return Equals(left, right); + } + + public static bool operator !=(DogAllOf left, DogAllOf right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Pet.cs index 762279e4d6d..c54bbe4fd64 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Pet.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets Name /// + /// "doggie" [Required] [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json index 0ccbb4c793c..53d1a8e9b10 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -1048,6 +1048,40 @@ "title" : "An uploaded response", "type" : "object" }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Dog_allOf" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] + }, + "Animal" : { + "discriminator" : { + "mapping" : { + "DOG" : "#/components/schemas/Dog", + "CAT" : "#/components/schemas/Cat" + }, + "propertyName" : "className" + }, + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "default" : "red", + "type" : "string" + } + }, + "required" : [ "className" ], + "type" : "object" + }, "updatePetWithForm_request" : { "properties" : { "name" : { @@ -1074,6 +1108,24 @@ } }, "type" : "object" + }, + "Dog_allOf" : { + "properties" : { + "breed" : { + "type" : "string" + } + }, + "type" : "object", + "example" : null + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" + } + }, + "type" : "object", + "example" : null } }, "securitySchemes" : { 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 d5a816cd5ee..13b7ce44e8e 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs @@ -41,6 +41,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets Name /// + /// "doggie" [Required] [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/AllOfWithSingleRef.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/model/AllOfWithSingleRef.cpp index 304b8ae116d..d15b40d470a 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/model/AllOfWithSingleRef.cpp +++ b/samples/server/petstore/cpp-restbed/generated/3_0/model/AllOfWithSingleRef.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -63,7 +64,6 @@ ptree AllOfWithSingleRef::toPropertyTree() const ptree pt; ptree tmp_node; pt.put("username", m_Username); - pt.add_child("SingleRefType", m_SingleRefType.toPropertyTree()); return pt; } @@ -71,9 +71,6 @@ void AllOfWithSingleRef::fromPropertyTree(ptree const &pt) { ptree tmp_node; m_Username = pt.get("username", ""); - if (pt.get_child_optional("SingleRefType")) { - m_SingleRefType = fromPt(pt.get_child("SingleRefType")); - } } std::string AllOfWithSingleRef::getUsername() const diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/AllOfWithSingleRef.h b/samples/server/petstore/cpp-restbed/generated/3_0/model/AllOfWithSingleRef.h index cb284e9d4b0..e0e48ebfb9a 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/model/AllOfWithSingleRef.h +++ b/samples/server/petstore/cpp-restbed/generated/3_0/model/AllOfWithSingleRef.h @@ -25,6 +25,7 @@ #include "SingleRefType.h" #include #include +#include #include #include "helpers.h" @@ -72,7 +73,7 @@ public: protected: std::string m_Username = ""; - SingleRefType m_SingleRefType; + SingleRefType m_SingleRefType = SingleRefType{}; }; std::vector createAllOfWithSingleRefVectorFromJsonString(const std::string& json); diff --git a/samples/server/petstore/go-api-server/go/api_pet.go b/samples/server/petstore/go-api-server/go/api_pet.go index 750a15f2820..ca5fe3e3623 100644 --- a/samples/server/petstore/go-api-server/go/api_pet.go +++ b/samples/server/petstore/go-api-server/go/api_pet.go @@ -124,7 +124,6 @@ func (c *PetApiController) DeletePet(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - apiKeyParam := r.Header.Get("api_key") result, err := c.service.DeletePet(r.Context(), petIdParam, apiKeyParam) // If an error occurred, encode the error with the status code @@ -173,7 +172,6 @@ func (c *PetApiController) GetPetById(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - result, err := c.service.GetPetById(r.Context(), petIdParam) // If an error occurred, encode the error with the status code if err != nil { @@ -219,7 +217,6 @@ func (c *PetApiController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - nameParam := r.FormValue("name") statusParam := r.FormValue("status") result, err := c.service.UpdatePetWithForm(r.Context(), petIdParam, nameParam, statusParam) @@ -244,7 +241,6 @@ func (c *PetApiController) UploadFile(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - additionalMetadataParam := r.FormValue("additionalMetadata") fileParam, err := ReadFormFileToTempFile(r, "file") diff --git a/samples/server/petstore/go-api-server/go/api_store.go b/samples/server/petstore/go-api-server/go/api_store.go index f0898e950de..737790ebcd3 100644 --- a/samples/server/petstore/go-api-server/go/api_store.go +++ b/samples/server/petstore/go-api-server/go/api_store.go @@ -77,7 +77,6 @@ func (c *StoreApiController) Routes() Routes { func (c *StoreApiController) DeleteOrder(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) orderIdParam := params["orderId"] - result, err := c.service.DeleteOrder(r.Context(), orderIdParam) // If an error occurred, encode the error with the status code if err != nil { @@ -108,7 +107,6 @@ func (c *StoreApiController) GetOrderById(w http.ResponseWriter, r *http.Request c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - result, err := c.service.GetOrderById(r.Context(), orderIdParam) // If an error occurred, encode the error with the status code if err != nil { diff --git a/samples/server/petstore/go-api-server/go/api_user.go b/samples/server/petstore/go-api-server/go/api_user.go index b5148a45673..5eaf4297d36 100644 --- a/samples/server/petstore/go-api-server/go/api_user.go +++ b/samples/server/petstore/go-api-server/go/api_user.go @@ -170,7 +170,6 @@ func (c *UserApiController) CreateUsersWithListInput(w http.ResponseWriter, r *h func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) usernameParam := params["username"] - result, err := c.service.DeleteUser(r.Context(), usernameParam) // If an error occurred, encode the error with the status code if err != nil { @@ -185,7 +184,6 @@ func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { func (c *UserApiController) GetUserByName(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) usernameParam := params["username"] - result, err := c.service.GetUserByName(r.Context(), usernameParam) // If an error occurred, encode the error with the status code if err != nil { @@ -227,7 +225,6 @@ func (c *UserApiController) LogoutUser(w http.ResponseWriter, r *http.Request) { func (c *UserApiController) UpdateUser(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) usernameParam := params["username"] - userParam := User{} d := json.NewDecoder(r.Body) d.DisallowUnknownFields() diff --git a/samples/server/petstore/go-api-server/go/routers.go b/samples/server/petstore/go-api-server/go/routers.go index 0fdd72f365d..d36e637e8ac 100644 --- a/samples/server/petstore/go-api-server/go/routers.go +++ b/samples/server/petstore/go-api-server/go/routers.go @@ -136,8 +136,8 @@ func readFileHeaderToTempFile(fileHeader *multipart.FileHeader) (*os.File, error return file, nil } -// parseInt64Parameter parses a string parameter to an int64. -func parseInt64Parameter(param string, required bool) (int64, error) { +// parseFloatParameter parses a string parameter to an int64. +func parseFloatParameter(param string, bitSize int, required bool) (float64, error) { if param == "" { if required { return 0, errors.New(errMsgRequiredMissing) @@ -146,25 +146,42 @@ func parseInt64Parameter(param string, required bool) (int64, error) { return 0, nil } - return strconv.ParseInt(param, 10, 64) + return strconv.ParseFloat(param, bitSize) +} + +// parseFloat64Parameter parses a string parameter to an float64. +func parseFloat64Parameter(param string, required bool) (float64, error) { + return parseFloatParameter(param, 64, required) +} + +// parseFloat32Parameter parses a string parameter to an float32. +func parseFloat32Parameter(param string, required bool) (float32, error) { + val, err := parseFloatParameter(param, 32, required) + return float32(val), err +} + +// parseIntParameter parses a string parameter to an int64. +func parseIntParameter(param string, bitSize int, required bool) (int64, error) { + if param == "" { + if required { + return 0, errors.New(errMsgRequiredMissing) + } + + return 0, nil + } + + return strconv.ParseInt(param, 10, bitSize) +} + +// parseInt64Parameter parses a string parameter to an int64. +func parseInt64Parameter(param string, required bool) (int64, error) { + return parseIntParameter(param, 64, required) } // parseInt32Parameter parses a string parameter to an int32. func parseInt32Parameter(param string, required bool) (int32, error) { - if param == "" { - if required { - return 0, errors.New(errMsgRequiredMissing) - } - - return 0, nil - } - - val, err := strconv.ParseInt(param, 10, 32) - if err != nil { - return -1, err - } - - return int32(val), nil + val, err := parseIntParameter(param, 32, required) + return int32(val), err } // parseBoolParameter parses a string parameter to a bool @@ -185,6 +202,55 @@ func parseBoolParameter(param string, required bool) (bool, error) { return bool(val), nil } +// parseFloat64ArrayParameter parses a string parameter containing array of values to []Float64. +func parseFloat64ArrayParameter(param, delim string, required bool) ([]float64, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + floats := make([]float64, len(str)) + + for i, s := range str { + if v, err := strconv.ParseFloat(s, 64); err != nil { + return nil, err + } else { + floats[i] = v + } + } + + return floats, nil +} + +// parseFloat32ArrayParameter parses a string parameter containing array of values to []float32. +func parseFloat32ArrayParameter(param, delim string, required bool) ([]float32, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + floats := make([]float32, len(str)) + + for i, s := range str { + if v, err := strconv.ParseFloat(s, 32); err != nil { + return nil, err + } else { + floats[i] = float32(v) + } + } + + return floats, nil +} + + // parseInt64ArrayParameter parses a string parameter containing array of values to []int64. func parseInt64ArrayParameter(param, delim string, required bool) ([]int64, error) { if param == "" { diff --git a/samples/server/petstore/go-chi-server/go/api_pet.go b/samples/server/petstore/go-chi-server/go/api_pet.go index 9d5b489f708..b6b9305d9df 100644 --- a/samples/server/petstore/go-chi-server/go/api_pet.go +++ b/samples/server/petstore/go-chi-server/go/api_pet.go @@ -123,7 +123,6 @@ func (c *PetApiController) DeletePet(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - apiKeyParam := r.Header.Get("api_key") result, err := c.service.DeletePet(r.Context(), petIdParam, apiKeyParam) // If an error occurred, encode the error with the status code @@ -171,7 +170,6 @@ func (c *PetApiController) GetPetById(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - result, err := c.service.GetPetById(r.Context(), petIdParam) // If an error occurred, encode the error with the status code if err != nil { @@ -216,7 +214,6 @@ func (c *PetApiController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - nameParam := r.FormValue("name") statusParam := r.FormValue("status") result, err := c.service.UpdatePetWithForm(r.Context(), petIdParam, nameParam, statusParam) @@ -240,7 +237,6 @@ func (c *PetApiController) UploadFile(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - additionalMetadataParam := r.FormValue("additionalMetadata") fileParam, err := ReadFormFileToTempFile(r, "file") diff --git a/samples/server/petstore/go-chi-server/go/api_store.go b/samples/server/petstore/go-chi-server/go/api_store.go index e3a80162b06..905450a51ff 100644 --- a/samples/server/petstore/go-chi-server/go/api_store.go +++ b/samples/server/petstore/go-chi-server/go/api_store.go @@ -76,7 +76,6 @@ func (c *StoreApiController) Routes() Routes { // DeleteOrder - Delete purchase order by ID func (c *StoreApiController) DeleteOrder(w http.ResponseWriter, r *http.Request) { orderIdParam := chi.URLParam(r, "orderId") - result, err := c.service.DeleteOrder(r.Context(), orderIdParam) // If an error occurred, encode the error with the status code if err != nil { @@ -106,7 +105,6 @@ func (c *StoreApiController) GetOrderById(w http.ResponseWriter, r *http.Request c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - result, err := c.service.GetOrderById(r.Context(), orderIdParam) // If an error occurred, encode the error with the status code if err != nil { diff --git a/samples/server/petstore/go-chi-server/go/api_user.go b/samples/server/petstore/go-chi-server/go/api_user.go index e98906d31ab..8dde5c2457b 100644 --- a/samples/server/petstore/go-chi-server/go/api_user.go +++ b/samples/server/petstore/go-chi-server/go/api_user.go @@ -169,7 +169,6 @@ func (c *UserApiController) CreateUsersWithListInput(w http.ResponseWriter, r *h // DeleteUser - Delete user func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { usernameParam := chi.URLParam(r, "username") - result, err := c.service.DeleteUser(r.Context(), usernameParam) // If an error occurred, encode the error with the status code if err != nil { @@ -183,7 +182,6 @@ func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { // GetUserByName - Get user by user name func (c *UserApiController) GetUserByName(w http.ResponseWriter, r *http.Request) { usernameParam := chi.URLParam(r, "username") - result, err := c.service.GetUserByName(r.Context(), usernameParam) // If an error occurred, encode the error with the status code if err != nil { @@ -224,7 +222,6 @@ func (c *UserApiController) LogoutUser(w http.ResponseWriter, r *http.Request) { // UpdateUser - Updated user func (c *UserApiController) UpdateUser(w http.ResponseWriter, r *http.Request) { usernameParam := chi.URLParam(r, "username") - userParam := User{} d := json.NewDecoder(r.Body) d.DisallowUnknownFields() diff --git a/samples/server/petstore/go-chi-server/go/routers.go b/samples/server/petstore/go-chi-server/go/routers.go index 01afc3d166f..fec814b0a9f 100644 --- a/samples/server/petstore/go-chi-server/go/routers.go +++ b/samples/server/petstore/go-chi-server/go/routers.go @@ -132,8 +132,8 @@ func readFileHeaderToTempFile(fileHeader *multipart.FileHeader) (*os.File, error return file, nil } -// parseInt64Parameter parses a string parameter to an int64. -func parseInt64Parameter(param string, required bool) (int64, error) { +// parseFloatParameter parses a string parameter to an int64. +func parseFloatParameter(param string, bitSize int, required bool) (float64, error) { if param == "" { if required { return 0, errors.New(errMsgRequiredMissing) @@ -142,25 +142,42 @@ func parseInt64Parameter(param string, required bool) (int64, error) { return 0, nil } - return strconv.ParseInt(param, 10, 64) + return strconv.ParseFloat(param, bitSize) +} + +// parseFloat64Parameter parses a string parameter to an float64. +func parseFloat64Parameter(param string, required bool) (float64, error) { + return parseFloatParameter(param, 64, required) +} + +// parseFloat32Parameter parses a string parameter to an float32. +func parseFloat32Parameter(param string, required bool) (float32, error) { + val, err := parseFloatParameter(param, 32, required) + return float32(val), err +} + +// parseIntParameter parses a string parameter to an int64. +func parseIntParameter(param string, bitSize int, required bool) (int64, error) { + if param == "" { + if required { + return 0, errors.New(errMsgRequiredMissing) + } + + return 0, nil + } + + return strconv.ParseInt(param, 10, bitSize) +} + +// parseInt64Parameter parses a string parameter to an int64. +func parseInt64Parameter(param string, required bool) (int64, error) { + return parseIntParameter(param, 64, required) } // parseInt32Parameter parses a string parameter to an int32. func parseInt32Parameter(param string, required bool) (int32, error) { - if param == "" { - if required { - return 0, errors.New(errMsgRequiredMissing) - } - - return 0, nil - } - - val, err := strconv.ParseInt(param, 10, 32) - if err != nil { - return -1, err - } - - return int32(val), nil + val, err := parseIntParameter(param, 32, required) + return int32(val), err } // parseBoolParameter parses a string parameter to a bool @@ -181,6 +198,55 @@ func parseBoolParameter(param string, required bool) (bool, error) { return bool(val), nil } +// parseFloat64ArrayParameter parses a string parameter containing array of values to []Float64. +func parseFloat64ArrayParameter(param, delim string, required bool) ([]float64, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + floats := make([]float64, len(str)) + + for i, s := range str { + if v, err := strconv.ParseFloat(s, 64); err != nil { + return nil, err + } else { + floats[i] = v + } + } + + return floats, nil +} + +// parseFloat32ArrayParameter parses a string parameter containing array of values to []float32. +func parseFloat32ArrayParameter(param, delim string, required bool) ([]float32, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + floats := make([]float32, len(str)) + + for i, s := range str { + if v, err := strconv.ParseFloat(s, 32); err != nil { + return nil, err + } else { + floats[i] = float32(v) + } + } + + return floats, nil +} + + // parseInt64ArrayParameter parses a string parameter containing array of values to []int64. func parseInt64ArrayParameter(param, delim string, required bool) ([]int64, error) { if param == "" { diff --git a/samples/server/petstore/go-server-required/go/api_pet.go b/samples/server/petstore/go-server-required/go/api_pet.go index 9d5b489f708..b6b9305d9df 100644 --- a/samples/server/petstore/go-server-required/go/api_pet.go +++ b/samples/server/petstore/go-server-required/go/api_pet.go @@ -123,7 +123,6 @@ func (c *PetApiController) DeletePet(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - apiKeyParam := r.Header.Get("api_key") result, err := c.service.DeletePet(r.Context(), petIdParam, apiKeyParam) // If an error occurred, encode the error with the status code @@ -171,7 +170,6 @@ func (c *PetApiController) GetPetById(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - result, err := c.service.GetPetById(r.Context(), petIdParam) // If an error occurred, encode the error with the status code if err != nil { @@ -216,7 +214,6 @@ func (c *PetApiController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - nameParam := r.FormValue("name") statusParam := r.FormValue("status") result, err := c.service.UpdatePetWithForm(r.Context(), petIdParam, nameParam, statusParam) @@ -240,7 +237,6 @@ func (c *PetApiController) UploadFile(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - additionalMetadataParam := r.FormValue("additionalMetadata") fileParam, err := ReadFormFileToTempFile(r, "file") diff --git a/samples/server/petstore/go-server-required/go/api_store.go b/samples/server/petstore/go-server-required/go/api_store.go index e3a80162b06..905450a51ff 100644 --- a/samples/server/petstore/go-server-required/go/api_store.go +++ b/samples/server/petstore/go-server-required/go/api_store.go @@ -76,7 +76,6 @@ func (c *StoreApiController) Routes() Routes { // DeleteOrder - Delete purchase order by ID func (c *StoreApiController) DeleteOrder(w http.ResponseWriter, r *http.Request) { orderIdParam := chi.URLParam(r, "orderId") - result, err := c.service.DeleteOrder(r.Context(), orderIdParam) // If an error occurred, encode the error with the status code if err != nil { @@ -106,7 +105,6 @@ func (c *StoreApiController) GetOrderById(w http.ResponseWriter, r *http.Request c.errorHandler(w, r, &ParsingError{Err: err}, nil) return } - result, err := c.service.GetOrderById(r.Context(), orderIdParam) // If an error occurred, encode the error with the status code if err != nil { diff --git a/samples/server/petstore/go-server-required/go/api_user.go b/samples/server/petstore/go-server-required/go/api_user.go index e98906d31ab..8dde5c2457b 100644 --- a/samples/server/petstore/go-server-required/go/api_user.go +++ b/samples/server/petstore/go-server-required/go/api_user.go @@ -169,7 +169,6 @@ func (c *UserApiController) CreateUsersWithListInput(w http.ResponseWriter, r *h // DeleteUser - Delete user func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { usernameParam := chi.URLParam(r, "username") - result, err := c.service.DeleteUser(r.Context(), usernameParam) // If an error occurred, encode the error with the status code if err != nil { @@ -183,7 +182,6 @@ func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { // GetUserByName - Get user by user name func (c *UserApiController) GetUserByName(w http.ResponseWriter, r *http.Request) { usernameParam := chi.URLParam(r, "username") - result, err := c.service.GetUserByName(r.Context(), usernameParam) // If an error occurred, encode the error with the status code if err != nil { @@ -224,7 +222,6 @@ func (c *UserApiController) LogoutUser(w http.ResponseWriter, r *http.Request) { // UpdateUser - Updated user func (c *UserApiController) UpdateUser(w http.ResponseWriter, r *http.Request) { usernameParam := chi.URLParam(r, "username") - userParam := User{} d := json.NewDecoder(r.Body) d.DisallowUnknownFields() diff --git a/samples/server/petstore/go-server-required/go/routers.go b/samples/server/petstore/go-server-required/go/routers.go index 01afc3d166f..fec814b0a9f 100644 --- a/samples/server/petstore/go-server-required/go/routers.go +++ b/samples/server/petstore/go-server-required/go/routers.go @@ -132,8 +132,8 @@ func readFileHeaderToTempFile(fileHeader *multipart.FileHeader) (*os.File, error return file, nil } -// parseInt64Parameter parses a string parameter to an int64. -func parseInt64Parameter(param string, required bool) (int64, error) { +// parseFloatParameter parses a string parameter to an int64. +func parseFloatParameter(param string, bitSize int, required bool) (float64, error) { if param == "" { if required { return 0, errors.New(errMsgRequiredMissing) @@ -142,25 +142,42 @@ func parseInt64Parameter(param string, required bool) (int64, error) { return 0, nil } - return strconv.ParseInt(param, 10, 64) + return strconv.ParseFloat(param, bitSize) +} + +// parseFloat64Parameter parses a string parameter to an float64. +func parseFloat64Parameter(param string, required bool) (float64, error) { + return parseFloatParameter(param, 64, required) +} + +// parseFloat32Parameter parses a string parameter to an float32. +func parseFloat32Parameter(param string, required bool) (float32, error) { + val, err := parseFloatParameter(param, 32, required) + return float32(val), err +} + +// parseIntParameter parses a string parameter to an int64. +func parseIntParameter(param string, bitSize int, required bool) (int64, error) { + if param == "" { + if required { + return 0, errors.New(errMsgRequiredMissing) + } + + return 0, nil + } + + return strconv.ParseInt(param, 10, bitSize) +} + +// parseInt64Parameter parses a string parameter to an int64. +func parseInt64Parameter(param string, required bool) (int64, error) { + return parseIntParameter(param, 64, required) } // parseInt32Parameter parses a string parameter to an int32. func parseInt32Parameter(param string, required bool) (int32, error) { - if param == "" { - if required { - return 0, errors.New(errMsgRequiredMissing) - } - - return 0, nil - } - - val, err := strconv.ParseInt(param, 10, 32) - if err != nil { - return -1, err - } - - return int32(val), nil + val, err := parseIntParameter(param, 32, required) + return int32(val), err } // parseBoolParameter parses a string parameter to a bool @@ -181,6 +198,55 @@ func parseBoolParameter(param string, required bool) (bool, error) { return bool(val), nil } +// parseFloat64ArrayParameter parses a string parameter containing array of values to []Float64. +func parseFloat64ArrayParameter(param, delim string, required bool) ([]float64, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + floats := make([]float64, len(str)) + + for i, s := range str { + if v, err := strconv.ParseFloat(s, 64); err != nil { + return nil, err + } else { + floats[i] = v + } + } + + return floats, nil +} + +// parseFloat32ArrayParameter parses a string parameter containing array of values to []float32. +func parseFloat32ArrayParameter(param, delim string, required bool) ([]float32, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + floats := make([]float32, len(str)) + + for i, s := range str { + if v, err := strconv.ParseFloat(s, 32); err != nil { + return nil, err + } else { + floats[i] = float32(v) + } + } + + return floats, nil +} + + // parseInt64ArrayParameter parses a string parameter containing array of values to []int64. func parseInt64ArrayParameter(param, delim string, required bool) ([]int64, error) { if param == "" { diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java index 72502d0f0e2..5fe001a360f 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java @@ -30,11 +30,9 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class Category { - @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; - @JsonProperty("name") @JacksonXmlProperty(localName = "name") private String name; @@ -49,6 +47,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -68,6 +67,7 @@ public class Category { */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java index d7fd8f87d92..37ee933d127 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -32,15 +32,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class ModelApiResponse { - @JsonProperty("code") @JacksonXmlProperty(localName = "code") private Integer code; - @JsonProperty("type") @JacksonXmlProperty(localName = "type") private String type; - @JsonProperty("message") @JacksonXmlProperty(localName = "message") private String message; @@ -55,6 +52,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -74,6 +72,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -93,6 +92,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java index a2507752ed0..19cc6ec9bf5 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java @@ -33,19 +33,15 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class Order { - @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; - @JsonProperty("petId") @JacksonXmlProperty(localName = "petId") private Long petId; - @JsonProperty("quantity") @JacksonXmlProperty(localName = "quantity") private Integer quantity; - @JsonProperty("shipDate") @JacksonXmlProperty(localName = "shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Date shipDate; @@ -87,11 +83,9 @@ public class Order { } } - @JsonProperty("status") @JacksonXmlProperty(localName = "status") private StatusEnum status; - @JsonProperty("complete") @JacksonXmlProperty(localName = "complete") private Boolean complete = false; @@ -106,6 +100,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -125,6 +120,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -144,6 +140,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -163,6 +160,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public Date getShipDate() { return shipDate; } @@ -182,6 +180,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -201,6 +200,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java index bcdc28b161b..410419edbaa 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java @@ -35,27 +35,22 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class Pet { - @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; - @JsonProperty("category") @JacksonXmlProperty(localName = "category") private Category category; - @JsonProperty("name") @JacksonXmlProperty(localName = "name") private String name; - @JsonProperty("photoUrls") @JacksonXmlProperty(localName = "photoUrl") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @JacksonXmlProperty(localName = "tag") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -94,7 +89,6 @@ public class Pet { } } - @JsonProperty("status") @JacksonXmlProperty(localName = "status") private StatusEnum status; @@ -126,6 +120,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -145,6 +140,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -164,6 +160,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -178,6 +175,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -188,6 +188,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -215,6 +216,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -234,6 +236,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java index e841695b5e0..f2c6219aeb8 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java @@ -30,11 +30,9 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class Tag { - @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; - @JsonProperty("name") @JacksonXmlProperty(localName = "name") private String name; @@ -49,6 +47,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -68,6 +67,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java index 5a2a1168ea8..94ac8583434 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java @@ -30,35 +30,27 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class User { - @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; - @JsonProperty("username") @JacksonXmlProperty(localName = "username") private String username; - @JsonProperty("firstName") @JacksonXmlProperty(localName = "firstName") private String firstName; - @JsonProperty("lastName") @JacksonXmlProperty(localName = "lastName") private String lastName; - @JsonProperty("email") @JacksonXmlProperty(localName = "email") private String email; - @JsonProperty("password") @JacksonXmlProperty(localName = "password") private String password; - @JsonProperty("phone") @JacksonXmlProperty(localName = "phone") private String phone; - @JsonProperty("userStatus") @JacksonXmlProperty(localName = "userStatus") private Integer userStatus; @@ -73,6 +65,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -92,6 +85,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -111,6 +105,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -130,6 +125,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -149,6 +145,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -168,6 +165,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -187,6 +185,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -206,6 +205,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java index c6f0778d346..40e102a9cb3 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -12,6 +12,8 @@ package org.openapitools.server.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.server.model.SingleRefType; import jakarta.validation.constraints.*; import jakarta.validation.Valid; diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java index da9c02ed0c3..3a90afbad85 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java @@ -15,8 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Cat; -import org.openapitools.server.model.Dog; import jakarta.validation.constraints.*; import jakarta.validation.Valid; diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml index 6667e32d34c..5c0bc517dac 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml @@ -1507,6 +1507,9 @@ components: - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' propertyName: className properties: className: diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java index b40d9201c0e..cdf67cc9aa4 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -1,5 +1,7 @@ package org.openapitools.server.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.server.model.SingleRefType; diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java index 72fd34477f8..1aa44d00204 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java @@ -3,8 +3,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Cat; -import org.openapitools.server.model.Dog; diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java index 5ba378a4203..5a69a913b27 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java @@ -8,7 +8,7 @@ import java.util.List; public class ArrayOfArrayOfNumberOnly { - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; /** * Default constructor. diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java index 05e4cfc0700..40e72b6f2d8 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java @@ -8,7 +8,7 @@ import java.util.List; public class ArrayOfNumberOnly { - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; /** * Default constructor. diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java index f7eeaade3fa..b2d045b68b2 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java @@ -8,9 +8,9 @@ import org.openapitools.server.model.ReadOnlyFirst; public class ArrayTest { - private List arrayOfString = new ArrayList<>(); - private List> arrayArrayOfInteger = new ArrayList<>(); - private List> arrayArrayOfModel = new ArrayList<>(); + private List arrayOfString; + private List> arrayArrayOfInteger; + private List> arrayArrayOfModel; /** * Default constructor. diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java index d7f30e7d963..e9e4daaecc8 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java @@ -84,7 +84,7 @@ public class EnumArrays { } - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; /** * Default constructor. diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java index 1730307fb6d..5093257b24c 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java @@ -9,7 +9,7 @@ import org.openapitools.server.model.ModelFile; public class FileSchemaTestClass { private ModelFile _file; - private List files = new ArrayList<>(); + private List files; /** * Default constructor. diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java index 59ce4a39d4f..735e3b307ca 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java @@ -21,7 +21,7 @@ public class NullableClass extends HashMap { private OffsetDateTime datetimeProp; private List arrayNullableProp; private List arrayAndItemsNullableProp; - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; private Map objectNullableProp; private Map objectAndItemsNullableProp; private Map objectItemsNullable = new HashMap<>(); diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java index 57ee9e374e2..4dfe7668003 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java @@ -12,7 +12,7 @@ public class ObjectWithDeprecatedFields { private String uuid; private BigDecimal id; private DeprecatedObject deprecatedRef; - private List bars = new ArrayList<>(); + private List bars; /** * Default constructor. diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java index a040a9d288b..912a250f075 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java @@ -18,7 +18,7 @@ public class Pet { private Category category; private String name; private Set photoUrls = new LinkedHashSet<>(); - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml index 6667e32d34c..5c0bc517dac 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml @@ -1507,6 +1507,9 @@ components: - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' propertyName: className properties: className: diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java index 1de389611a7..9576dcd6e26 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java @@ -130,3 +130,4 @@ public class Category { } } + diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java index 91ecfafb30e..44d45d6d275 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -159,3 +159,4 @@ public class ModelApiResponse { } } + diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java index f759446ae7c..8cb7e05b1a2 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java @@ -282,3 +282,4 @@ public class Order { } } + diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java index 1ce739e5bec..11da25fbd87 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java @@ -299,3 +299,4 @@ public class Pet { } } + diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java index fe4dd0f4676..7f1a13a0d93 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java @@ -129,3 +129,4 @@ public class Tag { } } + diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java index e1e76dd010f..1f63c57007d 100644 --- a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java @@ -303,3 +303,4 @@ public class User { } } + diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 97fe7e6c187..bc9d242b3d8 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -24,7 +24,7 @@ public class ArrayOfArrayOfNumberOnly { public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); + this.arrayArrayNumber = ; } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index ae571a3d226..e4a25016b00 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -24,7 +24,7 @@ public class ArrayOfNumberOnly { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); + this.arrayNumber = ; } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayTest.java index d16008230a2..ab30aa4a984 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ArrayTest.java @@ -30,7 +30,7 @@ public class ArrayTest { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); + this.arrayOfString = ; } this.arrayOfString.add(arrayOfStringItem); return this; @@ -56,7 +56,7 @@ public class ArrayTest { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); + this.arrayArrayOfInteger = ; } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -82,7 +82,7 @@ public class ArrayTest { public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); + this.arrayArrayOfModel = ; } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumArrays.java index 0fa1c622d1a..db979d44f73 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumArrays.java @@ -107,7 +107,7 @@ public class EnumArrays { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); + this.arrayEnum = ; } this.arrayEnum.add(arrayEnumItem); return this; 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 cd8b2ebb7a7..5ddf74ec036 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 @@ -45,7 +45,7 @@ public class FileSchemaTestClass { public FileSchemaTestClass addFilesItem(ModelFile filesItem) { if (this.files == null) { - this.files = new ArrayList<>(); + this.files = ; } this.files.add(filesItem); return this; 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 865097fcdab..a398e2eae4d 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 @@ -155,7 +155,7 @@ public class Pet { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList<>(); + this.tags = ; } this.tags.add(tagsItem); return this; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/XmlItem.java index bd878a2a8bc..c2fe7aea473 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/XmlItem.java @@ -180,7 +180,7 @@ public class XmlItem { public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); + this.wrappedArray = ; } this.wrappedArray.add(wrappedArrayItem); return this; @@ -278,7 +278,7 @@ public class XmlItem { public XmlItem addNameArrayItem(Integer nameArrayItem) { if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); + this.nameArray = ; } this.nameArray.add(nameArrayItem); return this; @@ -304,7 +304,7 @@ public class XmlItem { public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); + this.nameWrappedArray = ; } this.nameWrappedArray.add(nameWrappedArrayItem); return this; @@ -402,7 +402,7 @@ public class XmlItem { public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); + this.prefixArray = ; } this.prefixArray.add(prefixArrayItem); return this; @@ -428,7 +428,7 @@ public class XmlItem { public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); + this.prefixWrappedArray = ; } this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; @@ -526,7 +526,7 @@ public class XmlItem { public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); + this.namespaceArray = ; } this.namespaceArray.add(namespaceArrayItem); return this; @@ -552,7 +552,7 @@ public class XmlItem { public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); + this.namespaceWrappedArray = ; } this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; @@ -650,7 +650,7 @@ public class XmlItem { public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); + this.prefixNsArray = ; } this.prefixNsArray.add(prefixNsArrayItem); return this; @@ -676,7 +676,7 @@ public class XmlItem { public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); + this.prefixNsWrappedArray = ; } this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; 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 4699f7235ed..acf85977ade 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 @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } 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 4699f7235ed..acf85977ade 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 @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } 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 4699f7235ed..acf85977ade 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 @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints-with-security/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-fake-endpoints-with-security/app/apimodels/Pet.java index 4699f7235ed..acf85977ade 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints-with-security/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints-with-security/app/apimodels/Pet.java @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java index ba9e0d9bf44..d8c0d60adc3 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java @@ -25,10 +25,10 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (arrayArrayNumber == null) { - arrayArrayNumber = new ArrayList<>(); + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); } - arrayArrayNumber.add(arrayArrayNumberItem); + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java index bca0376c0e5..82edd75916c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java @@ -25,10 +25,10 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (arrayNumber == null) { - arrayNumber = new ArrayList<>(); + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); } - arrayNumber.add(arrayNumberItem); + this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java index d9701181453..dd656c8b417 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java @@ -34,10 +34,10 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (arrayOfString == null) { - arrayOfString = new ArrayList<>(); + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); } - arrayOfString.add(arrayOfStringItem); + this.arrayOfString.add(arrayOfStringItem); return this; } @@ -59,10 +59,10 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (arrayArrayOfInteger == null) { - arrayArrayOfInteger = new ArrayList<>(); + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); } - arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -84,10 +84,10 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (arrayArrayOfModel == null) { - arrayArrayOfModel = new ArrayList<>(); + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); } - arrayArrayOfModel.add(arrayArrayOfModelItem); + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } 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 149ca53994d..08d51636d53 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 @@ -106,10 +106,10 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (arrayEnum == null) { - arrayEnum = new ArrayList<>(); + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); } - arrayEnum.add(arrayEnumItem); + this.arrayEnum.add(arrayEnumItem); return this; } 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 4d3fd25cbed..ba2929116d4 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 @@ -47,10 +47,10 @@ public class FileSchemaTestClass { } public FileSchemaTestClass addFilesItem(ModelFile filesItem) { - if (files == null) { - files = new ArrayList<>(); + if (this.files == null) { + this.files = new ArrayList<>(); } - files.add(filesItem); + this.files.add(filesItem); return this; } 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 6f748228b87..2ad90fc26fa 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 @@ -136,7 +136,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -159,10 +162,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } 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 index a8e52c7bfe5..f810a7b3bf7 100644 --- 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 @@ -114,7 +114,10 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - arrayItem.add(arrayItemItem); + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } + this.arrayItem.add(arrayItemItem); return this; } 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 index 7295c42a7b3..d00bd542652 100644 --- 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 @@ -136,7 +136,10 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - arrayItem.add(arrayItemItem); + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } + this.arrayItem.add(arrayItemItem); return this; } 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 index 114918e3cf9..83a4227b611 100644 --- 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 @@ -209,10 +209,10 @@ public class XmlItem { } public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (wrappedArray == null) { - wrappedArray = new ArrayList<>(); + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList<>(); } - wrappedArray.add(wrappedArrayItem); + this.wrappedArray.add(wrappedArrayItem); return this; } @@ -302,10 +302,10 @@ public class XmlItem { } public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (nameArray == null) { - nameArray = new ArrayList<>(); + if (this.nameArray == null) { + this.nameArray = new ArrayList<>(); } - nameArray.add(nameArrayItem); + this.nameArray.add(nameArrayItem); return this; } @@ -327,10 +327,10 @@ public class XmlItem { } public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (nameWrappedArray == null) { - nameWrappedArray = new ArrayList<>(); + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList<>(); } - nameWrappedArray.add(nameWrappedArrayItem); + this.nameWrappedArray.add(nameWrappedArrayItem); return this; } @@ -420,10 +420,10 @@ public class XmlItem { } public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (prefixArray == null) { - prefixArray = new ArrayList<>(); + if (this.prefixArray == null) { + this.prefixArray = new ArrayList<>(); } - prefixArray.add(prefixArrayItem); + this.prefixArray.add(prefixArrayItem); return this; } @@ -445,10 +445,10 @@ public class XmlItem { } public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (prefixWrappedArray == null) { - prefixWrappedArray = new ArrayList<>(); + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList<>(); } - prefixWrappedArray.add(prefixWrappedArrayItem); + this.prefixWrappedArray.add(prefixWrappedArrayItem); return this; } @@ -538,10 +538,10 @@ public class XmlItem { } public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (namespaceArray == null) { - namespaceArray = new ArrayList<>(); + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList<>(); } - namespaceArray.add(namespaceArrayItem); + this.namespaceArray.add(namespaceArrayItem); return this; } @@ -563,10 +563,10 @@ public class XmlItem { } public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (namespaceWrappedArray == null) { - namespaceWrappedArray = new ArrayList<>(); + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList<>(); } - namespaceWrappedArray.add(namespaceWrappedArrayItem); + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); return this; } @@ -656,10 +656,10 @@ public class XmlItem { } public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (prefixNsArray == null) { - prefixNsArray = new ArrayList<>(); + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList<>(); } - prefixNsArray.add(prefixNsArrayItem); + this.prefixNsArray.add(prefixNsArrayItem); return this; } @@ -681,10 +681,10 @@ public class XmlItem { } public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (prefixNsWrappedArray == null) { - prefixNsWrappedArray = new ArrayList<>(); + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList<>(); } - prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); return this; } 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 d9c93499fb7..a518e2cf03a 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 @@ -122,7 +122,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -144,10 +147,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } 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 4699f7235ed..acf85977ade 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 @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } 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 4699f7235ed..acf85977ade 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 @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Pet.java index 4699f7235ed..acf85977ade 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Pet.java @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } 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 4699f7235ed..acf85977ade 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 @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } 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 4699f7235ed..acf85977ade 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 @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } 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 4699f7235ed..acf85977ade 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -133,7 +133,10 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - photoUrls.add(photoUrlsItem); + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); return this; } @@ -155,10 +158,10 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { - if (tags == null) { - tags = new ArrayList<>(); + if (this.tags == null) { + this.tags = new ArrayList<>(); } - tags.add(tagsItem); + this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java index d135549db32..1f8d53d1ad9 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java @@ -539,10 +539,10 @@ public interface PathHandlerInterface { *

    Response headers: [CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ "type" : "integer", "format" : "int32" -}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ "type" : "string", "format" : "date-time" -}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null}]

    +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null}]

    * *

    Produces: [{mediaType=application/xml}, {mediaType=application/json}]

    *

    Returns: {@link String}

    diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java index d23ea9785fd..8d2ad25b0d8 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java @@ -35,7 +35,7 @@ public class Pet { private Category category; private String name; private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; public enum StatusEnum { diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/model/Pet.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/model/Pet.java index f53e6d08e82..59541f0cfb9 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/model/Pet.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/model/Pet.java @@ -19,7 +19,7 @@ public class Pet { private Category category; private String name; private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; public enum StatusEnum { 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 17d06d2f2bf..19ae5e46ed9 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 @@ -36,7 +36,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private List tags = new ArrayList<>(); + private List tags; public enum StatusEnum { diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/FILES b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/FILES index c5c0a5f4ba9..27729fb0331 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/FILES @@ -3,6 +3,8 @@ src/gen/java/org/openapitools/api/PetApi.java src/gen/java/org/openapitools/api/PetApiService.java src/gen/java/org/openapitools/api/StoreApi.java src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/TestApi.java +src/gen/java/org/openapitools/api/TestApiService.java src/gen/java/org/openapitools/api/UserApi.java src/gen/java/org/openapitools/api/UserApiService.java src/gen/java/org/openapitools/model/Category.java @@ -14,5 +16,6 @@ src/gen/java/org/openapitools/model/User.java src/main/java/org/openapitools/api/RestApplication.java src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/TestApiServiceImpl.java src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java src/main/webapp/WEB-INF/beans.xml diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApi.java index 57c63b56395..879c2f79431 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.openapitools.api.PetApiService; @@ -40,16 +39,17 @@ public class PetApi { @POST @Consumes({ "application/json", "application/xml" }) - - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Add a new pet to the store", notes = "", response = Pet.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.addPet(body, securityContext); + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet) { + return delegate.addPet(pet, securityContext); } @DELETE @@ -76,7 +76,6 @@ public class PetApi { @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { @@ -93,7 +92,6 @@ public class PetApi { @SuppressWarnings("deprecation") @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { @@ -122,18 +120,19 @@ public class PetApi { @PUT @Consumes({ "application/json", "application/xml" }) - - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Update an existing pet", notes = "", response = Pet.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.updatePet(body, securityContext); + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet) { + return delegate.updatePet(pet, securityContext); } @POST diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApiService.java index cd8754bc876..4767577be24 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/PetApiService.java @@ -6,7 +6,6 @@ import org.openapitools.model.*; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; @@ -19,12 +18,12 @@ import javax.ws.rs.core.SecurityContext; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen") public interface PetApiService { - public Response addPet(Pet body, SecurityContext securityContext); + public Response addPet(Pet pet, SecurityContext securityContext); public Response deletePet(Long petId, SecurityContext securityContext); public Response findPetsByStatus(List status, SecurityContext securityContext); @Deprecated public Response findPetsByTags(List tags, SecurityContext securityContext); public Response getPetById(Long petId, SecurityContext securityContext); - public Response updatePet(Pet body, SecurityContext securityContext); + public Response updatePet(Pet pet, SecurityContext securityContext); public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext); public Response uploadFile(Long petId, String additionalMetadata, InputStream _fileInputStream, Attachment _fileDetail, SecurityContext securityContext); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/StoreApi.java index 40870e41c75..ea889006e69 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/StoreApi.java @@ -77,13 +77,13 @@ public class StoreApi { @POST @Path("/order") - + @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body) { - return delegate.placeOrder(body, securityContext); + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order) { + return delegate.placeOrder(order, securityContext); } } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/StoreApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/StoreApiService.java index 3135d74bb98..e8c6f2e2ad0 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/StoreApiService.java @@ -21,5 +21,5 @@ public interface StoreApiService { public Response deleteOrder(String orderId, SecurityContext securityContext); public Response getInventory(SecurityContext securityContext); public Response getOrderById(Long orderId, SecurityContext securityContext); - public Response placeOrder(Order body, SecurityContext securityContext); + public Response placeOrder(Order order, SecurityContext securityContext); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/TestApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/TestApi.java new file mode 100644 index 00000000000..be772166c1c --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/TestApi.java @@ -0,0 +1,47 @@ +package org.openapitools.api; + +import org.openapitools.api.TestApiService; + +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; + +import io.swagger.annotations.*; +import java.io.InputStream; + +import org.apache.cxf.jaxrs.ext.PATCH; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; + +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +@Path("/test/upload") +@RequestScoped + +@Api(description = "the test API") + + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen") + +public class TestApi { + + @Context SecurityContext securityContext; + + @Inject TestApiService delegate; + + + @POST + + @Consumes({ "application/octet-stream" }) + + @ApiOperation(value = "test upload", notes = "upload test", response = Void.class, tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "whatever", response = Void.class) }) + public Response testUpload(@ApiParam(value = "" ) java.io.InputStream body) { + return delegate.testUpload(body, securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/TestApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/TestApiService.java new file mode 100644 index 00000000000..a350d5be4bf --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/TestApiService.java @@ -0,0 +1,20 @@ +package org.openapitools.api; + +import org.openapitools.api.*; +import org.openapitools.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; + + +import java.util.List; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen") +public interface TestApiService { + public Response testUpload(java.io.InputStream body, SecurityContext securityContext); +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/UserApi.java index 285f6835da5..63b3497ab1b 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/UserApi.java @@ -38,42 +38,54 @@ public class UserApi { @POST + @Consumes({ "application/json" }) - - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, authorizations = { + + @Authorization(value = "api_key") + }, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { - return delegate.createUser(body, securityContext); + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user) { + return delegate.createUser(user, securityContext); } @POST @Path("/createWithArray") + @Consumes({ "application/json" }) - - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, authorizations = { + + @Authorization(value = "api_key") + }, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { - return delegate.createUsersWithArrayInput(body, securityContext); + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List user) { + return delegate.createUsersWithArrayInput(user, securityContext); } @POST @Path("/createWithList") + @Consumes({ "application/json" }) - - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, authorizations = { + + @Authorization(value = "api_key") + }, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { - return delegate.createUsersWithListInput(body, securityContext); + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List user) { + return delegate.createUsersWithListInput(user, securityContext); } @DELETE @Path("/{username}") - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, authorizations = { + + @Authorization(value = "api_key") + }, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @@ -102,7 +114,7 @@ public class UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) - public Response loginUser( @NotNull @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username, @NotNull @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password) { + public Response loginUser( @NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")@ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username, @NotNull @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password) { return delegate.loginUser(username, password, securityContext); } @@ -110,7 +122,10 @@ public class UserApi { @Path("/logout") - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user" }) + @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, authorizations = { + + @Authorization(value = "api_key") + }, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser() { @@ -119,13 +134,16 @@ public class UserApi { @PUT @Path("/{username}") + @Consumes({ "application/json" }) - - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, authorizations = { + + @Authorization(value = "api_key") + }, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body) { - return delegate.updateUser(username, body, securityContext); + public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User user) { + return delegate.updateUser(username, user, securityContext); } } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/UserApiService.java index b9f3090de81..f8eba8accd7 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/api/UserApiService.java @@ -18,12 +18,12 @@ import javax.ws.rs.core.SecurityContext; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen") public interface UserApiService { - public Response createUser(User body, SecurityContext securityContext); - public Response createUsersWithArrayInput(List body, SecurityContext securityContext); - public Response createUsersWithListInput(List body, SecurityContext securityContext); + public Response createUser(User user, SecurityContext securityContext); + public Response createUsersWithArrayInput(List user, SecurityContext securityContext); + public Response createUsersWithListInput(List user, SecurityContext securityContext); public Response deleteUser(String username, SecurityContext securityContext); public Response getUserByName(String username, SecurityContext securityContext); public Response loginUser(String username, String password, SecurityContext securityContext); public Response logoutUser(SecurityContext securityContext); - public Response updateUser(String username, User body, SecurityContext securityContext); + public Response updateUser(String username, User user, SecurityContext securityContext); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Category.java index 8dc256b2c0e..752df95b657 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/org/openapitools/model/Category.java @@ -49,7 +49,7 @@ public class Category { @ApiModelProperty(value = "") @JsonProperty("name") - public String getName() { + @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") public String getName() { return name; } public void setName(String name) { 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 f67832b43e2..6dd16d028da 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 @@ -29,7 +29,7 @@ public class Pet { private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; public enum StatusEnum { @@ -138,6 +138,9 @@ public enum StatusEnum { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index ad4a6518971..687f684ffb7 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -5,7 +5,6 @@ import org.openapitools.model.*; import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; @@ -21,7 +20,7 @@ import javax.ws.rs.core.SecurityContext; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen") public class PetApiServiceImpl implements PetApiService { @Override - public Response addPet(Pet body, SecurityContext securityContext) { + public Response addPet(Pet pet, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } @@ -46,7 +45,7 @@ public class PetApiServiceImpl implements PetApiService { return Response.ok().entity("magic!").build(); } @Override - public Response updatePet(Pet body, SecurityContext securityContext) { + public Response updatePet(Pet pet, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 50ea94a966c..3fd4ebe823e 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -35,7 +35,7 @@ public class StoreApiServiceImpl implements StoreApiService { return Response.ok().entity("magic!").build(); } @Override - public Response placeOrder(Order body, SecurityContext securityContext) { + public Response placeOrder(Order order, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/TestApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/TestApiServiceImpl.java new file mode 100644 index 00000000000..5b8432c4717 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/TestApiServiceImpl.java @@ -0,0 +1,25 @@ +package org.openapitools.api.impl; + +import org.openapitools.api.*; +import org.openapitools.model.*; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; + + +import java.util.List; + +import java.io.InputStream; + +import javax.enterprise.context.RequestScoped; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@RequestScoped +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen") +public class TestApiServiceImpl implements TestApiService { + @Override + public Response testUpload(java.io.InputStream body, SecurityContext securityContext) { + // do some magic! + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 3f534768c3e..eeb96d4cf30 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -20,17 +20,17 @@ import javax.ws.rs.core.SecurityContext; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen") public class UserApiServiceImpl implements UserApiService { @Override - public Response createUser(User body, SecurityContext securityContext) { + public Response createUser(User user, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } @Override - public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { + public Response createUsersWithArrayInput(List user, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } @Override - public Response createUsersWithListInput(List body, SecurityContext securityContext) { + public Response createUsersWithListInput(List user, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } @@ -55,7 +55,7 @@ public class UserApiServiceImpl implements UserApiService { return Response.ok().entity("magic!").build(); } @Override - public Response updateUser(String username, User body, SecurityContext securityContext) { + public Response updateUser(String username, User user, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } 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 17d06d2f2bf..19ae5e46ed9 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 @@ -36,7 +36,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private List tags = new ArrayList<>(); + private List tags; public enum StatusEnum { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 669dec7ae65..4c27256f345 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,7 +15,7 @@ public class ArrayOfArrayOfNumberOnly { @ApiModelProperty(value = "") @Valid - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; /** * Get arrayArrayNumber * @return arrayArrayNumber diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 3697fdb4a11..77d96a2f8ec 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,7 +15,7 @@ public class ArrayOfNumberOnly { @ApiModelProperty(value = "") @Valid - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; /** * Get arrayNumber * @return arrayNumber diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayTest.java index 65894570595..649ef413aa9 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/ArrayTest.java @@ -14,15 +14,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class ArrayTest { @ApiModelProperty(value = "") - private List arrayOfString = new ArrayList<>(); + private List arrayOfString; @ApiModelProperty(value = "") @Valid - private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfInteger; @ApiModelProperty(value = "") @Valid - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel; /** * Get arrayOfString * @return arrayOfString diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumArrays.java index 995ce277af4..e284d5e80c4 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumArrays.java @@ -82,7 +82,7 @@ FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); } @ApiModelProperty(value = "") - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; /** * Get justSymbol * @return justSymbol 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 8c2212241a5..a9a0a88a9ee 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 List files = new ArrayList<>(); + private List files; /** * Get _file * @return _file 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 6ad22f12e0a..3464ea47337 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 @@ -34,7 +34,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private List tags = new ArrayList<>(); + private List tags; public enum StatusEnum { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/XmlItem.java index 25d74468143..718e9a0e9cc 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/XmlItem.java @@ -27,7 +27,7 @@ public class XmlItem { private Boolean attributeBoolean; @ApiModelProperty(value = "") - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; @ApiModelProperty(example = "string", value = "") private String nameString; @@ -43,10 +43,10 @@ public class XmlItem { private Boolean nameBoolean; @ApiModelProperty(value = "") - private List nameArray = new ArrayList<>(); + private List nameArray; @ApiModelProperty(value = "") - private List nameWrappedArray = new ArrayList<>(); + private List nameWrappedArray; @ApiModelProperty(example = "string", value = "") private String prefixString; @@ -62,10 +62,10 @@ public class XmlItem { private Boolean prefixBoolean; @ApiModelProperty(value = "") - private List prefixArray = new ArrayList<>(); + private List prefixArray; @ApiModelProperty(value = "") - private List prefixWrappedArray = new ArrayList<>(); + private List prefixWrappedArray; @ApiModelProperty(example = "string", value = "") private String namespaceString; @@ -81,10 +81,10 @@ public class XmlItem { private Boolean namespaceBoolean; @ApiModelProperty(value = "") - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; @ApiModelProperty(value = "") - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceWrappedArray; @ApiModelProperty(example = "string", value = "") private String prefixNsString; @@ -100,10 +100,10 @@ public class XmlItem { private Boolean prefixNsBoolean; @ApiModelProperty(value = "") - private List prefixNsArray = new ArrayList<>(); + private List prefixNsArray; @ApiModelProperty(value = "") - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsWrappedArray; /** * Get attributeString * @return attributeString 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 a4dfad876ea..97a679423ce 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 @@ -36,7 +36,7 @@ import javax.validation.Valid; public class ArrayOfArrayOfNumberOnly implements Serializable { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = 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 0f00999bd0f..44c5ef7970c 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 @@ -36,7 +36,7 @@ import javax.validation.Valid; public class ArrayOfNumberOnly implements Serializable { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = 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 63100732223..26cf12e9966 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 @@ -38,15 +38,15 @@ import javax.validation.Valid; public class ArrayTest implements Serializable { 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; 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; 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; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; 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 0b6abc5653c..45cb342d372 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 @@ -103,7 +103,7 @@ public class EnumArrays implements Serializable { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; 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 198d7fcd555..e693b505ea8 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 @@ -41,7 +41,7 @@ public class FileSchemaTestClass implements Serializable { public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass _file(ModelFile _file) { this._file = _file; 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 21b03a8da57..e0b56aa4ff3 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 @@ -62,7 +62,7 @@ public class Pet implements Serializable { public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -167,6 +167,9 @@ public class Pet implements Serializable { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 720e0a27c9d..2ae30990bf7 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 @@ -144,6 +144,9 @@ public class TypeHolderDefault implements Serializable { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 57cf91bccba..95a2809de67 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 @@ -169,6 +169,9 @@ public class TypeHolderExample implements Serializable { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 c8e846fa69c..93a3b09037b 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 @@ -80,7 +80,7 @@ public class XmlItem implements Serializable { public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; @JsonProperty(JSON_PROPERTY_NAME_STRING) @@ -100,11 +100,11 @@ public class XmlItem implements Serializable { public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray; 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; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @@ -124,11 +124,11 @@ public class XmlItem implements Serializable { public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray; 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; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @@ -148,11 +148,11 @@ public class XmlItem implements Serializable { public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; 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; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @@ -172,11 +172,11 @@ public class XmlItem implements Serializable { 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; 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; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java index fb68166b6b2..443173966fe 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java @@ -16,6 +16,7 @@ package org.openapitools.model; import java.util.Objects; import com.fasterxml.jackson.annotation.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.model.SingleRefType; 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 a5eae51787c..fe6a3f7e694 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 @@ -34,8 +34,8 @@ import javax.validation.Valid; }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), }) public class Animal { 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 982c0e87703..534c0f707fe 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = 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 c33312433c5..bd8b3b164a1 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = 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 3381f49a5c5..03921a0b1a9 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 @@ -37,15 +37,15 @@ import javax.validation.Valid; 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; 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; 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; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; 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 5238609546f..b1efc16e9b8 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 @@ -102,7 +102,7 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; 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 5a3eec069e8..d4f56663eb1 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 @@ -40,7 +40,7 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass _file(ModelFile _file) { this._file = _file; 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 bc77e28037b..18d86f5d66d 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 @@ -81,7 +81,7 @@ public class NullableClass extends HashMap { public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) - private List arrayItemsNullable = new ArrayList<>(); + private List arrayItemsNullable; public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java index 001ace864cc..23057859ff5 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java @@ -51,7 +51,7 @@ public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_BARS = "bars"; @JsonProperty(JSON_PROPERTY_BARS) - private List bars = new ArrayList<>(); + private List bars; public ObjectWithDeprecatedFields uuid(String uuid) { this.uuid = uuid; 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 70f15b649a2..7965fd1a1c7 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 @@ -61,7 +61,7 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 73788837d0f..8d78c7a0702 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 @@ -21,7 +21,7 @@ public class Pet { private Category category; private String name; private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store 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 c9630f0c3c6..21d5fc9c445 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 @@ -21,7 +21,7 @@ public class Pet { private Category category; private String name; private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store 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 c9630f0c3c6..21d5fc9c445 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 @@ -21,7 +21,7 @@ public class Pet { private Category category; private String name; private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store 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 c9630f0c3c6..21d5fc9c445 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 @@ -21,7 +21,7 @@ public class Pet { private Category category; private String name; private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Pet.java index 73788837d0f..8d78c7a0702 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/model/Pet.java @@ -21,7 +21,7 @@ public class Pet { private Category category; private String name; private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store 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 73788837d0f..8d78c7a0702 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 @@ -21,7 +21,7 @@ public class Pet { private Category category; private String name; private List photoUrls = new ArrayList<>(); - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index dd5644f5d6f..f959768e493 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayOfArrayOfNumberOnly implements Serializable { - private @Valid List> arrayArrayNumber = new ArrayList<>(); + private @Valid List> arrayArrayNumber; /** **/ diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index fe540ffc356..61cecebd9b1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayOfNumberOnly implements Serializable { - private @Valid List arrayNumber = new ArrayList<>(); + private @Valid List arrayNumber; /** **/ diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java index af4c73dc1fe..c3f4ac36c5e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayTest implements Serializable { - private @Valid List arrayOfString = new ArrayList<>(); - private @Valid List> arrayArrayOfInteger = new ArrayList<>(); - private @Valid List> arrayArrayOfModel = new ArrayList<>(); + private @Valid List arrayOfString; + private @Valid List> arrayArrayOfInteger; + private @Valid List> arrayArrayOfModel; /** **/ diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java index dd5505d4346..e41f8e12e89 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java @@ -115,7 +115,7 @@ public class EnumArrays implements Serializable { } } - private @Valid List arrayEnum = new ArrayList<>(); + private @Valid List arrayEnum; /** **/ 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 9f798356573..58811705828 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 @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class FileSchemaTestClass implements Serializable { private @Valid ModelFile _file; - private @Valid List files = new ArrayList<>(); + private @Valid List files; /** **/ 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 9b3d5c1f46e..aae498ed146 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 @@ -29,7 +29,7 @@ public class Pet implements Serializable { private @Valid Category category; private @Valid String name; private @Valid Set photoUrls = new LinkedHashSet<>(); - private @Valid List tags = new ArrayList<>(); + private @Valid List tags; public enum StatusEnum { AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java index f7b76bfe002..68de54e0e95 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java @@ -25,31 +25,31 @@ public class XmlItem implements Serializable { private @Valid BigDecimal attributeNumber; private @Valid Integer attributeInteger; private @Valid Boolean attributeBoolean; - private @Valid List wrappedArray = new ArrayList<>(); + private @Valid List wrappedArray; private @Valid String nameString; private @Valid BigDecimal nameNumber; private @Valid Integer nameInteger; private @Valid Boolean nameBoolean; - private @Valid List nameArray = new ArrayList<>(); - private @Valid List nameWrappedArray = new ArrayList<>(); + private @Valid List nameArray; + private @Valid List nameWrappedArray; private @Valid String prefixString; private @Valid BigDecimal prefixNumber; private @Valid Integer prefixInteger; private @Valid Boolean prefixBoolean; - private @Valid List prefixArray = new ArrayList<>(); - private @Valid List prefixWrappedArray = new ArrayList<>(); + private @Valid List prefixArray; + private @Valid List prefixWrappedArray; private @Valid String namespaceString; private @Valid BigDecimal namespaceNumber; private @Valid Integer namespaceInteger; private @Valid Boolean namespaceBoolean; - private @Valid List namespaceArray = new ArrayList<>(); - private @Valid List namespaceWrappedArray = new ArrayList<>(); + private @Valid List namespaceArray; + private @Valid List namespaceWrappedArray; private @Valid String prefixNsString; private @Valid BigDecimal prefixNsNumber; private @Valid Integer prefixNsInteger; private @Valid Boolean prefixNsBoolean; - private @Valid List prefixNsArray = new ArrayList<>(); - private @Valid List prefixNsWrappedArray = new ArrayList<>(); + private @Valid List prefixNsArray; + private @Valid List prefixNsWrappedArray; /** **/ diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index d3f4815dfd4..cf67e92deba 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayOfArrayOfNumberOnly") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayOfArrayOfNumberOnly implements Serializable { - private @Valid List> arrayArrayNumber = new ArrayList<>(); + private @Valid List> arrayArrayNumber; protected ArrayOfArrayOfNumberOnly(ArrayOfArrayOfNumberOnlyBuilder b) { this.arrayArrayNumber = b.arrayArrayNumber; @@ -123,7 +123,7 @@ public class ArrayOfArrayOfNumberOnly implements Serializable { } public static abstract class ArrayOfArrayOfNumberOnlyBuilder> { - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; protected abstract B self(); public abstract C build(); diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 5d1799d12cb..68e19d1a1c7 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayOfNumberOnly") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayOfNumberOnly implements Serializable { - private @Valid List arrayNumber = new ArrayList<>(); + private @Valid List arrayNumber; protected ArrayOfNumberOnly(ArrayOfNumberOnlyBuilder b) { this.arrayNumber = b.arrayNumber; @@ -123,7 +123,7 @@ public class ArrayOfNumberOnly implements Serializable { } public static abstract class ArrayOfNumberOnlyBuilder> { - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; protected abstract B self(); public abstract C build(); diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java index a40e73fdd5e..5d87292bcfa 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayTest") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayTest implements Serializable { - private @Valid List arrayOfString = new ArrayList<>(); - private @Valid List> arrayArrayOfInteger = new ArrayList<>(); - private @Valid List> arrayArrayOfModel = new ArrayList<>(); + private @Valid List arrayOfString; + private @Valid List> arrayArrayOfInteger; + private @Valid List> arrayArrayOfModel; protected ArrayTest(ArrayTestBuilder b) { this.arrayOfString = b.arrayOfString; @@ -201,9 +201,9 @@ public class ArrayTest implements Serializable { } public static abstract class ArrayTestBuilder> { - private List arrayOfString = new ArrayList<>(); - private List> arrayArrayOfInteger = new ArrayList<>(); - private List> arrayArrayOfModel = new ArrayList<>(); + private List arrayOfString; + private List> arrayArrayOfInteger; + private List> arrayArrayOfModel; protected abstract B self(); public abstract C build(); diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java index 4bc6f6c1b8d..d187571a55a 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java @@ -115,7 +115,7 @@ public class EnumArrays implements Serializable { } } - private @Valid List arrayEnum = new ArrayList<>(); + private @Valid List arrayEnum; protected EnumArrays(EnumArraysBuilder b) { this.justSymbol = b.justSymbol; @@ -240,7 +240,7 @@ public class EnumArrays implements Serializable { public static abstract class EnumArraysBuilder> { private JustSymbolEnum justSymbol; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; protected abstract B self(); public abstract C build(); diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 60a19b11f1b..c973c0e39ca 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class FileSchemaTestClass implements Serializable { private @Valid ModelFile _file; - private @Valid List files = new ArrayList<>(); + private @Valid List files; protected FileSchemaTestClass(FileSchemaTestClassBuilder b) { this._file = b._file; @@ -147,7 +147,7 @@ public class FileSchemaTestClass implements Serializable { public static abstract class FileSchemaTestClassBuilder> { private ModelFile _file; - private List files = new ArrayList<>(); + private List files; protected abstract B self(); public abstract C build(); diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java index 724992ffb63..6fbff0a69c9 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java @@ -29,7 +29,7 @@ public class Pet implements Serializable { private @Valid Category category; private @Valid String name; private @Valid Set photoUrls = new LinkedHashSet<>(); - private @Valid List tags = new ArrayList<>(); + private @Valid List tags; public enum StatusEnum { AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); @@ -313,7 +313,7 @@ public class Pet implements Serializable { private Category category; private String name; private Set photoUrls = new LinkedHashSet<>(); - private List tags = new ArrayList<>(); + private List tags; private StatusEnum status; protected abstract B self(); diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java index cfc0fd1baba..b9a77cd161f 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java @@ -25,31 +25,31 @@ public class XmlItem implements Serializable { private @Valid BigDecimal attributeNumber; private @Valid Integer attributeInteger; private @Valid Boolean attributeBoolean; - private @Valid List wrappedArray = new ArrayList<>(); + private @Valid List wrappedArray; private @Valid String nameString; private @Valid BigDecimal nameNumber; private @Valid Integer nameInteger; private @Valid Boolean nameBoolean; - private @Valid List nameArray = new ArrayList<>(); - private @Valid List nameWrappedArray = new ArrayList<>(); + private @Valid List nameArray; + private @Valid List nameWrappedArray; private @Valid String prefixString; private @Valid BigDecimal prefixNumber; private @Valid Integer prefixInteger; private @Valid Boolean prefixBoolean; - private @Valid List prefixArray = new ArrayList<>(); - private @Valid List prefixWrappedArray = new ArrayList<>(); + private @Valid List prefixArray; + private @Valid List prefixWrappedArray; private @Valid String namespaceString; private @Valid BigDecimal namespaceNumber; private @Valid Integer namespaceInteger; private @Valid Boolean namespaceBoolean; - private @Valid List namespaceArray = new ArrayList<>(); - private @Valid List namespaceWrappedArray = new ArrayList<>(); + private @Valid List namespaceArray; + private @Valid List namespaceWrappedArray; private @Valid String prefixNsString; private @Valid BigDecimal prefixNsNumber; private @Valid Integer prefixNsInteger; private @Valid Boolean prefixNsBoolean; - private @Valid List prefixNsArray = new ArrayList<>(); - private @Valid List prefixNsWrappedArray = new ArrayList<>(); + private @Valid List prefixNsArray; + private @Valid List prefixNsWrappedArray; protected XmlItem(XmlItemBuilder b) { this.attributeString = b.attributeString; @@ -899,31 +899,31 @@ public class XmlItem implements Serializable { private BigDecimal attributeNumber; private Integer attributeInteger; private Boolean attributeBoolean; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; private String nameString; private BigDecimal nameNumber; private Integer nameInteger; private Boolean nameBoolean; - private List nameArray = new ArrayList<>(); - private List nameWrappedArray = new ArrayList<>(); + private List nameArray; + private List nameWrappedArray; private String prefixString; private BigDecimal prefixNumber; private Integer prefixInteger; private Boolean prefixBoolean; - private List prefixArray = new ArrayList<>(); - private List prefixWrappedArray = new ArrayList<>(); + private List prefixArray; + private List prefixWrappedArray; private String namespaceString; private BigDecimal namespaceNumber; private Integer namespaceInteger; private Boolean namespaceBoolean; - private List namespaceArray = new ArrayList<>(); - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceArray; + private List namespaceWrappedArray; private String prefixNsString; private BigDecimal prefixNsNumber; private Integer prefixNsInteger; private Boolean prefixNsBoolean; - private List prefixNsArray = new ArrayList<>(); - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsArray; + private List prefixNsWrappedArray; protected abstract B self(); public abstract C build(); diff --git a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator-ignore b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator-ignore rename to samples/server/petstore/jaxrs-spec-required-and-readonly-property/.openapi-generator-ignore diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/.openapi-generator/FILES new file mode 100644 index 00000000000..5bfc5850a3d --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/.openapi-generator/FILES @@ -0,0 +1,7 @@ +README.md +pom.xml +src/gen/java/org/openapitools/api/RestApplication.java +src/gen/java/org/openapitools/api/RestResourceRoot.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/ReadonlyAndRequiredProperties.java +src/main/openapi/openapi.yaml diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/.openapi-generator/VERSION new file mode 100644 index 00000000000..757e6740040 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/README.md b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/README.md new file mode 100644 index 00000000000..b9d190efc44 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/README.md @@ -0,0 +1,27 @@ +# JAX-RS server with OpenAPI + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an +[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. + +This is an example of building a OpenAPI-enabled JAX-RS server. +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. + + +The JAX-RS implementation needs to be provided by the application server you are deploying on. + +To run the server from the command line, you can use maven to provision and start a TomEE Server. +Please execute the following: + +``` +mvn -Dtomee-embedded-plugin.http=8080 package org.apache.tomee.maven:tomee-embedded-maven-plugin:7.0.5:run +``` + +You can then call your server endpoints under: + +``` +http://localhost:8080/ +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml new file mode 100644 index 00000000000..6bcd26f49ad --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml @@ -0,0 +1,139 @@ + + 4.0.0 + org.openapitools + jaxrs-spec-petstore-server + war + jaxrs-spec-petstore-server + 1.0.0 + + + + src/main/java + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.1.0 + + false + + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-version} + provided + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + joda-time + joda-time + ${joda-version} + + + javax.annotation + javax.annotation-api + ${javax.annotation-api-version} + + + io.swagger + swagger-annotations + provided + 1.5.3 + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + junit + junit + ${junit-version} + test + + + org.testng + testng + 6.8.8 + test + + + junit + junit + + + snakeyaml + org.yaml + + + bsh + org.beanshell + + + + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + + 1.8 + ${java.version} + ${java.version} + UTF-8 + 2.9.9 + 4.13.2 + 2.10.13 + 1.3.2 + 2.0.2 + 2.1.6 + + diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/RestApplication.java b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/RestApplication.java new file mode 100644 index 00000000000..7df2d0fe333 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/RestApplication.java @@ -0,0 +1,9 @@ +package org.openapitools.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath(RestResourceRoot.APPLICATION_PATH) +public class RestApplication extends Application { + +} diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/RestResourceRoot.java b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/RestResourceRoot.java new file mode 100644 index 00000000000..727f0dfe3fb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/RestResourceRoot.java @@ -0,0 +1,5 @@ +package org.openapitools.api; + +public class RestResourceRoot { + public static final String APPLICATION_PATH = ""; +} diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/UserApi.java new file mode 100644 index 00000000000..d7cc59f0ee5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/api/UserApi.java @@ -0,0 +1,30 @@ +package org.openapitools.api; + +import org.openapitools.model.ReadonlyAndRequiredProperties; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/user") +@Api(description = "the user API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") +public class UserApi { + + @GET + @Produces({ "application/json" }) + @ApiOperation(value = "", notes = "", response = ReadonlyAndRequiredProperties.class, tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "success", response = ReadonlyAndRequiredProperties.class) + }) + public Response userGet() { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/model/ReadonlyAndRequiredProperties.java b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/model/ReadonlyAndRequiredProperties.java new file mode 100644 index 00000000000..cf06a949cae --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/model/ReadonlyAndRequiredProperties.java @@ -0,0 +1,203 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("ReadonlyAndRequiredProperties") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") +public class ReadonlyAndRequiredProperties implements Serializable { + private @Valid String requiredYesReadonlyYes; + private @Valid String requiredYesReadonlyNo; + private @Valid String requiredNoReadonlyYes; + private @Valid String requiredNoReadonlyNo; + + protected ReadonlyAndRequiredProperties(ReadonlyAndRequiredPropertiesBuilder b) { + this.requiredYesReadonlyYes = b.requiredYesReadonlyYes; + this.requiredYesReadonlyNo = b.requiredYesReadonlyNo; + this.requiredNoReadonlyYes = b.requiredNoReadonlyYes; + this.requiredNoReadonlyNo = b.requiredNoReadonlyNo; + } + + public ReadonlyAndRequiredProperties() { + } + + /** + **/ + public ReadonlyAndRequiredProperties requiredYesReadonlyYes(String requiredYesReadonlyYes) { + this.requiredYesReadonlyYes = requiredYesReadonlyYes; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("requiredYesReadonlyYes") + public String getRequiredYesReadonlyYes() { + return requiredYesReadonlyYes; + } + + @JsonProperty("requiredYesReadonlyYes") + public void setRequiredYesReadonlyYes(String requiredYesReadonlyYes) { + this.requiredYesReadonlyYes = requiredYesReadonlyYes; + } + + /** + **/ + public ReadonlyAndRequiredProperties requiredYesReadonlyNo(String requiredYesReadonlyNo) { + this.requiredYesReadonlyNo = requiredYesReadonlyNo; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("requiredYesReadonlyNo") + @NotNull + public String getRequiredYesReadonlyNo() { + return requiredYesReadonlyNo; + } + + @JsonProperty("requiredYesReadonlyNo") + public void setRequiredYesReadonlyNo(String requiredYesReadonlyNo) { + this.requiredYesReadonlyNo = requiredYesReadonlyNo; + } + + /** + **/ + public ReadonlyAndRequiredProperties requiredNoReadonlyYes(String requiredNoReadonlyYes) { + this.requiredNoReadonlyYes = requiredNoReadonlyYes; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("requiredNoReadonlyYes") + public String getRequiredNoReadonlyYes() { + return requiredNoReadonlyYes; + } + + @JsonProperty("requiredNoReadonlyYes") + public void setRequiredNoReadonlyYes(String requiredNoReadonlyYes) { + this.requiredNoReadonlyYes = requiredNoReadonlyYes; + } + + /** + **/ + public ReadonlyAndRequiredProperties requiredNoReadonlyNo(String requiredNoReadonlyNo) { + this.requiredNoReadonlyNo = requiredNoReadonlyNo; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("requiredNoReadonlyNo") + public String getRequiredNoReadonlyNo() { + return requiredNoReadonlyNo; + } + + @JsonProperty("requiredNoReadonlyNo") + public void setRequiredNoReadonlyNo(String requiredNoReadonlyNo) { + this.requiredNoReadonlyNo = requiredNoReadonlyNo; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadonlyAndRequiredProperties readonlyAndRequiredProperties = (ReadonlyAndRequiredProperties) o; + return Objects.equals(this.requiredYesReadonlyYes, readonlyAndRequiredProperties.requiredYesReadonlyYes) && + Objects.equals(this.requiredYesReadonlyNo, readonlyAndRequiredProperties.requiredYesReadonlyNo) && + Objects.equals(this.requiredNoReadonlyYes, readonlyAndRequiredProperties.requiredNoReadonlyYes) && + Objects.equals(this.requiredNoReadonlyNo, readonlyAndRequiredProperties.requiredNoReadonlyNo); + } + + @Override + public int hashCode() { + return Objects.hash(requiredYesReadonlyYes, requiredYesReadonlyNo, requiredNoReadonlyYes, requiredNoReadonlyNo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadonlyAndRequiredProperties {\n"); + + sb.append(" requiredYesReadonlyYes: ").append(toIndentedString(requiredYesReadonlyYes)).append("\n"); + sb.append(" requiredYesReadonlyNo: ").append(toIndentedString(requiredYesReadonlyNo)).append("\n"); + sb.append(" requiredNoReadonlyYes: ").append(toIndentedString(requiredNoReadonlyYes)).append("\n"); + sb.append(" requiredNoReadonlyNo: ").append(toIndentedString(requiredNoReadonlyNo)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ReadonlyAndRequiredPropertiesBuilder builder() { + return new ReadonlyAndRequiredPropertiesBuilderImpl(); + } + + private static final class ReadonlyAndRequiredPropertiesBuilderImpl extends ReadonlyAndRequiredPropertiesBuilder { + + @Override + protected ReadonlyAndRequiredPropertiesBuilderImpl self() { + return this; + } + + @Override + public ReadonlyAndRequiredProperties build() { + return new ReadonlyAndRequiredProperties(this); + } + } + + public static abstract class ReadonlyAndRequiredPropertiesBuilder> { + private String requiredYesReadonlyYes; + private String requiredYesReadonlyNo; + private String requiredNoReadonlyYes; + private String requiredNoReadonlyNo; + protected abstract B self(); + + public abstract C build(); + + public B requiredYesReadonlyYes(String requiredYesReadonlyYes) { + this.requiredYesReadonlyYes = requiredYesReadonlyYes; + return self(); + } + public B requiredYesReadonlyNo(String requiredYesReadonlyNo) { + this.requiredYesReadonlyNo = requiredYesReadonlyNo; + return self(); + } + public B requiredNoReadonlyYes(String requiredNoReadonlyYes) { + this.requiredNoReadonlyYes = requiredNoReadonlyYes; + return self(); + } + public B requiredNoReadonlyNo(String requiredNoReadonlyNo) { + this.requiredNoReadonlyNo = requiredNoReadonlyNo; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/main/openapi/openapi.yaml new file mode 100644 index 00000000000..e3afb081034 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/main/openapi/openapi.yaml @@ -0,0 +1,41 @@ +openapi: 3.0.3 +info: + description: Title + title: Title + version: 1.0.0 +servers: +- url: https +paths: + /user: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ReadonlyAndRequiredProperties' + description: success + x-accepts: application/json +components: + schemas: + ReadonlyAndRequiredProperties: + example: + requiredYesReadonlyYes: requiredYesReadonlyYes + requiredNoReadonlyYes: requiredNoReadonlyYes + requiredYesReadonlyNo: requiredYesReadonlyNo + requiredNoReadonlyNo: requiredNoReadonlyNo + properties: + requiredYesReadonlyYes: + readOnly: true + type: string + requiredYesReadonlyNo: + type: string + requiredNoReadonlyYes: + readOnly: true + type: string + requiredNoReadonlyNo: + type: string + required: + - requiredYesReadonlyNo + - requiredYesReadonlyYes + type: object diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index d1ebd9ba958..febc6fa617a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayOfArrayOfNumberOnly implements Serializable { - private @Valid List> arrayArrayNumber = new ArrayList<>(); + private @Valid List> arrayArrayNumber; protected ArrayOfArrayOfNumberOnly(ArrayOfArrayOfNumberOnlyBuilder b) { this.arrayArrayNumber = b.arrayArrayNumber; @@ -123,7 +123,7 @@ public class ArrayOfArrayOfNumberOnly implements Serializable { } public static abstract class ArrayOfArrayOfNumberOnlyBuilder> { - private List> arrayArrayNumber = new ArrayList<>(); + private List> arrayArrayNumber; protected abstract B self(); public abstract C build(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 07ada528789..f7df847e747 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayOfNumberOnly implements Serializable { - private @Valid List arrayNumber = new ArrayList<>(); + private @Valid List arrayNumber; protected ArrayOfNumberOnly(ArrayOfNumberOnlyBuilder b) { this.arrayNumber = b.arrayNumber; @@ -123,7 +123,7 @@ public class ArrayOfNumberOnly implements Serializable { } public static abstract class ArrayOfNumberOnlyBuilder> { - private List arrayNumber = new ArrayList<>(); + private List arrayNumber; protected abstract B self(); public abstract C build(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java index fb914088e17..d00e7b20ac5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayTest implements Serializable { - private @Valid List arrayOfString = new ArrayList<>(); - private @Valid List> arrayArrayOfInteger = new ArrayList<>(); - private @Valid List> arrayArrayOfModel = new ArrayList<>(); + private @Valid List arrayOfString; + private @Valid List> arrayArrayOfInteger; + private @Valid List> arrayArrayOfModel; protected ArrayTest(ArrayTestBuilder b) { this.arrayOfString = b.arrayOfString; @@ -201,9 +201,9 @@ public class ArrayTest implements Serializable { } public static abstract class ArrayTestBuilder> { - private List arrayOfString = new ArrayList<>(); - private List> arrayArrayOfInteger = new ArrayList<>(); - private List> arrayArrayOfModel = new ArrayList<>(); + private List arrayOfString; + private List> arrayArrayOfInteger; + private List> arrayArrayOfModel; protected abstract B self(); public abstract C build(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java index efbb6a6ec55..efd8cb093a5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java @@ -115,7 +115,7 @@ public class EnumArrays implements Serializable { } } - private @Valid List arrayEnum = new ArrayList<>(); + private @Valid List arrayEnum; protected EnumArrays(EnumArraysBuilder b) { this.justSymbol = b.justSymbol; @@ -240,7 +240,7 @@ public class EnumArrays implements Serializable { public static abstract class EnumArraysBuilder> { private JustSymbolEnum justSymbol; - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; protected abstract B self(); public abstract C build(); 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 369e7f90999..1a3d6d6cc5a 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 @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class FileSchemaTestClass implements Serializable { private @Valid ModelFile _file; - private @Valid List files = new ArrayList<>(); + private @Valid List files; protected FileSchemaTestClass(FileSchemaTestClassBuilder b) { this._file = b._file; @@ -147,7 +147,7 @@ public class FileSchemaTestClass implements Serializable { public static abstract class FileSchemaTestClassBuilder> { private ModelFile _file; - private List files = new ArrayList<>(); + private List files; protected abstract B self(); public abstract C build(); 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 f9284740e0e..48b5c362f0d 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 @@ -29,7 +29,7 @@ public class Pet implements Serializable { private @Valid Category category; private @Valid String name; private @Valid Set photoUrls = new LinkedHashSet<>(); - private @Valid List tags = new ArrayList<>(); + private @Valid List tags; public enum StatusEnum { AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); @@ -313,7 +313,7 @@ public class Pet implements Serializable { private Category category; private String name; private Set photoUrls = new LinkedHashSet<>(); - private List tags = new ArrayList<>(); + private List tags; private StatusEnum status; protected abstract B self(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java index 9f4eb028354..86ca4856ed6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java @@ -25,31 +25,31 @@ public class XmlItem implements Serializable { private @Valid BigDecimal attributeNumber; private @Valid Integer attributeInteger; private @Valid Boolean attributeBoolean; - private @Valid List wrappedArray = new ArrayList<>(); + private @Valid List wrappedArray; private @Valid String nameString; private @Valid BigDecimal nameNumber; private @Valid Integer nameInteger; private @Valid Boolean nameBoolean; - private @Valid List nameArray = new ArrayList<>(); - private @Valid List nameWrappedArray = new ArrayList<>(); + private @Valid List nameArray; + private @Valid List nameWrappedArray; private @Valid String prefixString; private @Valid BigDecimal prefixNumber; private @Valid Integer prefixInteger; private @Valid Boolean prefixBoolean; - private @Valid List prefixArray = new ArrayList<>(); - private @Valid List prefixWrappedArray = new ArrayList<>(); + private @Valid List prefixArray; + private @Valid List prefixWrappedArray; private @Valid String namespaceString; private @Valid BigDecimal namespaceNumber; private @Valid Integer namespaceInteger; private @Valid Boolean namespaceBoolean; - private @Valid List namespaceArray = new ArrayList<>(); - private @Valid List namespaceWrappedArray = new ArrayList<>(); + private @Valid List namespaceArray; + private @Valid List namespaceWrappedArray; private @Valid String prefixNsString; private @Valid BigDecimal prefixNsNumber; private @Valid Integer prefixNsInteger; private @Valid Boolean prefixNsBoolean; - private @Valid List prefixNsArray = new ArrayList<>(); - private @Valid List prefixNsWrappedArray = new ArrayList<>(); + private @Valid List prefixNsArray; + private @Valid List prefixNsWrappedArray; protected XmlItem(XmlItemBuilder b) { this.attributeString = b.attributeString; @@ -899,31 +899,31 @@ public class XmlItem implements Serializable { private BigDecimal attributeNumber; private Integer attributeInteger; private Boolean attributeBoolean; - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; private String nameString; private BigDecimal nameNumber; private Integer nameInteger; private Boolean nameBoolean; - private List nameArray = new ArrayList<>(); - private List nameWrappedArray = new ArrayList<>(); + private List nameArray; + private List nameWrappedArray; private String prefixString; private BigDecimal prefixNumber; private Integer prefixInteger; private Boolean prefixBoolean; - private List prefixArray = new ArrayList<>(); - private List prefixWrappedArray = new ArrayList<>(); + private List prefixArray; + private List prefixWrappedArray; private String namespaceString; private BigDecimal namespaceNumber; private Integer namespaceInteger; private Boolean namespaceBoolean; - private List namespaceArray = new ArrayList<>(); - private List namespaceWrappedArray = new ArrayList<>(); + private List namespaceArray; + private List namespaceWrappedArray; private String prefixNsString; private BigDecimal prefixNsNumber; private Integer prefixNsInteger; private Boolean prefixNsBoolean; - private List prefixNsArray = new ArrayList<>(); - private List prefixNsWrappedArray = new ArrayList<>(); + private List prefixNsArray; + private List prefixNsWrappedArray; protected abstract B self(); public abstract C build(); 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 982c0e87703..534c0f707fe 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = 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 c33312433c5..bd8b3b164a1 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = 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 229eaec7c02..212759b984a 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 @@ -37,15 +37,15 @@ import javax.validation.Valid; 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; 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; 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; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; 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 5238609546f..b1efc16e9b8 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 @@ -102,7 +102,7 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; 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 5a3eec069e8..d4f56663eb1 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 @@ -40,7 +40,7 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass _file(ModelFile _file) { this._file = _file; 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 70f15b649a2..7965fd1a1c7 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 @@ -61,7 +61,7 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 42df80d492a..48683fa3544 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 @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 02e2798441a..c3d0478ada7 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 @@ -168,6 +168,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 5bee8225535..9a945e6e1b2 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 @@ -79,7 +79,7 @@ public class XmlItem { public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; @JsonProperty(JSON_PROPERTY_NAME_STRING) @@ -99,11 +99,11 @@ public class XmlItem { public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray; 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; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @@ -123,11 +123,11 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray; 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; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @@ -147,11 +147,11 @@ public class XmlItem { public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; 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; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @@ -171,11 +171,11 @@ public class XmlItem { 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; 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; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; 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 982c0e87703..534c0f707fe 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = 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 c33312433c5..bd8b3b164a1 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = 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 229eaec7c02..212759b984a 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 @@ -37,15 +37,15 @@ import javax.validation.Valid; 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; 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; 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; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; 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 5238609546f..b1efc16e9b8 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 @@ -102,7 +102,7 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; 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 5a3eec069e8..d4f56663eb1 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 @@ -40,7 +40,7 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass _file(ModelFile _file) { this._file = _file; 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 70f15b649a2..7965fd1a1c7 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 @@ -61,7 +61,7 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 42df80d492a..48683fa3544 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 @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 02e2798441a..c3d0478ada7 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 @@ -168,6 +168,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 5bee8225535..9a945e6e1b2 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 @@ -79,7 +79,7 @@ public class XmlItem { public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; @JsonProperty(JSON_PROPERTY_NAME_STRING) @@ -99,11 +99,11 @@ public class XmlItem { public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray; 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; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @@ -123,11 +123,11 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray; 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; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @@ -147,11 +147,11 @@ public class XmlItem { public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; 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; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @@ -171,11 +171,11 @@ public class XmlItem { 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; 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; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; 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 982c0e87703..534c0f707fe 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = 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 c33312433c5..bd8b3b164a1 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = 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 229eaec7c02..212759b984a 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 @@ -37,15 +37,15 @@ import javax.validation.Valid; 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; 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; 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; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; 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 5238609546f..b1efc16e9b8 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 @@ -102,7 +102,7 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; 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 5a3eec069e8..d4f56663eb1 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 @@ -40,7 +40,7 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass _file(ModelFile _file) { this._file = _file; 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 70f15b649a2..7965fd1a1c7 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 @@ -61,7 +61,7 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 42df80d492a..48683fa3544 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 @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 02e2798441a..c3d0478ada7 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 @@ -168,6 +168,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 5bee8225535..9a945e6e1b2 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 @@ -79,7 +79,7 @@ public class XmlItem { public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; @JsonProperty(JSON_PROPERTY_NAME_STRING) @@ -99,11 +99,11 @@ public class XmlItem { public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray; 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; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @@ -123,11 +123,11 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray; 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; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @@ -147,11 +147,11 @@ public class XmlItem { public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; 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; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @@ -171,11 +171,11 @@ public class XmlItem { 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; 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; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; 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 982c0e87703..534c0f707fe 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = 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 c33312433c5..bd8b3b164a1 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; 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; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = 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 229eaec7c02..212759b984a 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 @@ -37,15 +37,15 @@ import javax.validation.Valid; 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; 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; 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; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; 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 5238609546f..b1efc16e9b8 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 @@ -102,7 +102,7 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - private List arrayEnum = new ArrayList<>(); + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; 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 5a3eec069e8..d4f56663eb1 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 @@ -40,7 +40,7 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; @JsonProperty(JSON_PROPERTY_FILES) - private List files = new ArrayList<>(); + private List files; public FileSchemaTestClass _file(ModelFile _file) { this._file = _file; 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 70f15b649a2..7965fd1a1c7 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 @@ -61,7 +61,7 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) - private List tags = new ArrayList<>(); + private List tags; /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } 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 42df80d492a..48683fa3544 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 @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 02e2798441a..c3d0478ada7 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 @@ -168,6 +168,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } 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 5bee8225535..9a945e6e1b2 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 @@ -79,7 +79,7 @@ public class XmlItem { public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - private List wrappedArray = new ArrayList<>(); + private List wrappedArray; public static final String JSON_PROPERTY_NAME_STRING = "name_string"; @JsonProperty(JSON_PROPERTY_NAME_STRING) @@ -99,11 +99,11 @@ public class XmlItem { public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - private List nameArray = new ArrayList<>(); + private List nameArray; 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; public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @@ -123,11 +123,11 @@ public class XmlItem { public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - private List prefixArray = new ArrayList<>(); + private List prefixArray; 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; public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @@ -147,11 +147,11 @@ public class XmlItem { public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - private List namespaceArray = new ArrayList<>(); + private List namespaceArray; 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; public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @@ -171,11 +171,11 @@ public class XmlItem { 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; 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; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt index 3ba8bf11515..7269bef2cff 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -11,8 +11,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import jakarta.validation.constraints.* import jakarta.validation.Valid +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 489b67a5c86..b47bad73d03 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -10,8 +10,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import jakarta.validation.constraints.* import jakarta.validation.Valid +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt index 132eba2012c..2f81b70eead 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -10,8 +10,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import jakarta.validation.constraints.* import jakarta.validation.Valid +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt index 0776927c6d6..3cc63c511b1 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import jakarta.validation.constraints.* +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import jakarta.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index e69a84ffb29..0abe67b0e8b 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import jakarta.validation.constraints.* +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import jakarta.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt index c9183985dcf..87667494f23 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,7 +3,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import jakarta.validation.constraints.* +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import jakarta.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt index 90d44174bfb..4db341ab1c4 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,7 +5,14 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import jakarta.validation.constraints.* +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import jakarta.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt index 7d448c4e31a..c1081aeaf97 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import jakarta.validation.constraints.* +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import jakarta.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt index 7889c3ce43c..b819427eaf5 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import jakarta.validation.constraints.* +import jakarta.validation.constraints.DecimalMax +import jakarta.validation.constraints.DecimalMin +import jakarta.validation.constraints.Email +import jakarta.validation.constraints.Max +import jakarta.validation.constraints.Min +import jakarta.validation.constraints.NotNull +import jakarta.validation.constraints.Pattern +import jakarta.validation.constraints.Size import jakarta.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index f73d738da6c..7ef1423b9da 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -21,7 +21,14 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import kotlin.collections.List diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index ea89007bd95..4b98a7b0c6a 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -20,7 +20,14 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import kotlin.collections.List diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index df312ea6903..35556d01c83 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -20,7 +20,14 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import kotlin.collections.List diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt index 5e1f58d1eda..64541c666d4 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 9184be916b6..6af39346cf4 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt index 4494a01b1d5..128eee7f628 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,7 +3,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index c2dc926bb76..12a5a585b40 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,7 +5,14 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Tag.kt index 24222a73ddd..0f2b45edcf7 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/User.kt index e9590783281..ef3d46afd3e 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt index 6d7b6e53d77..0cf82b64c04 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -16,8 +16,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt index b0946d1bbf6..09afab084a7 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -15,8 +15,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt index f0aad1cbbe1..08160bfaf0f 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -15,8 +15,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index b7425df729e..95fa00f2636 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index d99a43615c6..68d1ebf496b 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index 2ab4410e869..b0ebd4f13c0 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,7 +3,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index 27ad499e95f..a989737abc3 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,7 +5,14 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index d3853248d27..1ad68021b89 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index 55d3848402e..b1d1cead418 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt index 867ba7a9341..047e4caafe9 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -16,8 +16,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlinx.coroutines.flow.Flow import kotlin.collections.List diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 299c0cc6ed2..61a9b1a243c 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -15,8 +15,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlinx.coroutines.flow.Flow import kotlin.collections.List diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt index ed81d4a9edb..3ba3d95214c 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -15,8 +15,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlinx.coroutines.flow.Flow import kotlin.collections.List diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt index 071460876e2..f7ed3a1a970 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 9184be916b6..6af39346cf4 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index 4494a01b1d5..128eee7f628 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,7 +3,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index 01a57ac0677..cab156b8818 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,7 +5,14 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt index 24222a73ddd..0f2b45edcf7 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt index e9590783281..ef3d46afd3e 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt index f140835c306..75079add0cb 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -18,8 +18,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 04d362f7c9d..764c1073e56 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -17,8 +17,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/UserApiController.kt index 922b00e48fa..5e7076f405c 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -17,8 +17,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt index 4e2eb168a7e..926b412f109 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 51bacef319b..be3714162c5 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt index 62eb9fe862c..8365af30903 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,7 +3,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt index 91a928d5356..a1a910115db 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,7 +5,14 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt index 0fd597f0ade..5ffd22fa340 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt index b7ad8b1f496..cd0997a8e22 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt index 6d7b6e53d77..0cf82b64c04 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -16,8 +16,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/StoreApiController.kt index b0946d1bbf6..09afab084a7 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -15,8 +15,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/UserApiController.kt index f0aad1cbbe1..08160bfaf0f 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -15,8 +15,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt index 071460876e2..f7ed3a1a970 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 9184be916b6..6af39346cf4 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt index 4494a01b1d5..128eee7f628 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,7 +3,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt index 01a57ac0677..cab156b8818 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,7 +5,14 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt index 24222a73ddd..0f2b45edcf7 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt index e9590783281..ef3d46afd3e 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.v3.oas.annotations.media.Schema diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt index f140835c306..75079add0cb 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -18,8 +18,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 04d362f7c9d..764c1073e56 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -17,8 +17,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/UserApiController.kt index 922b00e48fa..5e7076f405c 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -17,8 +17,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt index 4e2eb168a7e..926b412f109 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 51bacef319b..be3714162c5 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt index 62eb9fe862c..8365af30903 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,7 +3,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt index 91a928d5356..a1a910115db 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,7 +5,14 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt index 0fd597f0ade..5ffd22fa340 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt index b7ad8b1f496..cd0997a8e22 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid import io.swagger.annotations.ApiModelProperty diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt index bd068ad1c43..91872a031f2 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -11,8 +11,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt index a3fb433ad82..6cbb8279976 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -10,8 +10,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt index d0417729a71..daf5c943c2e 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -10,8 +10,15 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired -import javax.validation.constraints.* import javax.validation.Valid +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 3b89d470f8c..7e906d10e10 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 250cb441d30..4b42c877edb 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 68536f35df7..61814bda584 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,7 +3,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index 09cbaeccd4a..ebebb0c1419 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,7 +5,14 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index fdee0a22908..0beafadd514 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid /** diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index a99d304e5ac..8780ff0d2f2 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,14 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import javax.validation.Valid /** diff --git a/samples/server/petstore/php-laravel/lib/app/Models/AllOfWithSingleRef.php b/samples/server/petstore/php-laravel/lib/app/Models/AllOfWithSingleRef.php index 90a2bca8d56..97b38ffcf76 100644 --- a/samples/server/petstore/php-laravel/lib/app/Models/AllOfWithSingleRef.php +++ b/samples/server/petstore/php-laravel/lib/app/Models/AllOfWithSingleRef.php @@ -12,7 +12,7 @@ class AllOfWithSingleRef { /** @var string $username */ public $username = ""; - /** @var SingleRefType $singleRefType */ + /** @var \app\Models\SingleRefType $singleRefType */ public $singleRefType; } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php index 2beafc6fa2d..379e7faf32a 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php @@ -95,7 +95,7 @@ class JmsSerializer implements SerializerInterface break; case 'DateTime': case '\DateTime': - return new DateTime($data); + return is_null($data) ? null :new DateTime($data); default: throw new RuntimeException(sprintf("Type %s is unsupported", $type)); } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES index b0d6b6c8395..995168af5ff 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES @@ -9,14 +9,12 @@ docs/AnotherXmlInner.md docs/AnotherXmlObject.md docs/AnyOfGet202Response.md docs/AnyOfObject.md -docs/AnyOfObjectAnyOf.md docs/AnyOfProperty.md docs/DuplicateXmlObject.md docs/EnumWithStarObject.md docs/Err.md docs/Error.md docs/Model12345AnyOfObject.md -docs/Model12345AnyOfObjectAnyOf.md docs/MultigetGet201Response.md docs/MyId.md docs/MyIdList.md diff --git a/samples/server/petstore/rust-server/output/openapi-v3/README.md b/samples/server/petstore/rust-server/output/openapi-v3/README.md index b5bbb27bdf3..fabb7795874 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/README.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/README.md @@ -155,14 +155,12 @@ Method | HTTP request | Description - [AnotherXmlObject](docs/AnotherXmlObject.md) - [AnyOfGet202Response](docs/AnyOfGet202Response.md) - [AnyOfObject](docs/AnyOfObject.md) - - [AnyOfObjectAnyOf](docs/AnyOfObjectAnyOf.md) - [AnyOfProperty](docs/AnyOfProperty.md) - [DuplicateXmlObject](docs/DuplicateXmlObject.md) - [EnumWithStarObject](docs/EnumWithStarObject.md) - [Err](docs/Err.md) - [Error](docs/Error.md) - [Model12345AnyOfObject](docs/Model12345AnyOfObject.md) - - [Model12345AnyOfObjectAnyOf](docs/Model12345AnyOfObjectAnyOf.md) - [MultigetGet201Response](docs/MultigetGet201Response.md) - [MyId](docs/MyId.md) - [MyIdList](docs/MyIdList.md) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml index 43da25ffc94..10519bee5f9 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml @@ -478,13 +478,20 @@ components: - requiredAnyOf AnyOfObject: anyOf: - - $ref: '#/components/schemas/AnyOfObject_anyOf' + - enum: + - FOO + - BAR + type: string - description: Alternate option type: string description: Test a model containing an anyOf "12345AnyOfObject": anyOf: - - $ref: '#/components/schemas/_12345AnyOfObject_anyOf' + - enum: + - FOO + - BAR + - '*' + type: string - description: Alternate option type: string description: Test a model containing an anyOf that starts with a number @@ -678,19 +685,6 @@ components: anyOf: - $ref: '#/components/schemas/StringObject' - $ref: '#/components/schemas/UuidObject' - AnyOfObject_anyOf: - enum: - - FOO - - BAR - type: string - example: null - _12345AnyOfObject_anyOf: - enum: - - FOO - - BAR - - '*' - type: string - example: null securitySchemes: authScheme: flows: 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 4ffae09b4e1..f3ea23bb3b7 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 @@ -638,50 +638,6 @@ impl AnyOfObject { } } -/// Enumeration of values. -/// Since this enum's variants do not hold data, we can easily define them as `#[repr(C)]` -/// which helps with FFI. -#[allow(non_camel_case_types)] -#[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] -#[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))] -pub enum AnyOfObjectAnyOf { - #[serde(rename = "FOO")] - Foo, - #[serde(rename = "BAR")] - Bar, -} - -impl std::fmt::Display for AnyOfObjectAnyOf { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { - AnyOfObjectAnyOf::Foo => write!(f, "FOO"), - AnyOfObjectAnyOf::Bar => write!(f, "BAR"), - } - } -} - -impl std::str::FromStr for AnyOfObjectAnyOf { - type Err = String; - - fn from_str(s: &str) -> std::result::Result { - match s { - "FOO" => std::result::Result::Ok(AnyOfObjectAnyOf::Foo), - "BAR" => std::result::Result::Ok(AnyOfObjectAnyOf::Bar), - _ => std::result::Result::Err(format!("Value not valid: {}", s)), - } - } -} - -impl AnyOfObjectAnyOf { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn as_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - /// Test containing an anyOf object #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] @@ -1242,54 +1198,6 @@ impl Model12345AnyOfObject { } } -/// Enumeration of values. -/// Since this enum's variants do not hold data, we can easily define them as `#[repr(C)]` -/// which helps with FFI. -#[allow(non_camel_case_types)] -#[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] -#[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))] -pub enum Model12345AnyOfObjectAnyOf { - #[serde(rename = "FOO")] - Foo, - #[serde(rename = "BAR")] - Bar, - #[serde(rename = "*")] - Star, -} - -impl std::fmt::Display for Model12345AnyOfObjectAnyOf { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { - Model12345AnyOfObjectAnyOf::Foo => write!(f, "FOO"), - Model12345AnyOfObjectAnyOf::Bar => write!(f, "BAR"), - Model12345AnyOfObjectAnyOf::Star => write!(f, "*"), - } - } -} - -impl std::str::FromStr for Model12345AnyOfObjectAnyOf { - type Err = String; - - fn from_str(s: &str) -> std::result::Result { - match s { - "FOO" => std::result::Result::Ok(Model12345AnyOfObjectAnyOf::Foo), - "BAR" => std::result::Result::Ok(Model12345AnyOfObjectAnyOf::Bar), - "*" => std::result::Result::Ok(Model12345AnyOfObjectAnyOf::Star), - _ => std::result::Result::Err(format!("Value not valid: {}", s)), - } - } -} - -impl Model12345AnyOfObjectAnyOf { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn as_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct MultigetGet201Response { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES index 8bf287f9b1f..10f1284050f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES @@ -27,6 +27,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -49,6 +50,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java index ecb102eedae..a247f4e1b3d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -62,7 +62,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java index 9ad29f78f8f..fee1e658c65 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.ExternalDocumentation; @@ -93,7 +94,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +106,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @Operation( @@ -120,10 +122,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) throws Exception; @@ -147,7 +150,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -174,18 +178,44 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) throws Exception; + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "responseObjectDifferentNames", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNames.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + ResponseEntity responseObjectDifferentNames( + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId + ) throws Exception; + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @Operation( @@ -202,7 +232,7 @@ public interface FakeApi { consumes = { "application/json" } ) ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) throws Exception; @@ -210,7 +240,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @Operation( @@ -227,7 +257,7 @@ public interface FakeApi { ) ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ) throws Exception; @@ -235,7 +265,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -256,7 +286,7 @@ public interface FakeApi { consumes = { "application/json" } ) ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; @@ -396,13 +426,15 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -414,12 +446,13 @@ public interface FakeApi { consumes = { "application/json" } ) ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) throws Exception; /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -428,6 +461,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -449,7 +483,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -469,7 +502,6 @@ public interface FakeApi { ) ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context @@ -478,6 +510,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -487,6 +520,7 @@ public interface FakeApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 32b7a7e4d4b..2a53b452ceb 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -41,7 +41,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -65,7 +65,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java index dfef9dc8d92..d2238a59acb 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java @@ -41,14 +41,16 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -64,12 +66,13 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -79,6 +82,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -206,8 +210,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -216,6 +221,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -233,12 +239,13 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -248,6 +255,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -270,6 +278,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -279,6 +288,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java index a6fb0fdbc6e..2b7ccda67f7 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java @@ -130,14 +130,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -150,10 +152,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) throws Exception; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java index 13c0b382f72..23d23ad1343 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java @@ -43,7 +43,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -57,22 +57,25 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) throws Exception; /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -80,22 +83,25 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -103,10 +109,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; @@ -139,6 +146,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -148,6 +156,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -170,6 +179,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -179,6 +189,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -201,12 +212,14 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -226,7 +239,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -242,11 +255,12 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) throws Exception; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0661c1a9a8d..690bd609d23 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index a3f9c905789..db5353d2d35 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index db5f8d3ce35..5beed6563d9 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 14e13504a8c..eff5bd5fa4b 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -25,45 +28,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -85,6 +77,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -112,6 +105,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -139,6 +133,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -166,6 +161,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -193,6 +189,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -220,6 +217,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -247,6 +245,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -274,6 +273,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -293,6 +293,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -302,7 +303,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +313,12 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -331,6 +333,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index ff0d6d7241e..e3d835a5124 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index cc212be855d..6cde3b272d2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 7c74b7de08d..948a430c814 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 6087e70dba7..d59141c231c 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesString extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java index 1ecf10efc5c..1d3881d9572 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Animal.java @@ -7,9 +7,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -38,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -71,6 +66,7 @@ public class Animal { */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("className") public String getClassName() { return className; } @@ -90,6 +86,7 @@ public class Animal { */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 42600354f74..d7f3b9f37fa 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 2f6c19a8344..6215ba771a0 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java index 23ee84ce8b5..d53a9e07ad8 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java @@ -24,17 +24,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -55,6 +52,7 @@ public class ArrayTest { */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -82,6 +80,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -109,6 +108,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java index 8c5453c4a5b..52359888607 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCat.java @@ -66,7 +66,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -96,6 +95,7 @@ public class BigCat extends Cat { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCatAllOf.java index 741de9f41a3..bff7b148aa2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -63,7 +63,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -77,6 +76,7 @@ public class BigCatAllOf { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java index 0c56400050b..31142a864ec 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Capitalization.java @@ -21,22 +21,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -50,6 +44,7 @@ public class Capitalization { */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -69,6 +64,7 @@ public class Capitalization { */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -88,6 +84,7 @@ public class Capitalization { */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -107,6 +104,7 @@ public class Capitalization { */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -126,6 +124,7 @@ public class Capitalization { */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,6 +144,7 @@ public class Capitalization { */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java index a2feece8de8..a9d13f1b2bf 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Cat.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -35,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -65,6 +63,7 @@ public class Cat extends Animal { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/CatAllOf.java index 50a9c2cdce9..0bd8697513e 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/CatAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -37,6 +36,7 @@ public class CatAllOf { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java index 7ee1fde0646..745935143d1 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Category.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -54,6 +52,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -73,6 +72,7 @@ public class Category { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java index a1942e9c404..95bad44f680 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ClassModel.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -36,6 +35,7 @@ public class ClassModel { */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java index c38b26829be..c070bc9214b 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Client.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -35,6 +34,7 @@ public class Client { */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..ebcd1eede94 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,224 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java index 1bb3d6b5102..b339978e542 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Dog.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -56,6 +55,7 @@ public class Dog extends Animal { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/DogAllOf.java index 256925a7841..6b11905f99a 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/DogAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -37,6 +36,7 @@ public class DogAllOf { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java index 2720e81c227..3d3280a42dc 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java @@ -59,7 +59,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -97,9 +96,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -112,6 +110,7 @@ public class EnumArrays { */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -139,6 +138,7 @@ public class EnumArrays { */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java index 6f08d4ee9fb..e785606f0e1 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumTest.java @@ -62,7 +62,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -102,7 +101,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -140,7 +138,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -178,10 +175,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -211,6 +206,7 @@ public class EnumTest { */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -230,6 +226,7 @@ public class EnumTest { */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -249,6 +246,7 @@ public class EnumTest { */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -268,6 +266,7 @@ public class EnumTest { */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -287,6 +286,7 @@ public class EnumTest { */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java index bf750ccdcb7..7b04101a36a 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/File.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -36,6 +35,7 @@ public class File { */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b196d5d7de..be6e37a7aba 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -24,12 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -42,6 +40,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("file") public File getFile() { return file; } @@ -69,6 +68,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java index 06e9dde8e89..bc4f1de88e6 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FormatTest.java @@ -29,48 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -105,6 +91,7 @@ public class FormatTest { */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -126,6 +113,7 @@ public class FormatTest { */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -145,6 +133,7 @@ public class FormatTest { */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -166,6 +155,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -187,6 +177,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("float") public Float getFloat() { return _float; } @@ -208,6 +199,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("double") public Double getDouble() { return _double; } @@ -227,6 +219,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("string") public String getString() { return string; } @@ -246,6 +239,7 @@ public class FormatTest { */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -265,6 +259,7 @@ public class FormatTest { */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -284,6 +279,7 @@ public class FormatTest { */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -303,6 +299,7 @@ public class FormatTest { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -322,6 +319,7 @@ public class FormatTest { */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -341,6 +339,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -360,6 +359,7 @@ public class FormatTest { */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c218d0e02b8..196214695a1 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -40,6 +38,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -59,6 +58,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java index 9811806e0c8..7215fd65d7a 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -63,17 +62,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -94,6 +90,7 @@ public class MapTest { */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -121,6 +118,7 @@ public class MapTest { */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,6 +146,7 @@ public class MapTest { */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -175,6 +174,7 @@ public class MapTest { */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bcf0155a1b2..7dd078dbaa8 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -27,16 +27,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -49,6 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -68,6 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -95,6 +94,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java index 9ca96d114aa..32198c000f1 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Model200Response.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -41,6 +39,7 @@ public class Model200Response { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -60,6 +59,7 @@ public class Model200Response { */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java index 06c806057b5..0a803038551 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -43,6 +40,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -62,6 +60,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -81,6 +80,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java index f168748f6a2..c2ac56a57a7 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelList.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -37,6 +36,7 @@ public class ModelList { */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java index 641c56cd81c..83da161c83f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ModelReturn.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -38,6 +37,7 @@ public class ModelReturn { */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java index d6dcb665651..ed42396e815 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Name.java @@ -22,16 +22,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -61,6 +57,7 @@ public class Name { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -80,6 +77,7 @@ public class Name { */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -99,6 +97,7 @@ public class Name { */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property") public String getProperty() { return property; } @@ -118,6 +117,7 @@ public class Name { */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java index 4a3b6beffa2..1ec233732c3 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/NumberOnly.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -36,6 +35,7 @@ public class NumberOnly { */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java index 9a5b61bad43..9566edcbed8 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Order.java @@ -24,16 +24,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -74,10 +70,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -91,6 +85,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -110,6 +105,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -129,6 +125,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -148,6 +145,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -167,6 +165,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -186,6 +185,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java index b66d6d38afb..6b611504866 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/OuterComposite.java @@ -22,13 +22,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -42,6 +39,7 @@ public class OuterComposite { */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -61,6 +59,7 @@ public class OuterComposite { */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -80,6 +79,7 @@ public class OuterComposite { */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java index 6adaaba97d7..0e76707f06f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java @@ -29,22 +29,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -83,7 +78,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -114,6 +108,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -133,6 +128,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -152,6 +148,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -166,6 +163,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -176,6 +176,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -204,6 +205,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -223,6 +225,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 8c43e7e8c30..8891d8dac55 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -38,6 +36,7 @@ public class ReadOnlyFirst { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -57,6 +56,7 @@ public class ReadOnlyFirst { */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..c681122f5f8 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,155 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java index c3d3aa9182e..51dfdf9de43 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,11 +19,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -37,6 +36,7 @@ public class SpecialModelName { */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java index 03d5607e29b..b6dd153652a 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Tag.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -38,6 +36,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -57,6 +56,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java index 67ef036857d..c2217970131 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -24,21 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -71,6 +66,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -90,6 +86,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -109,6 +106,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -128,6 +126,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -142,6 +141,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -152,6 +154,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java index 5b77bee14c1..96efe9c2627 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -24,22 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -75,6 +69,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -94,6 +89,7 @@ public class TypeHolderExample { */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -113,6 +109,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -132,6 +129,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -151,6 +149,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -165,6 +164,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +176,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java index e09df9be7b7..cf6f9233680 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/User.java @@ -21,28 +21,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -56,6 +48,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -75,6 +68,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -94,6 +88,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -113,6 +108,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -132,6 +128,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -151,6 +148,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -170,6 +168,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -189,6 +188,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java index 1a4455cdaa8..cf49606e181 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java @@ -24,101 +24,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -131,6 +102,7 @@ public class XmlItem { */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -150,6 +122,7 @@ public class XmlItem { */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -169,6 +142,7 @@ public class XmlItem { */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -188,6 +162,7 @@ public class XmlItem { */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,6 +190,7 @@ public class XmlItem { */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -234,6 +210,7 @@ public class XmlItem { */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -253,6 +230,7 @@ public class XmlItem { */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -272,6 +250,7 @@ public class XmlItem { */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -291,6 +270,7 @@ public class XmlItem { */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -318,6 +298,7 @@ public class XmlItem { */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -345,6 +326,7 @@ public class XmlItem { */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -364,6 +346,7 @@ public class XmlItem { */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -383,6 +366,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -402,6 +386,7 @@ public class XmlItem { */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -421,6 +406,7 @@ public class XmlItem { */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -448,6 +434,7 @@ public class XmlItem { */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -475,6 +462,7 @@ public class XmlItem { */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -494,6 +482,7 @@ public class XmlItem { */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -513,6 +502,7 @@ public class XmlItem { */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -532,6 +522,7 @@ public class XmlItem { */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -551,6 +542,7 @@ public class XmlItem { */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -578,6 +570,7 @@ public class XmlItem { */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -605,6 +598,7 @@ public class XmlItem { */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -624,6 +618,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -643,6 +638,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -662,6 +658,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -681,6 +678,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -708,6 +706,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -735,6 +734,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java index 06109fa9bea..b0060f3ed53 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java @@ -31,27 +31,21 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ObjectWithUniqueItems { - @JsonProperty("nullSet") @Valid private JsonNullable> nullSet = JsonNullable.undefined(); - @JsonProperty("notNullSet") @Valid - private Set notNullSet = null; + private Set notNullSet; - @JsonProperty("nullList") @Valid private JsonNullable> nullList = JsonNullable.undefined(); - @JsonProperty("notNullList") @Valid - private List notNullList = null; + private List notNullList; - @JsonProperty("notNullDateField") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime notNullDateField; - @JsonProperty("nullDateField") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime nullDateField; @@ -74,6 +68,7 @@ public class ObjectWithUniqueItems { */ @Schema(name = "nullSet", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullSet") public JsonNullable> getNullSet() { return nullSet; } @@ -101,6 +96,7 @@ public class ObjectWithUniqueItems { */ @Schema(name = "notNullSet", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("notNullSet") public Set getNotNullSet() { return notNullSet; } @@ -129,6 +125,7 @@ public class ObjectWithUniqueItems { */ @Schema(name = "nullList", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullList") public JsonNullable> getNullList() { return nullList; } @@ -156,6 +153,7 @@ public class ObjectWithUniqueItems { */ @Schema(name = "notNullList", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("notNullList") public List getNotNullList() { return notNullList; } @@ -175,6 +173,7 @@ public class ObjectWithUniqueItems { */ @Valid @Schema(name = "notNullDateField", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("notNullDateField") public OffsetDateTime getNotNullDateField() { return notNullDateField; } @@ -194,6 +193,7 @@ public class ObjectWithUniqueItems { */ @Valid @Schema(name = "nullDateField", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullDateField") public OffsetDateTime getNullDateField() { return nullDateField; } diff --git a/samples/server/petstore/spring-stubs/.openapi-generator-ignore b/samples/server/petstore/spring-stubs/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/server/petstore/spring-stubs/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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/spring-stubs/.openapi-generator/FILES b/samples/server/petstore/spring-stubs/.openapi-generator/FILES deleted file mode 100644 index 87837793235..00000000000 --- a/samples/server/petstore/spring-stubs/.openapi-generator/FILES +++ /dev/null @@ -1,12 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/User.java diff --git a/samples/server/petstore/spring-stubs/README.md b/samples/server/petstore/spring-stubs/README.md deleted file mode 100644 index d43a1de307d..00000000000 --- a/samples/server/petstore/spring-stubs/README.md +++ /dev/null @@ -1,27 +0,0 @@ - -# OpenAPI generated API stub - -Spring Framework stub - - -## Overview -This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub. -This is an example of building API stub interfaces in Java using the Spring framework. - -The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints -by adding ```@Controller``` classes that implement the interface. Eg: -```java -@Controller -public class PetController implements PetApi { -// implement all PetApi methods -} -``` - -You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg: -```java -@FeignClient(name="pet", url="http://petstore.swagger.io/v2") -public interface PetClient extends PetApi { - -} -``` diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0cc..00000000000 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 9f5ef4d9f1a..00000000000 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A category for a pet - */ - -@ApiModel(description = "A category for a pet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @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; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 52fb11fd3cf..00000000000 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Describes the result of uploading an image resource - */ - -@ApiModel(description = "Describes the result of uploading an image resource") -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @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; - } - - /** - * Get type - * @return type - */ - - @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; - } - - /** - * Get message - * @return message - */ - - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 66d9df6dfd9..00000000000 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,246 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.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 org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * An order for a pets from the pet store - */ - -@ApiModel(description = "An order for a pets from the pet store") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @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; - } - - /** - * Get petId - * @return petId - */ - - @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; - } - - /** - * Get quantity - * @return quantity - */ - - @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; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @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; - } - - /** - * Order Status - * @return status - */ - - @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; - } - - /** - * Get complete - * @return complete - */ - - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index 60af3a5b92a..ce02f3c7d4e 100644 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -43,7 +43,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -165,6 +165,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index b30aa3fd9a2..00000000000 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A tag for a pet - */ - -@ApiModel(description = "A tag for a pet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @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; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES index 3c2e959bec0..946be002561 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -60,6 +61,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index 8995d90039c..8c874b16a53 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.openapitools + org.openapitools.openapi3 spring-boot-beanvalidation-no-nullable jar spring-boot-beanvalidation-no-nullable diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index d99760e9109..5062142aabc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 0ed853cb420..d4b40188873 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -90,7 +91,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +106,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +122,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +162,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +193,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -199,11 +204,49 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNames.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +264,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +275,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +294,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +305,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +325,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +486,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +506,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +515,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +549,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +569,6 @@ public interface FakeApi { ) 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 @@ -537,6 +580,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 5ae5d5fed98..9121a395182 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f75edffec9d..29a9e68dfd8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index c3163846ef2..ed8300a67c6 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -267,8 +269,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -298,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -345,6 +349,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index edb41f4d944..c653b7a2873 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 939a45adee8..5e03a940207 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 32dc0c3fd93..57be2f556f5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b030575ce32..f2e2533ad4a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index a0be618b483..f29e8fdc477 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 5f1460876f7..da623886687 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -25,45 +25,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private Object anytype2 = null; - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -85,6 +74,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -112,6 +102,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -139,6 +130,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -166,6 +158,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -193,6 +186,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -220,6 +214,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -247,6 +242,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -274,6 +270,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -293,6 +290,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -312,6 +310,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_2") public Object getAnytype2() { return anytype2; } @@ -331,6 +330,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 0b50eae9623..74f4c62dadf 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8777da8266d..cb4c419d891 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 3d723f313ba..1dd741d8228 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 8be627cf95e..1b33552ee8a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index c914c2141a7..94d7c88b983 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -9,9 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -71,6 +66,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -90,6 +86,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 8eb8b8652c9..015b113f171 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index c5b92b31b9d..6a29ab265a8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 0fb0d1f196d..7ff2226dd74 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -24,17 +24,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -55,6 +52,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -82,6 +80,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -109,6 +108,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index 5b4fd14d861..91cd349ca0a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -66,7 +66,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -96,6 +95,7 @@ public class BigCat extends Cat { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index 9eee7b14085..dd11506a903 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -63,7 +63,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -77,6 +76,7 @@ public class BigCatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index f2cd4ce28cf..96aca57f16f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -21,22 +21,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -50,6 +44,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -69,6 +64,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -88,6 +84,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -107,6 +104,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -126,6 +124,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,6 +144,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index aeb4370edc3..09a572598e3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -35,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -65,6 +63,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 649703382e4..fbde7c3a8dc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -37,6 +36,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index e7e940c65fc..f29b1ee05d3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -54,6 +52,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -73,6 +72,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index 2666fe6a16d..630599723ec 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -36,6 +35,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index a877f6b3ecc..12947bfa3d9 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -35,6 +34,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..862accc3be5 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,210 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private List nullableArray; + + @Valid + private List nullableRequiredArray; + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private List nullableArrayWithDefault = new ArrayList<>(Arrays.asList("foo", "bar")); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = nullableArray; + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null) { + this.nullableArray = new ArrayList<>(); + } + this.nullableArray.add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public List getNullableArray() { + return nullableArray; + } + + public void setNullableArray(List nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null) { + this.nullableRequiredArray = new ArrayList<>(); + } + this.nullableRequiredArray.add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public List getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null) { + this.nullableArrayWithDefault = new ArrayList<>(Arrays.asList("foo", "bar")); + } + this.nullableArrayWithDefault.add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public List getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return Objects.equals(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + Objects.equals(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + @Override + public int hashCode() { + return Objects.hash(nullableArray, nullableRequiredArray, requiredArray, nullableArrayWithDefault); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index 4a406912e6f..d15a20308b5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -56,6 +55,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 6e9cc3f76c8..c1ff31fcefc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -37,6 +36,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 6ec78baa173..36bbc2374aa 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -59,7 +59,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -97,9 +96,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -112,6 +110,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -139,6 +138,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 3779fa30d64..7d071f8a81f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -62,7 +62,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -102,7 +101,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -140,7 +138,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -178,10 +175,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -211,6 +206,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -230,6 +226,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -249,6 +246,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -268,6 +266,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -287,6 +286,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java index 3206bff2971..19a28937ff0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -36,6 +35,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index b233286eebc..514188584da 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -24,12 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -42,6 +40,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -69,6 +68,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index dcbbc7fbde7..b564b838092 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -29,48 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -105,6 +91,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -126,6 +113,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -145,6 +133,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -166,6 +155,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -187,6 +177,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -208,6 +199,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -227,6 +219,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -246,6 +239,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -265,6 +259,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -284,6 +279,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -303,6 +299,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -322,6 +319,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -341,6 +339,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -360,6 +359,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 36d854ff06c..aac0264cd7d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -40,6 +38,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -59,6 +58,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 7253ca7481e..70194d82f75 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -63,17 +62,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -94,6 +90,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -121,6 +118,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,6 +146,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -175,6 +174,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index ba027c67881..205b8049fef 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -27,16 +27,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -49,6 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -68,6 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -95,6 +94,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index fac227135b9..88fb0a01d34 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -41,6 +39,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -60,6 +59,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 6efe7c8047f..dd87a3c1b39 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -43,6 +40,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -62,6 +60,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -81,6 +80,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index dc9eb8ae525..4705ec66df4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -37,6 +36,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 4622b115826..997950759de 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -38,6 +37,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index d4d9ed411d9..c1efbf9ecdb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -22,16 +22,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -61,6 +57,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -80,6 +77,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -99,6 +97,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -118,6 +117,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index 33fadd6869b..7c96db2d2c5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -36,6 +35,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index 1ce3810c20d..4492c665a86 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -24,16 +24,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -74,10 +70,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -91,6 +85,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -110,6 +105,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -129,6 +125,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -148,6 +145,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -167,6 +165,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -186,6 +185,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index a590e26b3f1..10b8a8879a3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -22,13 +22,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -42,6 +39,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -61,6 +59,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -80,6 +79,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 51bf8f52196..db4b7dab2fc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -29,22 +29,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -83,7 +78,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -114,6 +108,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -133,6 +128,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -152,6 +148,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -179,6 +176,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -207,6 +205,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -226,6 +225,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index c09e0076810..2e16544e4cd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -38,6 +36,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -57,6 +56,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..386aaf06884 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,155 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 06b722ccf5f..25baeb0e45c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,11 +19,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -37,6 +36,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index 6ccb99b1e73..ea0574787c2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -38,6 +36,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -57,6 +56,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 00e1edd884b..1f070eb65c8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -24,21 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -71,6 +66,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -90,6 +86,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -109,6 +106,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -128,6 +126,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,7 +142,7 @@ public class TypeHolderDefault { public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); } this.arrayItem.add(arrayItemItem); return this; @@ -155,6 +154,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index ba77803deb7..19956d3114d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -24,22 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -75,6 +69,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -94,6 +89,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -113,6 +109,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -132,6 +129,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -151,6 +149,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -177,7 +176,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index e5180de1584..f9546be0278 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -21,28 +21,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -56,6 +48,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -75,6 +68,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -94,6 +88,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -113,6 +108,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -132,6 +128,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -151,6 +148,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -170,6 +168,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -189,6 +188,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 98a5e28e4dc..2a7c27a7a47 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -24,101 +24,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -131,6 +102,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -150,6 +122,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -169,6 +142,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -188,6 +162,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,6 +190,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -234,6 +210,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -253,6 +230,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -272,6 +250,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -291,6 +270,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -318,6 +298,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -345,6 +326,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -364,6 +346,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -383,6 +366,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -402,6 +386,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -421,6 +406,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -448,6 +434,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -475,6 +462,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -494,6 +482,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -513,6 +502,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -532,6 +522,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -551,6 +542,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -578,6 +570,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -605,6 +598,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -624,6 +618,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -643,6 +638,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -662,6 +658,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -681,6 +678,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -708,6 +706,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -735,6 +734,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES index d61b6cf83bf..d46ab21480e 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -60,6 +61,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java 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 d99760e9109..5062142aabc 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 @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 0ed853cb420..d4b40188873 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 @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -90,7 +91,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +106,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +122,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +162,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +193,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -199,11 +204,49 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNames.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +264,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +275,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +294,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +305,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +325,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +486,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +506,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +515,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +549,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +569,6 @@ public interface FakeApi { ) 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 @@ -537,6 +580,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) 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 5ae5d5fed98..9121a395182 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 @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; 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 f75edffec9d..29a9e68dfd8 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 @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 c3163846ef2..ed8300a67c6 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 @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -267,8 +269,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -298,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -345,6 +349,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) 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 edb41f4d944..c653b7a2873 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 @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 939a45adee8..5e03a940207 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 @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } 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 b5e88d5d7cc..34712a94057 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 @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,45 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +78,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +106,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +134,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +162,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +190,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +218,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +246,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +274,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +294,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -303,7 +304,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +314,12 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -332,6 +334,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java index d91e6d2ef40..eb7bf417abb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java @@ -9,9 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -39,10 +36,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -72,6 +67,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -91,6 +87,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java index e9a1391ec0d..077f6becae1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java @@ -67,7 +67,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -97,6 +96,7 @@ public class BigCat extends Cat { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java index 35ae937c000..59ab1d8d2bf 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -64,7 +64,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -78,6 +77,7 @@ public class BigCatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java index ebd1416c5bd..61a00a120ad 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -36,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -66,6 +64,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..5da3d386b4d --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } 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 d97a088a267..e1106056505 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 @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } 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 02620d04526..15988169280 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 @@ -30,22 +30,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -84,7 +79,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -115,6 +109,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -134,6 +129,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -153,6 +149,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -167,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -177,6 +177,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -205,6 +206,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -224,6 +226,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..187960e94e4 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,156 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..bf67444d3cb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..da676b10f0d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,21 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } 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 068f9dc83fd..bbc653f248a 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 @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES index 07f63a0e8be..5789fc3c295 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -44,6 +44,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -66,6 +67,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java 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 d39ddcd6088..7367e5c7811 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 @@ -31,7 +31,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,9 +51,9 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().call123testSpecialTags(body); + return getDelegate().call123testSpecialTags(client); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 2d5e24bcd5f..740965f1686 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -27,11 +27,11 @@ public interface AnotherFakeApiDelegate { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client body) { + default ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 1c788a36634..9822c644225 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 @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -85,7 +86,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -98,7 +100,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -114,12 +116,13 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { - return getDelegate().fakeOuterCompositeSerialize(body); + return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -143,7 +146,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -172,7 +176,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -181,11 +186,39 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNames.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + ) { + return getDelegate().responseObjectDifferentNames(petId); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -203,9 +236,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { - return getDelegate().testBodyWithFileSchema(body); + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -213,7 +246,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -232,9 +265,9 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { - return getDelegate().testBodyWithQueryParams(query, body); + return getDelegate().testBodyWithQueryParams(query, user); } @@ -242,7 +275,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -262,9 +295,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClientModel(body); + return getDelegate().testClientModel(client); } @@ -410,8 +443,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -429,14 +463,15 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { - return getDelegate().testInlineAdditionalProperties(param); + return getDelegate().testInlineAdditionalProperties(requestBody); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -469,7 +504,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -490,17 +524,17 @@ public interface FakeApi { ) 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); + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java index 726b17779f1..b88f6171955 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; 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 2cd684b90f5..65ea3c13eae 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 @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -63,11 +64,11 @@ public interface FakeApiDelegate { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -107,15 +108,36 @@ public interface FakeApiDelegate { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + * @see FakeApi#responseObjectDifferentNames + */ + default ResponseEntity responseObjectDifferentNames(Long petId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -124,12 +146,12 @@ public interface FakeApiDelegate { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ default ResponseEntity testBodyWithQueryParams(String query, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,11 +160,11 @@ public interface FakeApiDelegate { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client body) { + default ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -249,18 +271,20 @@ public interface FakeApiDelegate { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - default ResponseEntity testInlineAdditionalProperties(Map param) { + default ResponseEntity testInlineAdditionalProperties(Map requestBody) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -278,7 +302,6 @@ public interface FakeApiDelegate { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -286,7 +309,6 @@ public interface FakeApiDelegate { * @see FakeApi#testQueryParameterCollectionFormat */ default ResponseEntity testQueryParameterCollectionFormat(List pipe, - List ioutil, List http, List url, List context) { @@ -296,6 +318,7 @@ public interface FakeApiDelegate { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) 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 59411b8c52a..92264475191 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 @@ -31,7 +31,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -54,9 +54,9 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClassname(body); + return getDelegate().testClassname(client); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index fb689b13f94..a15fd1b7728 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -27,11 +27,11 @@ public interface FakeClassnameTestApiDelegate { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client body) { + default ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 eb44fc72e25..958bc1d2011 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 @@ -31,8 +31,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -58,14 +59,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().addPet(body); + return getDelegate().addPet(pet); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -216,8 +218,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -247,14 +250,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().updatePet(body); + return getDelegate().updatePet(pet); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -292,6 +296,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index 1e9ad7f94f4..aded0c3fefc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -27,19 +27,21 @@ public interface PetApiDelegate { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) * @see PetApi#addPet */ - default ResponseEntity addPet(Pet body) { + default ResponseEntity addPet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -142,21 +144,23 @@ public interface PetApiDelegate { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) * @see PetApi#updatePet */ - default ResponseEntity updatePet(Pet body) { + default ResponseEntity updatePet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -173,6 +177,7 @@ public interface PetApiDelegate { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) 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 3044e2268ed..3123d2335e2 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 @@ -124,8 +124,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -143,12 +144,13 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { - return getDelegate().placeOrder(body); + return getDelegate().placeOrder(order); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index c4c812a9bb2..84623f79f76 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -81,13 +81,14 @@ public interface StoreApiDelegate { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order body) { + default ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 0de57c58ae4..619c391ea11 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 @@ -33,7 +33,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -47,19 +47,21 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().createUser(body); + return getDelegate().createUser(user); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -73,19 +75,21 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithArrayInput(body); + return getDelegate().createUsersWithArrayInput(user); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -99,12 +103,13 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithListInput(body); + return getDelegate().createUsersWithListInput(user); } @@ -139,6 +144,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -171,6 +177,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -203,6 +210,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -231,7 +239,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -247,13 +255,14 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().updateUser(username, body); + return getDelegate().updateUser(username, user); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index c39231c6b29..f0630c08541 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -29,35 +29,37 @@ public interface UserApiDelegate { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) * @see UserApi#createUser */ - default ResponseEntity createUser(User body) { + default ResponseEntity createUser(User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - default ResponseEntity createUsersWithArrayInput(List body) { + default ResponseEntity createUsersWithArrayInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - default ResponseEntity createUsersWithListInput(List body) { + default ResponseEntity createUsersWithListInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,6 +80,7 @@ public interface UserApiDelegate { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -106,6 +109,7 @@ public interface UserApiDelegate { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -121,6 +125,7 @@ public interface UserApiDelegate { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) * @see UserApi#logoutUser @@ -135,13 +140,13 @@ public interface UserApiDelegate { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) * @see UserApi#updateUser */ default ResponseEntity updateUser(String username, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } 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 b5e88d5d7cc..34712a94057 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 @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,45 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +78,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +106,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +134,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +162,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +190,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +218,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +246,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +274,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +294,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -303,7 +304,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +314,12 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -332,6 +334,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java index d91e6d2ef40..eb7bf417abb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java @@ -9,9 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -39,10 +36,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -72,6 +67,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -91,6 +87,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java index e9a1391ec0d..077f6becae1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java @@ -67,7 +67,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -97,6 +96,7 @@ public class BigCat extends Cat { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java index 35ae937c000..59ab1d8d2bf 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -64,7 +64,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -78,6 +77,7 @@ public class BigCatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java index ebd1416c5bd..61a00a120ad 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -36,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -66,6 +64,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..5da3d386b4d --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } 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 d97a088a267..e1106056505 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 @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } 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 02620d04526..15988169280 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 @@ -30,22 +30,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -84,7 +79,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -115,6 +109,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -134,6 +129,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -153,6 +149,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -167,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -177,6 +177,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -205,6 +206,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -224,6 +226,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..187960e94e4 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,156 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..bf67444d3cb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..da676b10f0d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,21 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } 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 068f9dc83fd..bbc653f248a 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 @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator-ignore b/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator-ignore rename to samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator-ignore diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/FILES new file mode 100644 index 00000000000..4e2214f1e7f --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/FILES @@ -0,0 +1,26 @@ +README.md +pom.xml +src/main/java/org/openapitools/OpenApiGeneratorApplication.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/PetApiDelegate.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/StoreApiDelegate.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/api/UserApiDelegate.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java +src/main/resources/application.properties +src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/VERSION new file mode 100644 index 00000000000..757e6740040 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/README.md b/samples/server/petstore/springboot-delegate-no-response-entity/README.md new file mode 100644 index 00000000000..54292416f46 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/README.md @@ -0,0 +1,27 @@ +# OpenAPI generated server + +Spring Boot Server + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. +This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:8080/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + + +Start your server as a simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:8080/swagger-ui.html + +Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/spring-stubs/pom.xml b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml similarity index 90% rename from samples/server/petstore/spring-stubs/pom.xml rename to samples/server/petstore/springboot-delegate-no-response-entity/pom.xml index c7768e6f120..3800e554f56 100644 --- a/samples/server/petstore/spring-stubs/pom.xml +++ b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml @@ -1,9 +1,9 @@ 4.0.0 org.openapitools - spring-stubs + springboot-delegate-no-response-entity jar - spring-stubs + springboot-delegate-no-response-entity 1.0.0 1.8 @@ -21,6 +21,12 @@ src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/OpenApiGeneratorApplication.java similarity index 100% rename from samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/OpenApiGeneratorApplication.java diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/RFC3339DateFormat.java similarity index 100% rename from samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/RFC3339DateFormat.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/RFC3339DateFormat.java diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/ApiUtil.java similarity index 100% rename from samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/ApiUtil.java diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java similarity index 78% rename from samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java index f6879b1e220..83b7e3b5ae3 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java @@ -9,19 +9,14 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -29,17 +24,24 @@ import javax.annotation.Generated; @Api(value = "pet", description = "Everything about your Pets") public interface PetApi { + default PetApiDelegate getDelegate() { + return new PetApiDelegate() {}; + } + /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid input (status code 405) + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) */ @ApiOperation( tags = { "pet" }, value = "Add a new pet to the store", nickname = "addPet", notes = "", + response = Pet.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -48,20 +50,26 @@ public interface PetApi { } ) @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping( method = RequestMethod.POST, value = "/pet", - consumes = "application/json" + produces = { "application/xml", "application/json" }, + consumes = { "application/json", "application/xml" } ) - CompletableFuture> addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + @ResponseStatus(HttpStatus.OK) + default Pet addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet + ) { + return getDelegate().addPet(pet); + } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -86,10 +94,13 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) - CompletableFuture> deletePet( + @ResponseStatus(HttpStatus.BAD_REQUEST) + default Void deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ); + ) { + return getDelegate().deletePet(petId, apiKey); + } /** @@ -109,7 +120,6 @@ public interface PetApi { responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) } @@ -121,11 +131,14 @@ public interface PetApi { @RequestMapping( method = RequestMethod.GET, value = "/pet/findByStatus", - produces = "application/json" + produces = { "application/xml", "application/json" } ) - CompletableFuture>> findPetsByStatus( + @ResponseStatus(HttpStatus.OK) + default List findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ); + ) { + return getDelegate().findPetsByStatus(status); + } /** @@ -147,7 +160,6 @@ public interface PetApi { responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) } @@ -159,11 +171,14 @@ public interface PetApi { @RequestMapping( method = RequestMethod.GET, value = "/pet/findByTags", - produces = "application/json" + produces = { "application/xml", "application/json" } ) - CompletableFuture>> findPetsByTags( + @ResponseStatus(HttpStatus.OK) + default List findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags - ); + ) { + return getDelegate().findPetsByTags(tags); + } /** @@ -193,26 +208,34 @@ public interface PetApi { @RequestMapping( method = RequestMethod.GET, value = "/pet/{petId}", - produces = "application/json" + produces = { "application/xml", "application/json" } ) - CompletableFuture> getPetById( + @ResponseStatus(HttpStatus.OK) + default Pet getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ); + ) { + return getDelegate().getPetById(petId); + } /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid ID supplied (status code 400) + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) + * API documentation for the updatePet operation + * @see Update an existing pet Documentation */ @ApiOperation( tags = { "pet" }, value = "Update an existing pet", nickname = "updatePet", notes = "", + response = Pet.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -221,6 +244,7 @@ public interface PetApi { } ) @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") @@ -228,15 +252,20 @@ public interface PetApi { @RequestMapping( method = RequestMethod.PUT, value = "/pet", - consumes = "application/json" + produces = { "application/xml", "application/json" }, + consumes = { "application/json", "application/xml" } ) - CompletableFuture> updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ); + @ResponseStatus(HttpStatus.OK) + default Pet updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet + ) { + return getDelegate().updatePet(pet); + } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -261,17 +290,21 @@ public interface PetApi { @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}", - consumes = "application/x-www-form-urlencoded" + consumes = { "application/x-www-form-urlencoded" } ) - CompletableFuture> updatePetWithForm( + @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) + default Void updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status - ); + ) { + return getDelegate().updatePetWithForm(petId, name, status); + } /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -297,13 +330,16 @@ public interface PetApi { @RequestMapping( method = RequestMethod.POST, value = "/pet/{petId}/uploadImage", - produces = "application/json", - consumes = "multipart/form-data" + produces = { "application/json" }, + consumes = { "multipart/form-data" } ) - CompletableFuture> uploadFile( + @ResponseStatus(HttpStatus.OK) + default ModelApiResponse uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ); + ) { + return getDelegate().uploadFile(petId, additionalMetadata, file); + } } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiController.java similarity index 95% rename from samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiController.java index 5ef3de965ff..6c1fa31b180 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiController.java @@ -2,13 +2,11 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; -import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiDelegate.java new file mode 100644 index 00000000000..77436bc931e --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -0,0 +1,231 @@ +package org.openapitools.api; + +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link PetApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public interface PetApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /pet : Add a new pet to the store + * + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + * @see PetApi#addPet + */ + default Pet addPet(Pet pet) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + default Void deletePet(Long petId, + String apiKey) { + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * GET /pet/findByStatus : 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 (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + default List findPetsByStatus(List status) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * GET /pet/findByTags : 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 (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + @Deprecated + default List findPetsByTags(List tags) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + default Pet getPetById(Long petId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * PUT /pet : Update an existing pet + * + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * API documentation for the updatePet operation + * @see Update an existing pet Documentation + * @see PetApi#updatePet + */ + default Pet updatePet(Pet pet) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + default Void updatePetWithForm(Long petId, + String name, + String status) { + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + default ModelApiResponse uploadFile(Long petId, + String additionalMetadata, + MultipartFile file) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + throw new IllegalArgumentException("Not implemented"); + + } + +} diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java similarity index 82% rename from samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java index 208cdb98af7..45ba57eb387 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java @@ -9,18 +9,14 @@ import java.util.Map; import org.openapitools.model.Order; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -28,6 +24,10 @@ import javax.annotation.Generated; @Api(value = "store", description = "Access to Petstore orders") public interface StoreApi { + default StoreApiDelegate getDelegate() { + return new StoreApiDelegate() {}; + } + /** * DELETE /store/order/{orderId} : Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -50,9 +50,12 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) - ResponseEntity deleteOrder( + @ResponseStatus(HttpStatus.BAD_REQUEST) + default Void deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId - ); + ) { + return getDelegate().deleteOrder(orderId); + } /** @@ -78,11 +81,14 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.GET, value = "/store/inventory", - produces = "application/json" + produces = { "application/json" } ) - ResponseEntity> getInventory( + @ResponseStatus(HttpStatus.OK) + default Map getInventory( - ); + ) { + return getDelegate().getInventory(); + } /** @@ -109,17 +115,21 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.GET, value = "/store/order/{orderId}", - produces = "application/json" + produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById( + @ResponseStatus(HttpStatus.OK) + default Order getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId - ); + ) { + return getDelegate().getOrderById(orderId); + } /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -137,10 +147,14 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = "application/json" + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) - ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ); + @ResponseStatus(HttpStatus.OK) + default Order placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order + ) { + return getDelegate().placeOrder(order); + } } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiController.java similarity index 96% rename from samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiController.java index e9e29a41b4f..c2133b27e23 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiController.java @@ -7,7 +7,6 @@ import org.openapitools.model.Order; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiDelegate.java similarity index 50% rename from samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiDelegate.java index 1c41a9d94ab..c21d319e495 100644 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -1,32 +1,23 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ package org.openapitools.api; import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; -import javax.validation.Valid; -import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; import javax.annotation.Generated; +/** + * A delegate to be called by the {@link StoreApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "store", description = "Access to Petstore orders") -public interface StoreApi { +public interface StoreApiDelegate { default Optional getRequest() { return Optional.empty(); @@ -39,62 +30,25 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) + * @see StoreApi#deleteOrder */ - @ApiOperation( - tags = { "store" }, - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{orderId}" - ) - default ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + default Void deleteOrder(String orderId) { + throw new IllegalArgumentException("Not implemented"); } - /** * GET /store/inventory : Returns pet inventories by status * Returns a map of status codes to quantities * * @return successful operation (status code 200) + * @see StoreApi#getInventory */ - @ApiOperation( - tags = { "store" }, - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Integer.class, - responseContainer = "Map", - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = "application/json" - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + default Map getInventory() { + throw new IllegalArgumentException("Not implemented"); } - /** * GET /store/order/{orderId} : Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -103,27 +57,9 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Order not found (status code 404) + * @see StoreApi#getOrderById */ - @ApiOperation( - tags = { "store" }, - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{orderId}", - produces = "application/json" - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId - ) { + default Order getOrderById(Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -138,37 +74,20 @@ public interface StoreApi { } } }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + throw new IllegalArgumentException("Not implemented"); } - /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) + * @see StoreApi#placeOrder */ - @ApiOperation( - tags = { "store" }, - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = "application/json" - ) - default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { + default Order placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -183,7 +102,7 @@ public interface StoreApi { } } }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + throw new IllegalArgumentException("Not implemented"); } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java similarity index 68% rename from samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java index 28cf4f38725..98525dd6043 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java @@ -10,18 +10,14 @@ import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -import java.util.Optional; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @@ -29,77 +25,104 @@ import javax.annotation.Generated; @Api(value = "user", description = "Operations about user") public interface UserApi { + default UserApiDelegate getDelegate() { + return new UserApiDelegate() {}; + } + /** * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( tags = { "user" }, value = "Create user", nickname = "createUser", - notes = "This can only be done by the logged in user." + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + } ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) - ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ); + @ResponseStatus(HttpStatus.OK) + default Void createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user + ) { + return getDelegate().createUser(user); + } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( tags = { "user" }, value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", - notes = "" + notes = "", + authorizations = { + @Authorization(value = "api_key") + } ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) - ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ); + @ResponseStatus(HttpStatus.OK) + default Void createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user + ) { + return getDelegate().createUsersWithArrayInput(user); + } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( tags = { "user" }, value = "Creates list of users with given input array", nickname = "createUsersWithListInput", - notes = "" + notes = "", + authorizations = { + @Authorization(value = "api_key") + } ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) - ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ); + @ResponseStatus(HttpStatus.OK) + default Void createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user + ) { + return getDelegate().createUsersWithListInput(user); + } /** @@ -114,7 +137,10 @@ public interface UserApi { tags = { "user" }, value = "Delete user", nickname = "deleteUser", - notes = "This can only be done by the logged in user." + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + } ) @ApiResponses({ @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -124,13 +150,17 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) - ResponseEntity deleteUser( + @ResponseStatus(HttpStatus.BAD_REQUEST) + default Void deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ); + ) { + return getDelegate().deleteUser(username); + } /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -152,15 +182,19 @@ public interface UserApi { @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", - produces = "application/json" + produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName( + @ResponseStatus(HttpStatus.OK) + default User getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ); + ) { + return getDelegate().getUserByName(username); + } /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -181,16 +215,20 @@ public interface UserApi { @RequestMapping( method = RequestMethod.GET, value = "/user/login", - produces = "application/json" + produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @ResponseStatus(HttpStatus.OK) + default String loginUser( + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ); + ) { + return getDelegate().loginUser(username, password); + } /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -198,7 +236,10 @@ public interface UserApi { tags = { "user" }, value = "Logs out current logged in user session", nickname = "logoutUser", - notes = "" + notes = "", + authorizations = { + @Authorization(value = "api_key") + } ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") @@ -207,32 +248,12 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) - ResponseEntity logoutUser( + @ResponseStatus(HttpStatus.OK) + default Void logoutUser( - ); - - - /** - * OPTIONS /user/logout : logoutUserOptions - * - * @return endpoint configuration response (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "logoutUserOptions", - nickname = "logoutUserOptions", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "endpoint configuration response") - }) - @RequestMapping( - method = RequestMethod.OPTIONS, - value = "/user/logout" - ) - ResponseEntity logoutUserOptions( - - ); + ) { + return getDelegate().logoutUser(); + } /** @@ -240,7 +261,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -248,7 +269,10 @@ public interface UserApi { tags = { "user" }, value = "Updated user", nickname = "updateUser", - notes = "This can only be done by the logged in user." + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + } ) @ApiResponses({ @ApiResponse(code = 400, message = "Invalid user supplied"), @@ -256,11 +280,15 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) - ResponseEntity updateUser( + @ResponseStatus(HttpStatus.BAD_REQUEST) + default Void updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ); + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user + ) { + return getDelegate().updateUser(username, user); + } } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiController.java similarity index 96% rename from samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiController.java index 1b48d4a9444..5c854245036 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiController.java @@ -8,7 +8,6 @@ import org.openapitools.model.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiDelegate.java new file mode 100644 index 00000000000..4e0a9f3fed4 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -0,0 +1,153 @@ +package org.openapitools.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link UserApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public interface UserApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + default Void createUser(User user) { + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + default Void createUsersWithArrayInput(List user) { + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * + * @param user List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + default Void createUsersWithListInput(List user) { + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + default Void deleteUser(String username) { + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * GET /user/{username} : Get user by user name + * + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + default User getUserByName(String username) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * GET /user/login : Logs user into the system + * + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + default String loginUser(String username, + String password) { + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * GET /user/logout : Logs out current logged in user session + * + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + default Void logoutUser() { + throw new IllegalArgumentException("Not implemented"); + + } + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + default Void updateUser(String username, + User user) { + throw new IllegalArgumentException("Not implemented"); + + } + +} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/HomeController.java similarity index 69% rename from samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/HomeController.java index 9aa29284ab5..e390f86f5b7 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/HomeController.java @@ -12,6 +12,14 @@ import org.springframework.web.bind.annotation.GetMapping; @Controller public class HomeController { + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + @RequestMapping("/") public String index() { return "redirect:swagger-ui.html"; diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java new file mode 100644 index 00000000000..1fc96305a3e --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -0,0 +1,71 @@ +package org.openapitools.configuration; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import org.springframework.web.util.UriComponentsBuilder; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.paths.Paths; +import springfox.documentation.spring.web.paths.RelativePathProvider; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import javax.annotation.Generated; +import javax.servlet.ServletContext; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Configuration +@EnableSwagger2 +public class SpringFoxConfiguration { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .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("Apache-2.0") + .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "")) + .build(); + } + + @Bean + public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) + .build() + .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) + .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + + class BasePathAwareRelativePathProvider extends RelativePathProvider { + private String basePath; + + public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { + super(servletContext); + this.basePath = basePath; + } + + @Override + protected String applicationPath() { + return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); + } + + @Override + public String getOperationPath(String operationPath) { + UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); + return Paths.removeAdjacentForwardSlashes( + uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); + } + } + +} diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java similarity index 96% rename from samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java index 9f5ef4d9f1a..4a167e1c112 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -40,6 +38,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -57,8 +56,9 @@ public class Category { * Get name * @return name */ - + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java similarity index 100% rename from samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java index 52fb11fd3cf..a6a56521498 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -25,13 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -45,6 +42,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -64,6 +62,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -83,6 +82,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java similarity index 100% rename from samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java index 66d9df6dfd9..45802212a9d 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java @@ -26,16 +26,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -76,10 +72,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -93,6 +87,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -112,6 +107,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -131,6 +127,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -150,6 +147,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -169,6 +167,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -188,6 +187,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java similarity index 82% rename from samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java index 6adaaba97d7..086df08a3ed 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java @@ -5,46 +5,40 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; -import java.util.LinkedHashSet; import java.util.List; -import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; import javax.annotation.Generated; /** - * Pet + * A pet for sale in the pet store */ +@ApiModel(description = "A pet for sale in the pet store") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid - private Set photoUrls = new LinkedHashSet<>(); + private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -83,12 +77,11 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** * Default constructor - * @deprecated Use {@link Pet#Pet(String, Set)} + * @deprecated Use {@link Pet#Pet(String, List)} */ @Deprecated public Pet() { @@ -98,7 +91,7 @@ public class Pet { /** * Constructor with only required parameters */ - public Pet(String name, Set photoUrls) { + public Pet(String name, List photoUrls) { this.name = name; this.photoUrls = photoUrls; } @@ -113,7 +106,8 @@ public class Pet { * @return id */ - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -132,7 +126,8 @@ public class Pet { * @return category */ @Valid - @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -151,7 +146,8 @@ public class Pet { * @return name */ @NotNull - @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -160,12 +156,15 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -175,13 +174,13 @@ public class Pet { * @return photoUrls */ @NotNull - @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) - public Set getPhotoUrls() { + @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") + public List getPhotoUrls() { return photoUrls; } - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -203,7 +202,8 @@ public class Pet { * @return tags */ @Valid - @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -222,7 +222,8 @@ public class Pet { * @return status */ - @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java similarity index 100% rename from samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java index b30aa3fd9a2..b6d3df29573 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -40,6 +38,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -59,6 +58,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java similarity index 100% rename from samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java index 8d71f0fcc04..a5233b08ae5 100644 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java @@ -23,28 +23,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -58,6 +50,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -77,6 +70,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -96,6 +90,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -115,6 +110,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -134,6 +130,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -153,6 +150,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -172,6 +170,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -191,6 +190,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/application.properties similarity index 87% rename from samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties rename to samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/application.properties index 9d06609db66..7e90813e59b 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/application.properties @@ -1,3 +1,3 @@ -server.port=80 +server.port=8080 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..65092456cbd --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/openapi.yaml @@ -0,0 +1,880 @@ +openapi: 3.0.0 +info: + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io +servers: +- url: http://petstore.swagger.io/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: pet + put: + description: "" + externalDocs: + description: API documentation for the updatePet operation + url: http://petstore.swagger.io/v2/doc/updatePet + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + 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-content-type: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: store + /store/order/{orderId}: + 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 + explode: false + in: path + name: orderId + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: orderId + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - api_key: [] + summary: Delete user + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + security: + - api_key: [] + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: user +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Order: + 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: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: + format: int64 + type: integer + name: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + title: Pet category + type: object + xml: + name: Category + User: + 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: + format: int64 + type: integer + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + title: a User + type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet Tag + type: object + xml: + name: Tag + Pet: + 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: + format: int64 + type: integer + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + deprecated: true + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + title: a Pet + type: object + xml: + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + title: An uploaded response + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/static/swagger-ui.html new file mode 100644 index 00000000000..f85b6654f67 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
    + + + + + + diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java similarity index 100% rename from samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java rename to samples/server/petstore/springboot-delegate-no-response-entity/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES index 07f63a0e8be..5789fc3c295 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -44,6 +44,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -66,6 +67,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java 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 d39ddcd6088..7367e5c7811 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 @@ -31,7 +31,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,9 +51,9 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().call123testSpecialTags(body); + return getDelegate().call123testSpecialTags(client); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 2d5e24bcd5f..740965f1686 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -27,11 +27,11 @@ public interface AnotherFakeApiDelegate { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client body) { + default ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 1c788a36634..9822c644225 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 @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -85,7 +86,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -98,7 +100,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -114,12 +116,13 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { - return getDelegate().fakeOuterCompositeSerialize(body); + return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -143,7 +146,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -172,7 +176,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -181,11 +186,39 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNames.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + ) { + return getDelegate().responseObjectDifferentNames(petId); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -203,9 +236,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { - return getDelegate().testBodyWithFileSchema(body); + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -213,7 +246,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -232,9 +265,9 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { - return getDelegate().testBodyWithQueryParams(query, body); + return getDelegate().testBodyWithQueryParams(query, user); } @@ -242,7 +275,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -262,9 +295,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClientModel(body); + return getDelegate().testClientModel(client); } @@ -410,8 +443,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -429,14 +463,15 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { - return getDelegate().testInlineAdditionalProperties(param); + return getDelegate().testInlineAdditionalProperties(requestBody); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -469,7 +504,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -490,17 +524,17 @@ public interface FakeApi { ) 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); + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) 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 726b17779f1..b88f6171955 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 @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; 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 2cd684b90f5..65ea3c13eae 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 @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -63,11 +64,11 @@ public interface FakeApiDelegate { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -107,15 +108,36 @@ public interface FakeApiDelegate { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + * @see FakeApi#responseObjectDifferentNames + */ + default ResponseEntity responseObjectDifferentNames(Long petId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -124,12 +146,12 @@ public interface FakeApiDelegate { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ default ResponseEntity testBodyWithQueryParams(String query, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,11 +160,11 @@ public interface FakeApiDelegate { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client body) { + default ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -249,18 +271,20 @@ public interface FakeApiDelegate { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - default ResponseEntity testInlineAdditionalProperties(Map param) { + default ResponseEntity testInlineAdditionalProperties(Map requestBody) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -278,7 +302,6 @@ public interface FakeApiDelegate { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -286,7 +309,6 @@ public interface FakeApiDelegate { * @see FakeApi#testQueryParameterCollectionFormat */ default ResponseEntity testQueryParameterCollectionFormat(List pipe, - List ioutil, List http, List url, List context) { @@ -296,6 +318,7 @@ public interface FakeApiDelegate { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) 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 59411b8c52a..92264475191 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 @@ -31,7 +31,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -54,9 +54,9 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClassname(body); + return getDelegate().testClassname(client); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index fb689b13f94..a15fd1b7728 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -27,11 +27,11 @@ public interface FakeClassnameTestApiDelegate { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client body) { + default ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 eb44fc72e25..958bc1d2011 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 @@ -31,8 +31,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -58,14 +59,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().addPet(body); + return getDelegate().addPet(pet); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -216,8 +218,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -247,14 +250,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().updatePet(body); + return getDelegate().updatePet(pet); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -292,6 +296,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index 1e9ad7f94f4..aded0c3fefc 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -27,19 +27,21 @@ public interface PetApiDelegate { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) * @see PetApi#addPet */ - default ResponseEntity addPet(Pet body) { + default ResponseEntity addPet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -142,21 +144,23 @@ public interface PetApiDelegate { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) * @see PetApi#updatePet */ - default ResponseEntity updatePet(Pet body) { + default ResponseEntity updatePet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -173,6 +177,7 @@ public interface PetApiDelegate { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) 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 3044e2268ed..3123d2335e2 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 @@ -124,8 +124,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -143,12 +144,13 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { - return getDelegate().placeOrder(body); + return getDelegate().placeOrder(order); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index c4c812a9bb2..84623f79f76 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -81,13 +81,14 @@ public interface StoreApiDelegate { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order body) { + default ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 0de57c58ae4..619c391ea11 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 @@ -33,7 +33,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -47,19 +47,21 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().createUser(body); + return getDelegate().createUser(user); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -73,19 +75,21 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithArrayInput(body); + return getDelegate().createUsersWithArrayInput(user); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -99,12 +103,13 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithListInput(body); + return getDelegate().createUsersWithListInput(user); } @@ -139,6 +144,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -171,6 +177,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -203,6 +210,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -231,7 +239,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -247,13 +255,14 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().updateUser(username, body); + return getDelegate().updateUser(username, user); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index c39231c6b29..f0630c08541 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -29,35 +29,37 @@ public interface UserApiDelegate { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) * @see UserApi#createUser */ - default ResponseEntity createUser(User body) { + default ResponseEntity createUser(User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - default ResponseEntity createUsersWithArrayInput(List body) { + default ResponseEntity createUsersWithArrayInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - default ResponseEntity createUsersWithListInput(List body) { + default ResponseEntity createUsersWithListInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,6 +80,7 @@ public interface UserApiDelegate { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -106,6 +109,7 @@ public interface UserApiDelegate { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -121,6 +125,7 @@ public interface UserApiDelegate { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) * @see UserApi#logoutUser @@ -135,13 +140,13 @@ public interface UserApiDelegate { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) * @see UserApi#updateUser */ default ResponseEntity updateUser(String username, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } 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 b5e88d5d7cc..34712a94057 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 @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,45 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +78,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +106,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +134,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +162,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +190,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +218,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +246,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +274,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +294,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -303,7 +304,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +314,12 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -332,6 +334,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index d91e6d2ef40..eb7bf417abb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -9,9 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -39,10 +36,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -72,6 +67,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -91,6 +87,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java index e9a1391ec0d..077f6becae1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java @@ -67,7 +67,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -97,6 +96,7 @@ public class BigCat extends Cat { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java index 35ae937c000..59ab1d8d2bf 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -64,7 +64,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -78,6 +77,7 @@ public class BigCatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java index ebd1416c5bd..61a00a120ad 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -36,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -66,6 +64,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..5da3d386b4d --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } 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 d97a088a267..e1106056505 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 @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } 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 02620d04526..15988169280 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 @@ -30,22 +30,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -84,7 +79,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -115,6 +109,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -134,6 +129,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -153,6 +149,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -167,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -177,6 +177,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -205,6 +206,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -224,6 +226,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..187960e94e4 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,156 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..bf67444d3cb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..da676b10f0d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,21 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } 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 068f9dc83fd..bbc653f248a 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 @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Category.java index 0d2e56dfa3d..d48f33e470b 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Category.java @@ -20,10 +20,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Category id(Long id) { @@ -36,6 +34,7 @@ public class Category { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -54,6 +53,7 @@ public class Category { * @return name */ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/ModelApiResponse.java index f66ed8b5941..5376fa62cc3 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -22,13 +22,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -41,6 +38,7 @@ public class ModelApiResponse { * @return code */ + @JsonProperty("code") public Integer getCode() { return code; } @@ -59,6 +57,7 @@ public class ModelApiResponse { * @return type */ + @JsonProperty("type") public String getType() { return type; } @@ -77,6 +76,7 @@ public class ModelApiResponse { * @return message */ + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Order.java index aafcfc0cc19..ad7ddb21736 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Order.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -73,10 +69,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -89,6 +83,7 @@ public class Order { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -107,6 +102,7 @@ public class Order { * @return petId */ + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -125,6 +121,7 @@ public class Order { * @return quantity */ + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -143,6 +140,7 @@ public class Order { * @return shipDate */ @Valid + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -161,6 +159,7 @@ public class Order { * @return status */ + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -179,6 +178,7 @@ public class Order { * @return complete */ + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java index 4f55bcef672..f72251ebac0 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java @@ -25,22 +25,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -79,7 +74,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -109,6 +103,7 @@ public class Pet { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -127,6 +122,7 @@ public class Pet { * @return category */ @Valid + @JsonProperty("category") public Category getCategory() { return category; } @@ -145,6 +141,7 @@ public class Pet { * @return name */ @NotNull + @JsonProperty("name") public String getName() { return name; } @@ -159,6 +156,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -168,6 +168,7 @@ public class Pet { * @return photoUrls */ @NotNull + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -194,6 +195,7 @@ public class Pet { * @return tags */ @Valid + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -212,6 +214,7 @@ public class Pet { * @return status */ + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Tag.java index 32f55514e08..ae8b17e7792 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Tag.java @@ -20,10 +20,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -36,6 +34,7 @@ public class Tag { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -54,6 +53,7 @@ public class Tag { * @return name */ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/User.java index 16f35830e84..f825d42b636 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/User.java @@ -20,28 +20,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -54,6 +46,7 @@ public class User { * @return id */ + @JsonProperty("id") public Long getId() { return id; } @@ -72,6 +65,7 @@ public class User { * @return username */ + @JsonProperty("username") public String getUsername() { return username; } @@ -90,6 +84,7 @@ public class User { * @return firstName */ + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -108,6 +103,7 @@ public class User { * @return lastName */ + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -126,6 +122,7 @@ public class User { * @return email */ + @JsonProperty("email") public String getEmail() { return email; } @@ -144,6 +141,7 @@ public class User { * @return password */ + @JsonProperty("password") public String getPassword() { return password; } @@ -162,6 +160,7 @@ public class User { * @return phone */ + @JsonProperty("phone") public String getPhone() { return phone; } @@ -180,6 +179,7 @@ public class User { * @return userStatus */ + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 3c2e959bec0..946be002561 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -60,6 +61,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java 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 d99760e9109..5062142aabc 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 @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 81a210f46d1..8cfd7528def 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 @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -90,7 +91,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +106,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +122,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +162,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +193,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -199,11 +204,49 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNames.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +264,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +275,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +294,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +305,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +325,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +486,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +506,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +515,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +549,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +569,6 @@ public interface FakeApi { ) 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 @@ -537,6 +580,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java index 5ae5d5fed98..9121a395182 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; 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 f75edffec9d..29a9e68dfd8 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 @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 1c1ea4d6146..833908bb74d 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 @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @return successful operation (status code 200) @@ -268,8 +270,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -299,7 +302,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -308,6 +311,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -346,6 +350,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) 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 edb41f4d944..c653b7a2873 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 @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 939a45adee8..5e03a940207 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 @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } 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 b5e88d5d7cc..34712a94057 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 @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,45 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +78,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +106,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +134,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +162,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +190,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +218,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +246,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +274,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +294,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -303,7 +304,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +314,12 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -332,6 +334,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index d91e6d2ef40..eb7bf417abb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -9,9 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -39,10 +36,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -72,6 +67,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -91,6 +87,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java index e9a1391ec0d..077f6becae1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java @@ -67,7 +67,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -97,6 +96,7 @@ public class BigCat extends Cat { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java index 35ae937c000..59ab1d8d2bf 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -64,7 +64,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -78,6 +77,7 @@ public class BigCatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java index ebd1416c5bd..61a00a120ad 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -36,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -66,6 +64,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..5da3d386b4d --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } 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 d97a088a267..e1106056505 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 @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } 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 02620d04526..15988169280 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 @@ -30,22 +30,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -84,7 +79,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -115,6 +109,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -134,6 +129,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -153,6 +149,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -167,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -177,6 +177,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -205,6 +206,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -224,6 +226,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..187960e94e4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,156 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..bf67444d3cb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..da676b10f0d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,21 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } 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 068f9dc83fd..bbc653f248a 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 @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES index bf09bb15ac7..d91ebbece08 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -43,6 +43,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -65,6 +66,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java diff --git a/samples/server/petstore/springboot-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index 86990714a3b..19d7799e733 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.openapitools + org.openapitools.openapi3 springboot-reactive jar springboot-reactive 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 d6e78c665de..bff61d78064 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 @@ -36,7 +36,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -56,10 +56,10 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default Mono> call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().call123testSpecialTags(body, exchange); + return getDelegate().call123testSpecialTags(client, exchange); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 5e5979845e8..7737b06203e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -32,11 +32,11 @@ public interface AnotherFakeApiDelegate { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default Mono> call123testSpecialTags(Mono body, + default Mono> call123testSpecialTags(Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -47,7 +47,7 @@ public interface AnotherFakeApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(client).then(Mono.empty()); } 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 be3af158227..bba9e3516e6 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 @@ -15,6 +15,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -91,7 +92,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default Mono> fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, @@ -105,7 +107,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -121,13 +123,14 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default Mono> fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono body, + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().fakeOuterCompositeSerialize(body, exchange); + return getDelegate().fakeOuterCompositeSerialize(outerComposite, exchange); } @@ -151,7 +154,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default Mono> fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body, @@ -181,7 +185,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default Mono> fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body, @@ -191,11 +196,40 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNames.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default Mono> responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiIgnore final ServerWebExchange exchange + ) { + return getDelegate().responseObjectDifferentNames(petId, exchange); + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -213,10 +247,10 @@ public interface FakeApi { consumes = { "application/json" } ) default Mono> testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testBodyWithFileSchema(body, exchange); + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass, exchange); } @@ -224,7 +258,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -243,10 +277,10 @@ public interface FakeApi { ) default Mono> testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "", required = true) @Valid @RequestBody Mono user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testBodyWithQueryParams(query, body, exchange); + return getDelegate().testBodyWithQueryParams(query, user, exchange); } @@ -254,7 +288,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -274,10 +308,10 @@ public interface FakeApi { consumes = { "application/json" } ) default Mono> testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testClientModel(body, exchange); + return getDelegate().testClientModel(client, exchange); } @@ -426,8 +460,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -445,15 +480,16 @@ public interface FakeApi { consumes = { "application/json" } ) default Mono> testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> param, + @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> requestBody, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testInlineAdditionalProperties(param, exchange); + return getDelegate().testInlineAdditionalProperties(requestBody, exchange); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -487,7 +523,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -508,18 +543,18 @@ public interface FakeApi { ) 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, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context, exchange); } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java index db9b0dff167..ea2bb662956 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java @@ -10,6 +10,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; 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 af978b31c2f..1bc0667788a 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 @@ -10,6 +10,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -74,11 +75,11 @@ public interface FakeApiDelegate { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default Mono> fakeOuterCompositeSerialize(Mono body, + default Mono> fakeOuterCompositeSerialize(Mono outerComposite, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -89,7 +90,7 @@ public interface FakeApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(outerComposite).then(Mono.empty()); } @@ -126,18 +127,40 @@ public interface FakeApiDelegate { } /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. + * GET /fake/{petId}/response-object-different-names * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + * @see FakeApi#responseObjectDifferentNames */ - default Mono> testBodyWithFileSchema(Mono body, + default Mono> responseObjectDifferentNames(Long petId, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); + break; + } + } + return result.then(Mono.empty()); + + } + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param fileSchemaTestClass (required) + * @return Success (status code 200) + * @see FakeApi#testBodyWithFileSchema + */ + default Mono> testBodyWithFileSchema(Mono fileSchemaTestClass, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(fileSchemaTestClass).then(Mono.empty()); } @@ -145,16 +168,16 @@ public interface FakeApiDelegate { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ default Mono> testBodyWithQueryParams(String query, - Mono body, + Mono user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(user).then(Mono.empty()); } @@ -162,11 +185,11 @@ public interface FakeApiDelegate { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default Mono> testClientModel(Mono body, + default Mono> testClientModel(Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -177,7 +200,7 @@ public interface FakeApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(client).then(Mono.empty()); } @@ -283,21 +306,23 @@ public interface FakeApiDelegate { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - default Mono> testInlineAdditionalProperties(Mono> param, + default Mono> testInlineAdditionalProperties(Mono> requestBody, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(param).then(Mono.empty()); + return result.then(requestBody).then(Mono.empty()); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -318,7 +343,6 @@ public interface FakeApiDelegate { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -326,7 +350,6 @@ public interface FakeApiDelegate { * @see FakeApi#testQueryParameterCollectionFormat */ default Mono> testQueryParameterCollectionFormat(List pipe, - List ioutil, List http, List url, List context, @@ -339,6 +362,7 @@ public interface FakeApiDelegate { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) 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 eec3b440fa6..9671a0b09b7 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 @@ -36,7 +36,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -59,10 +59,10 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default Mono> testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testClassname(body, exchange); + return getDelegate().testClassname(client, exchange); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 6c9ea314d72..d6cb82cb24d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -32,11 +32,11 @@ public interface FakeClassnameTestApiDelegate { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default Mono> testClassname(Mono body, + default Mono> testClassname(Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -47,7 +47,7 @@ public interface FakeClassnameTestApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(client).then(Mono.empty()); } 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 f5dbad2d4c4..2aa67290348 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 @@ -36,8 +36,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -63,15 +64,16 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default Mono> addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().addPet(body, exchange); + return getDelegate().addPet(pet, exchange); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -226,8 +228,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -257,15 +260,16 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default Mono> updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().updatePet(body, exchange); + return getDelegate().updatePet(pet, exchange); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -304,6 +308,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index 0c9899164ae..ad07e346415 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -32,22 +32,24 @@ public interface PetApiDelegate { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) * @see PetApi#addPet */ - default Mono> addPet(Mono body, + default Mono> addPet(Mono pet, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(pet).then(Mono.empty()); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -156,24 +158,26 @@ public interface PetApiDelegate { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) * @see PetApi#updatePet */ - default Mono> updatePet(Mono body, + default Mono> updatePet(Mono pet, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(pet).then(Mono.empty()); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -193,6 +197,7 @@ public interface PetApiDelegate { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) 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 39395b20f49..af05bee5813 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 @@ -131,8 +131,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -150,13 +151,14 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default Mono> placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().placeOrder(body, exchange); + return getDelegate().placeOrder(order, exchange); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index 48ed7540684..81f26555788 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -92,13 +92,14 @@ public interface StoreApiDelegate { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default Mono> placeOrder(Mono body, + default Mono> placeOrder(Mono order, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -114,7 +115,7 @@ public interface StoreApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(order).then(Mono.empty()); } 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 bed50b10a66..fd77788ae96 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 @@ -38,7 +38,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -52,20 +52,22 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default Mono> createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().createUser(body, exchange); + return getDelegate().createUser(user, exchange); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -79,20 +81,22 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default Mono> createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux body, + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().createUsersWithArrayInput(body, exchange); + return getDelegate().createUsersWithArrayInput(user, exchange); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -106,13 +110,14 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default Mono> createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux body, + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().createUsersWithListInput(body, exchange); + return getDelegate().createUsersWithListInput(user, exchange); } @@ -148,6 +153,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -181,6 +187,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -214,6 +221,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -242,7 +250,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -258,14 +266,15 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default Mono> updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().updateUser(username, body, exchange); + return getDelegate().updateUser(username, user, exchange); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index bb61d43b378..eecd786ba93 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -34,45 +34,47 @@ public interface UserApiDelegate { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) * @see UserApi#createUser */ - default Mono> createUser(Mono body, + default Mono> createUser(Mono user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(user).then(Mono.empty()); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - default Mono> createUsersWithArrayInput(Flux body, + default Mono> createUsersWithArrayInput(Flux user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.thenMany(body).then(Mono.empty()); + return result.thenMany(user).then(Mono.empty()); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - default Mono> createUsersWithListInput(Flux body, + default Mono> createUsersWithListInput(Flux user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.thenMany(body).then(Mono.empty()); + return result.thenMany(user).then(Mono.empty()); } @@ -95,6 +97,7 @@ public interface UserApiDelegate { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -124,6 +127,7 @@ public interface UserApiDelegate { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -142,6 +146,7 @@ public interface UserApiDelegate { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) * @see UserApi#logoutUser @@ -158,17 +163,17 @@ public interface UserApiDelegate { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) * @see UserApi#updateUser */ default Mono> updateUser(String username, - Mono body, + Mono user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(user).then(Mono.empty()); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } 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 b5e88d5d7cc..34712a94057 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 @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,45 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +78,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +106,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +134,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +162,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +190,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +218,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +246,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +274,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +294,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -303,7 +304,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +314,12 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -332,6 +334,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java index d91e6d2ef40..eb7bf417abb 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java @@ -9,9 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -39,10 +36,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -72,6 +67,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -91,6 +87,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java index e9a1391ec0d..077f6becae1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java @@ -67,7 +67,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -97,6 +96,7 @@ public class BigCat extends Cat { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java index 35ae937c000..59ab1d8d2bf 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -64,7 +64,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -78,6 +77,7 @@ public class BigCatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java index ebd1416c5bd..61a00a120ad 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -36,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -66,6 +64,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..5da3d386b4d --- /dev/null +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } 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 d97a088a267..e1106056505 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 @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } 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 02620d04526..15988169280 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 @@ -30,22 +30,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -84,7 +79,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -115,6 +109,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -134,6 +129,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -153,6 +149,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -167,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -177,6 +177,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -205,6 +206,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -224,6 +226,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..187960e94e4 --- /dev/null +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,156 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..bf67444d3cb 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..da676b10f0d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,21 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } 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 068f9dc83fd..bbc653f248a 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 @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } 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 658d8a96b30..260abafd6ea 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..8cb85cb8bd5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -26,45 +26,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") private Object anytype2; - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +75,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +103,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +131,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +159,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +187,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +215,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +243,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +271,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +291,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -313,6 +311,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_2") public Object getAnytype2() { return anytype2; } @@ -332,6 +331,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java index aa84943bc68..793a9005b37 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -37,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -70,6 +66,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -89,6 +86,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java index d89c77e1749..76e10b9855a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -57,6 +56,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..e1106056505 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index 9e739aefac2..5e04a5fe734 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..c4fe1a6869a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model_name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..e8ab08ec237 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,19 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..bbc653f248a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml index 05bd8cc1889..c1bde43b2e3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml @@ -184,17 +184,22 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: {} @@ -217,12 +222,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -251,12 +258,14 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -282,12 +291,14 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -371,11 +382,13 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": content: {} @@ -395,6 +408,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -403,6 +417,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -501,17 +516,21 @@ paths: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -525,14 +544,18 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": content: {} description: Invalid username/password supplied @@ -561,11 +584,13 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": content: {} @@ -583,11 +608,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -615,11 +642,13 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: '*/*': @@ -676,40 +705,55 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": content: {} @@ -729,6 +773,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -739,8 +784,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -748,10 +795,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) explode: false in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -762,8 +811,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -771,24 +822,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -1014,11 +1072,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1136,14 +1196,17 @@ paths: type: string type: array style: form - - in: query + - explode: true + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1183,12 +1246,14 @@ paths: operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -1217,28 +1282,34 @@ paths: post: operationId: versioningHeaders parameters: - - in: header + - explode: false + in: header name: VersionWithDefaultValue required: true schema: default: V1 type: string x-version-param: true + style: simple x-version-param: true - - in: header + - explode: false + in: header name: VersionNoDefaultValue required: true schema: type: string x-version-param: true + style: simple x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1255,28 +1326,34 @@ paths: post: operationId: versioningQueryParams parameters: - - in: query + - explode: true + in: query name: VersionWithDefaultValue required: true schema: default: V1 type: string x-version-param: true + style: form x-version-param: true - - in: query + - explode: true + in: query name: VersionNoDefaultValue required: true schema: type: string x-version-param: true + style: form x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1293,43 +1370,53 @@ paths: post: operationId: versioningMix parameters: - - in: query + - explode: true + in: query name: VersionWithDefaultValueQuery required: true schema: default: V1 type: string x-version-param: true + style: form x-version-param: true - - in: query + - explode: true + in: query name: VersionNoDefaultValueQuery required: true schema: type: string x-version-param: true + style: form x-version-param: true - - in: header + - explode: false + in: header name: VersionWithDefaultValueHeader required: true schema: default: V1 type: string x-version-param: true + style: simple x-version-param: true - - in: header + - explode: false + in: header name: VersionNoDefaultValueHeader required: true schema: type: string x-version-param: true + style: simple x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1508,7 +1595,7 @@ components: message: type: string type: object - $special[model.name]: + _special_model_name_: properties: $special[property.name]: format: int64 @@ -1589,13 +1676,13 @@ components: format_test: properties: integer: - maximum: 100 - minimum: 10 + maximum: 100.0 + minimum: 10.0 type: integer int32: format: int32 - maximum: 200 - minimum: 20 + maximum: 200.0 + minimum: 20.0 type: integer int64: format: int64 @@ -2234,7 +2321,6 @@ components: status: description: Updated status of the pet type: string - type: object uploadFile_request: properties: additionalMetadata: @@ -2244,7 +2330,6 @@ components: description: file to upload format: binary type: string - type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2264,7 +2349,6 @@ components: - -efg - (xyz) type: string - type: object testEndpointParameters_request: properties: integer: @@ -2337,7 +2421,6 @@ components: - double - number - pattern_without_delimiter - type: object testJsonFormData_request: properties: param: @@ -2349,7 +2432,6 @@ components: required: - param - param2 - type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2361,7 +2443,6 @@ components: type: string required: - requiredFile - type: object Dog_allOf: properties: breed: @@ -2394,4 +2475,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..8cb85cb8bd5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -26,45 +26,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") private Object anytype2; - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +75,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +103,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +131,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +159,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +187,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +215,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +243,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +271,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +291,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -313,6 +311,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_2") public Object getAnytype2() { return anytype2; } @@ -332,6 +331,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java index aa84943bc68..793a9005b37 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -37,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -70,6 +66,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -89,6 +86,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java index d89c77e1749..76e10b9855a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -57,6 +56,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..e1106056505 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java index 9e739aefac2..5e04a5fe734 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..c4fe1a6869a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model_name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..e8ab08ec237 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,19 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..bbc653f248a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml index 05bd8cc1889..c1bde43b2e3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml @@ -184,17 +184,22 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: {} @@ -217,12 +222,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -251,12 +258,14 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -282,12 +291,14 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -371,11 +382,13 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": content: {} @@ -395,6 +408,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -403,6 +417,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -501,17 +516,21 @@ paths: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -525,14 +544,18 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": content: {} description: Invalid username/password supplied @@ -561,11 +584,13 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": content: {} @@ -583,11 +608,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -615,11 +642,13 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: '*/*': @@ -676,40 +705,55 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": content: {} @@ -729,6 +773,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -739,8 +784,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -748,10 +795,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) explode: false in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -762,8 +811,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -771,24 +822,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -1014,11 +1072,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1136,14 +1196,17 @@ paths: type: string type: array style: form - - in: query + - explode: true + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1183,12 +1246,14 @@ paths: operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -1217,28 +1282,34 @@ paths: post: operationId: versioningHeaders parameters: - - in: header + - explode: false + in: header name: VersionWithDefaultValue required: true schema: default: V1 type: string x-version-param: true + style: simple x-version-param: true - - in: header + - explode: false + in: header name: VersionNoDefaultValue required: true schema: type: string x-version-param: true + style: simple x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1255,28 +1326,34 @@ paths: post: operationId: versioningQueryParams parameters: - - in: query + - explode: true + in: query name: VersionWithDefaultValue required: true schema: default: V1 type: string x-version-param: true + style: form x-version-param: true - - in: query + - explode: true + in: query name: VersionNoDefaultValue required: true schema: type: string x-version-param: true + style: form x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1293,43 +1370,53 @@ paths: post: operationId: versioningMix parameters: - - in: query + - explode: true + in: query name: VersionWithDefaultValueQuery required: true schema: default: V1 type: string x-version-param: true + style: form x-version-param: true - - in: query + - explode: true + in: query name: VersionNoDefaultValueQuery required: true schema: type: string x-version-param: true + style: form x-version-param: true - - in: header + - explode: false + in: header name: VersionWithDefaultValueHeader required: true schema: default: V1 type: string x-version-param: true + style: simple x-version-param: true - - in: header + - explode: false + in: header name: VersionNoDefaultValueHeader required: true schema: type: string x-version-param: true + style: simple x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1508,7 +1595,7 @@ components: message: type: string type: object - $special[model.name]: + _special_model_name_: properties: $special[property.name]: format: int64 @@ -1589,13 +1676,13 @@ components: format_test: properties: integer: - maximum: 100 - minimum: 10 + maximum: 100.0 + minimum: 10.0 type: integer int32: format: int32 - maximum: 200 - minimum: 20 + maximum: 200.0 + minimum: 20.0 type: integer int64: format: int64 @@ -2234,7 +2321,6 @@ components: status: description: Updated status of the pet type: string - type: object uploadFile_request: properties: additionalMetadata: @@ -2244,7 +2330,6 @@ components: description: file to upload format: binary type: string - type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2264,7 +2349,6 @@ components: - -efg - (xyz) type: string - type: object testEndpointParameters_request: properties: integer: @@ -2337,7 +2421,6 @@ components: - double - number - pattern_without_delimiter - type: object testJsonFormData_request: properties: param: @@ -2349,7 +2432,6 @@ components: required: - param - param2 - type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2361,7 +2443,6 @@ components: type: string required: - requiredFile - type: object Dog_allOf: properties: breed: @@ -2394,4 +2475,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..8cb85cb8bd5 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -26,45 +26,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") private Object anytype2; - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +75,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +103,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +131,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +159,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +187,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +215,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +243,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +271,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +291,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -313,6 +311,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_2") public Object getAnytype2() { return anytype2; } @@ -332,6 +331,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java index aa84943bc68..793a9005b37 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -37,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -70,6 +66,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -89,6 +86,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java index d89c77e1749..76e10b9855a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -57,6 +56,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..e1106056505 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index 9e739aefac2..5e04a5fe734 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..c4fe1a6869a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model_name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..e8ab08ec237 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,19 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..bbc653f248a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml index 05bd8cc1889..c1bde43b2e3 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml @@ -184,17 +184,22 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: {} @@ -217,12 +222,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -251,12 +258,14 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -282,12 +291,14 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -371,11 +382,13 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": content: {} @@ -395,6 +408,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -403,6 +417,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -501,17 +516,21 @@ paths: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -525,14 +544,18 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": content: {} description: Invalid username/password supplied @@ -561,11 +584,13 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": content: {} @@ -583,11 +608,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -615,11 +642,13 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: '*/*': @@ -676,40 +705,55 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": content: {} @@ -729,6 +773,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -739,8 +784,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -748,10 +795,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) explode: false in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -762,8 +811,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -771,24 +822,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -1014,11 +1072,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1136,14 +1196,17 @@ paths: type: string type: array style: form - - in: query + - explode: true + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1183,12 +1246,14 @@ paths: operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -1217,28 +1282,34 @@ paths: post: operationId: versioningHeaders parameters: - - in: header + - explode: false + in: header name: VersionWithDefaultValue required: true schema: default: V1 type: string x-version-param: true + style: simple x-version-param: true - - in: header + - explode: false + in: header name: VersionNoDefaultValue required: true schema: type: string x-version-param: true + style: simple x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1255,28 +1326,34 @@ paths: post: operationId: versioningQueryParams parameters: - - in: query + - explode: true + in: query name: VersionWithDefaultValue required: true schema: default: V1 type: string x-version-param: true + style: form x-version-param: true - - in: query + - explode: true + in: query name: VersionNoDefaultValue required: true schema: type: string x-version-param: true + style: form x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1293,43 +1370,53 @@ paths: post: operationId: versioningMix parameters: - - in: query + - explode: true + in: query name: VersionWithDefaultValueQuery required: true schema: default: V1 type: string x-version-param: true + style: form x-version-param: true - - in: query + - explode: true + in: query name: VersionNoDefaultValueQuery required: true schema: type: string x-version-param: true + style: form x-version-param: true - - in: header + - explode: false + in: header name: VersionWithDefaultValueHeader required: true schema: default: V1 type: string x-version-param: true + style: simple x-version-param: true - - in: header + - explode: false + in: header name: VersionNoDefaultValueHeader required: true schema: type: string x-version-param: true + style: simple x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1508,7 +1595,7 @@ components: message: type: string type: object - $special[model.name]: + _special_model_name_: properties: $special[property.name]: format: int64 @@ -1589,13 +1676,13 @@ components: format_test: properties: integer: - maximum: 100 - minimum: 10 + maximum: 100.0 + minimum: 10.0 type: integer int32: format: int32 - maximum: 200 - minimum: 20 + maximum: 200.0 + minimum: 20.0 type: integer int64: format: int64 @@ -2234,7 +2321,6 @@ components: status: description: Updated status of the pet type: string - type: object uploadFile_request: properties: additionalMetadata: @@ -2244,7 +2330,6 @@ components: description: file to upload format: binary type: string - type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2264,7 +2349,6 @@ components: - -efg - (xyz) type: string - type: object testEndpointParameters_request: properties: integer: @@ -2337,7 +2421,6 @@ components: - double - number - pattern_without_delimiter - type: object testJsonFormData_request: properties: param: @@ -2349,7 +2432,6 @@ components: required: - param - param2 - type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2361,7 +2443,6 @@ components: type: string required: - requiredFile - type: object Dog_allOf: properties: breed: @@ -2394,4 +2475,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..8cb85cb8bd5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -26,45 +26,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") private Object anytype2; - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +75,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +103,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +131,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +159,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +187,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +215,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +243,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +271,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +291,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -313,6 +311,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_2") public Object getAnytype2() { return anytype2; } @@ -332,6 +331,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java index aa84943bc68..793a9005b37 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -37,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -70,6 +66,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -89,6 +86,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java index d89c77e1749..76e10b9855a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -57,6 +56,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..e1106056505 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 9e739aefac2..5e04a5fe734 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -27,22 +27,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -81,7 +76,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -112,6 +106,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -131,6 +126,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -150,6 +146,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -164,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -174,6 +174,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public List getPhotoUrls() { return photoUrls; } @@ -201,6 +202,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -220,6 +222,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..c4fe1a6869a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model_name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..e8ab08ec237 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,19 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..bbc653f248a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml index 05bd8cc1889..c1bde43b2e3 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml @@ -184,17 +184,22 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: {} @@ -217,12 +222,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -251,12 +258,14 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -282,12 +291,14 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -371,11 +382,13 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": content: {} @@ -395,6 +408,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -403,6 +417,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -501,17 +516,21 @@ paths: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -525,14 +544,18 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": content: {} description: Invalid username/password supplied @@ -561,11 +584,13 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": content: {} @@ -583,11 +608,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -615,11 +642,13 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: '*/*': @@ -676,40 +705,55 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": content: {} @@ -729,6 +773,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -739,8 +784,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -748,10 +795,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) explode: false in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -762,8 +811,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -771,24 +822,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -1014,11 +1072,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1136,14 +1196,17 @@ paths: type: string type: array style: form - - in: query + - explode: true + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1183,12 +1246,14 @@ paths: operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -1217,28 +1282,34 @@ paths: post: operationId: versioningHeaders parameters: - - in: header + - explode: false + in: header name: VersionWithDefaultValue required: true schema: default: V1 type: string x-version-param: true + style: simple x-version-param: true - - in: header + - explode: false + in: header name: VersionNoDefaultValue required: true schema: type: string x-version-param: true + style: simple x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1255,28 +1326,34 @@ paths: post: operationId: versioningQueryParams parameters: - - in: query + - explode: true + in: query name: VersionWithDefaultValue required: true schema: default: V1 type: string x-version-param: true + style: form x-version-param: true - - in: query + - explode: true + in: query name: VersionNoDefaultValue required: true schema: type: string x-version-param: true + style: form x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1293,43 +1370,53 @@ paths: post: operationId: versioningMix parameters: - - in: query + - explode: true + in: query name: VersionWithDefaultValueQuery required: true schema: default: V1 type: string x-version-param: true + style: form x-version-param: true - - in: query + - explode: true + in: query name: VersionNoDefaultValueQuery required: true schema: type: string x-version-param: true + style: form x-version-param: true - - in: header + - explode: false + in: header name: VersionWithDefaultValueHeader required: true schema: default: V1 type: string x-version-param: true + style: simple x-version-param: true - - in: header + - explode: false + in: header name: VersionNoDefaultValueHeader required: true schema: type: string x-version-param: true + style: simple x-version-param: true - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -1508,7 +1595,7 @@ components: message: type: string type: object - $special[model.name]: + _special_model_name_: properties: $special[property.name]: format: int64 @@ -1589,13 +1676,13 @@ components: format_test: properties: integer: - maximum: 100 - minimum: 10 + maximum: 100.0 + minimum: 10.0 type: integer int32: format: int32 - maximum: 200 - minimum: 20 + maximum: 200.0 + minimum: 20.0 type: integer int64: format: int64 @@ -2234,7 +2321,6 @@ components: status: description: Updated status of the pet type: string - type: object uploadFile_request: properties: additionalMetadata: @@ -2244,7 +2330,6 @@ components: description: file to upload format: binary type: string - type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2264,7 +2349,6 @@ components: - -efg - (xyz) type: string - type: object testEndpointParameters_request: properties: integer: @@ -2337,7 +2421,6 @@ components: - double - number - pattern_without_delimiter - type: object testJsonFormData_request: properties: param: @@ -2349,7 +2432,6 @@ components: required: - param - param2 - type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2361,7 +2443,6 @@ components: type: string required: - requiredFile - type: object Dog_allOf: properties: breed: @@ -2394,4 +2475,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES index 3c2e959bec0..946be002561 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java @@ -60,6 +61,7 @@ src/main/java/org/openapitools/model/OuterComposite.java src/main/java/org/openapitools/model/OuterEnum.java src/main/java/org/openapitools/model/Pet.java src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/model/SpecialModelName.java src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/TypeHolderDefault.java diff --git a/samples/server/petstore/springboot-useoptional/pom.xml b/samples/server/petstore/springboot-useoptional/pom.xml index 90594c755f2..7c76b4dc531 100644 --- a/samples/server/petstore/springboot-useoptional/pom.xml +++ b/samples/server/petstore/springboot-useoptional/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.openapitools + org.openapitools.openapi3 spring-boot-useoptional jar spring-boot-useoptional 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 d99760e9109..5062142aabc 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 @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 6bae82c95c7..df8e4d9ab89 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 @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -90,7 +91,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +106,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +122,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +162,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +193,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -199,11 +204,49 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNames.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +264,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +275,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +294,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +305,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +325,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +486,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +506,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +515,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +549,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +569,6 @@ public interface FakeApi { ) 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 @@ -537,6 +580,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java index 5ae5d5fed98..9121a395182 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.openapitools.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.model.User; import org.openapitools.model.XmlItem; 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 f75edffec9d..29a9e68dfd8 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 @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 8bd7fbad1ab..53bd9a7b060 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 @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -267,8 +269,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -298,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -345,6 +349,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) 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 edb41f4d944..c653b7a2873 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 @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 939a45adee8..5e03a940207 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 @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8e4c1798976..686fafb2faa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 27a8f01607f..a2c3df24a2d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bc7b87d760a..82fcada6f56 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } 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 b5e88d5d7cc..34712a94057 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 @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,45 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -86,6 +78,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -113,6 +106,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -140,6 +134,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -167,6 +162,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -194,6 +190,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,6 +218,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -248,6 +246,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -275,6 +274,7 @@ public class AdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -294,6 +294,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -303,7 +304,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +314,12 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -332,6 +334,7 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 00b5174e93b..ea2ec5365ed 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 8fec423ffb1..4ca4b5a2f50 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -39,6 +38,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 67033332b0d..7b9d8ef0b0b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 993f83bb2cc..fdc4baa9de7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesString extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index d91e6d2ef40..eb7bf417abb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java @@ -9,9 +9,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -39,10 +36,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -72,6 +67,7 @@ public class Animal { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -91,6 +87,7 @@ public class Animal { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..91fca22a457 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..a901b8de385 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -48,6 +47,7 @@ public class ArrayOfNumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..819eb6062ab 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java @@ -25,17 +25,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -56,6 +53,7 @@ public class ArrayTest { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -83,6 +81,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +109,7 @@ public class ArrayTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index e9a1391ec0d..077f6becae1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -67,7 +67,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -97,6 +96,7 @@ public class BigCat extends Cat { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java index 35ae937c000..59ab1d8d2bf 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -64,7 +64,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -78,6 +77,7 @@ public class BigCatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index e9cce9de011..feb0d643c5e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java @@ -22,22 +22,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -51,6 +45,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -70,6 +65,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -89,6 +85,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -108,6 +105,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -127,6 +125,7 @@ public class Capitalization { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,6 +145,7 @@ public class Capitalization { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index ebd1416c5bd..61a00a120ad 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -36,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -66,6 +64,7 @@ public class Cat extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java index eed74bea751..85c6885ae00 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index 77ded60a471..2bd31570c78 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -55,6 +53,7 @@ public class Category { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -74,6 +73,7 @@ public class Category { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index 69296da7e60..2c511abe3ec 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -37,6 +36,7 @@ public class ClassModel { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index b788daea14a..a6bfdf58db7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -36,6 +35,7 @@ public class Client { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..5da3d386b4d --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index 6d869993c19..5954daab536 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -57,6 +56,7 @@ public class Dog extends Animal { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java index 4f275e53533..5784d207b4d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOf { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..89bc2c4ed1d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -98,9 +97,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -113,6 +111,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,6 +139,7 @@ public class EnumArrays { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 806094a9830..01bd1c3c986 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -63,7 +63,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTest { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java index d82e4902623..fedeea1c638 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -37,6 +36,7 @@ public class File { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } 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 d97a088a267..e1106056505 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 @@ -25,12 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -43,6 +41,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public File getFile() { return file; } @@ -70,6 +69,7 @@ public class FileSchemaTestClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index b7fd007ab1d..fee872bd400 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTest { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTest { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTest { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTest { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTest { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 224b16d1a2d..21a42445979 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnly { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..16d8af2d7f6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -25,9 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -64,17 +63,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -95,6 +91,7 @@ public class MapTest { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -122,6 +119,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -149,6 +147,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -176,6 +175,7 @@ public class MapTest { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..075d281eb4b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -28,16 +28,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -50,6 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -69,6 +67,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -96,6 +95,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..193231f8545 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -42,6 +40,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200Response { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index dfba6cb672d..693e1669879 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -44,6 +41,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ModelApiResponse { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..7853f3d408a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -38,6 +37,7 @@ public class ModelList { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 4505ddfeeec..b6f106cea22 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -39,6 +38,7 @@ public class ModelReturn { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index cc8f667dbf0..53e568199f4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java @@ -23,16 +23,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -62,6 +58,7 @@ public class Name { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -81,6 +78,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -100,6 +98,7 @@ public class Name { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -119,6 +118,7 @@ public class Name { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index 278146bfb89..1e3f9e15421 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -37,6 +36,7 @@ public class NumberOnly { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index 9a9ed4f6c96..b24c70c0780 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -75,10 +71,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -92,6 +86,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -111,6 +106,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -130,6 +126,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -149,6 +146,7 @@ public class Order { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -168,6 +166,7 @@ public class Order { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -187,6 +186,7 @@ public class Order { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index c1a709bb26a..ade2b915019 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -43,6 +40,7 @@ public class OuterComposite { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -62,6 +60,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -81,6 +80,7 @@ public class OuterComposite { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } 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 02620d04526..15988169280 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 @@ -30,22 +30,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -84,7 +79,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -115,6 +109,7 @@ public class Pet { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -134,6 +129,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public Category getCategory() { return category; } @@ -153,6 +149,7 @@ public class Pet { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -167,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -177,6 +177,7 @@ public class Pet { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -205,6 +206,7 @@ public class Pet { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -224,6 +226,7 @@ public class Pet { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index b7a0a416782..3eb0ebe069c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -39,6 +37,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -58,6 +57,7 @@ public class ReadOnlyFirst { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..187960e94e4 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,156 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..bf67444d3cb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelName { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index 6161be4a922..527e777278e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java @@ -22,10 +22,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -39,6 +37,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -58,6 +57,7 @@ public class Tag { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..da676b10f0d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -25,21 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -72,6 +67,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -91,6 +87,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -110,6 +107,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -129,6 +127,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -143,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,6 +155,7 @@ public class TypeHolderDefault { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } 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 068f9dc83fd..bbc653f248a 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 @@ -25,22 +25,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -76,6 +70,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -95,6 +90,7 @@ public class TypeHolderExample { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -114,6 +110,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -133,6 +130,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -152,6 +150,7 @@ public class TypeHolderExample { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -166,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +177,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index ec85459bc99..36d29ba307d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java @@ -22,28 +22,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -57,6 +49,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +69,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -95,6 +89,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -114,6 +109,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -133,6 +129,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -152,6 +149,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -171,6 +169,7 @@ public class User { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -190,6 +189,7 @@ public class User { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..58405cbb486 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -25,101 +25,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -132,6 +103,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -151,6 +123,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,6 +143,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -189,6 +163,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,6 +191,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -235,6 +211,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -254,6 +231,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -273,6 +251,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -292,6 +271,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -319,6 +299,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -346,6 +327,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -365,6 +347,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -384,6 +367,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -403,6 +387,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -422,6 +407,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -449,6 +435,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -476,6 +463,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -495,6 +483,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -514,6 +503,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -533,6 +523,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -552,6 +543,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -579,6 +571,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -606,6 +599,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -625,6 +619,7 @@ public class XmlItem { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -644,6 +639,7 @@ public class XmlItem { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -663,6 +659,7 @@ public class XmlItem { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -682,6 +679,7 @@ public class XmlItem { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -709,6 +707,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -736,6 +735,7 @@ public class XmlItem { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES index 408f3973f3e..8ba55df4658 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/virtualan/model/CatAllOf.java src/main/java/org/openapitools/virtualan/model/Category.java src/main/java/org/openapitools/virtualan/model/ClassModel.java src/main/java/org/openapitools/virtualan/model/Client.java +src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java src/main/java/org/openapitools/virtualan/model/Dog.java src/main/java/org/openapitools/virtualan/model/DogAllOf.java src/main/java/org/openapitools/virtualan/model/EnumArrays.java @@ -60,6 +61,7 @@ src/main/java/org/openapitools/virtualan/model/OuterComposite.java src/main/java/org/openapitools/virtualan/model/OuterEnum.java src/main/java/org/openapitools/virtualan/model/Pet.java src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java +src/main/java/org/openapitools/virtualan/model/ResponseObjectWithDifferentFieldNames.java src/main/java/org/openapitools/virtualan/model/SpecialModelName.java src/main/java/org/openapitools/virtualan/model/Tag.java src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java 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 5e64ed88754..f6935b2e085 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 @@ -48,7 +48,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiVirtual @@ -70,7 +70,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 6a41e37a01e..2b6321ac51b 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 @@ -14,6 +14,7 @@ import java.util.Map; import org.openapitools.virtualan.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.virtualan.model.OuterComposite; +import org.openapitools.virtualan.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.virtualan.model.User; import org.openapitools.virtualan.model.XmlItem; import io.swagger.v3.oas.annotations.ExternalDocumentation; @@ -105,7 +106,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -119,7 +121,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiVirtual @@ -136,10 +138,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -176,7 +179,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -207,7 +211,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -217,11 +222,49 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiVirtual + @Operation( + operationId = "responseObjectDifferentNames", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNames.class)) + }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiVirtual @@ -239,7 +282,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -250,7 +293,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiVirtual @@ -268,7 +311,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -279,7 +322,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiVirtual @@ -301,7 +344,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -465,14 +508,16 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiVirtual @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -484,7 +529,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -493,6 +538,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -502,6 +548,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -526,7 +573,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -547,7 +593,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context @@ -559,6 +604,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -569,6 +615,7 @@ public interface FakeApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java index d33842e20df..6745966de43 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java @@ -9,6 +9,7 @@ import java.util.Map; import org.openapitools.virtualan.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.virtualan.model.OuterComposite; +import org.openapitools.virtualan.model.ResponseObjectWithDifferentFieldNames; import org.openapitools.virtualan.model.User; import org.openapitools.virtualan.model.XmlItem; 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 f4f38abd4d6..b99ab47d1ce 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 @@ -48,7 +48,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiVirtual @@ -73,7 +73,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 023c2afc3a4..c365882156a 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 @@ -48,8 +48,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -57,6 +58,7 @@ public interface PetApi { @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -72,7 +74,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -81,6 +83,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -91,6 +94,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -275,8 +279,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -286,6 +291,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -303,7 +309,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -312,6 +318,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -322,6 +329,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -347,6 +355,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -357,6 +366,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { 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 41610330e76..08976d50610 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 @@ -163,8 +163,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -172,6 +173,7 @@ public interface StoreApi { @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -184,10 +186,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 ad422df4975..575133ec568 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 @@ -50,7 +50,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiVirtual @@ -65,10 +65,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -77,14 +78,16 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiVirtual @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -92,10 +95,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -104,14 +108,16 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiVirtual @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -119,10 +125,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -162,6 +169,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -172,6 +180,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -211,6 +220,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -221,6 +231,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -246,6 +257,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -253,6 +265,7 @@ public interface UserApi { @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -275,7 +288,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -292,11 +305,12 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java index 9f4aa42c851..206db52a72f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyType name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesAnyType extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java index a17c327fe24..1ccea4df28c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArray name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesArray extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java index d1c746ffd00..2343eb8798e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBoolean name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesBoolean extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } 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 e85950e89e5..daa9ffe49c6 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 @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -25,45 +28,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -85,6 +77,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -112,6 +105,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -139,6 +133,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -166,6 +161,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -193,6 +189,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -220,6 +217,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -247,6 +245,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -274,6 +273,7 @@ public class AdditionalPropertiesClass { */ @Valid @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -293,6 +293,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -302,7 +303,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +313,12 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -331,6 +333,7 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java index b1ae91765bf..4913c13bad4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesInteger name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesInteger extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java index c5fea24d469..1290ec6536e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumber name(String name) { @@ -38,6 +37,7 @@ public class AdditionalPropertiesNumber extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java index 068cdeda3b0..fab88cc6ac0 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObject name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesObject extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java index e351a15df69..592acfa0695 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesString name(String name) { @@ -37,6 +36,7 @@ public class AdditionalPropertiesString extends HashMap { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java index e28dd10f0a7..1d9dd03564f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java @@ -7,9 +7,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.virtualan.model.BigCat; -import org.openapitools.virtualan.model.Cat; -import org.openapitools.virtualan.model.Dog; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -38,10 +35,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -71,6 +66,7 @@ public class Animal { */ @NotNull @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("className") public String getClassName() { return className; } @@ -90,6 +86,7 @@ public class Animal { */ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java index 9e659a77e5f..5afe4f0000d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java index 57218ff5084..35b81ceeef6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -47,6 +46,7 @@ public class ArrayOfNumberOnly { */ @Valid @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java index bd5ffb05a08..6004ba642ec 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java @@ -24,17 +24,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -55,6 +52,7 @@ public class ArrayTest { */ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -82,6 +80,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -109,6 +108,7 @@ public class ArrayTest { */ @Valid @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java index bb479265058..ea6751c1f75 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java @@ -66,7 +66,6 @@ public class BigCat extends Cat { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -96,6 +95,7 @@ public class BigCat extends Cat { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java index b3f40bf8215..daf0315ddcb 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java @@ -63,7 +63,6 @@ public class BigCatAllOf { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -77,6 +76,7 @@ public class BigCatAllOf { */ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java index ac66aa43baa..a7458d3ebf5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java @@ -21,22 +21,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -50,6 +44,7 @@ public class Capitalization { */ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -69,6 +64,7 @@ public class Capitalization { */ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -88,6 +84,7 @@ public class Capitalization { */ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -107,6 +104,7 @@ public class Capitalization { */ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -126,6 +124,7 @@ public class Capitalization { */ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,6 +144,7 @@ public class Capitalization { */ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java index 163822a2656..18907db08fc 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.virtualan.model.Animal; -import org.openapitools.virtualan.model.BigCat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -35,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { - @JsonProperty("declawed") private Boolean declawed; /** @@ -65,6 +63,7 @@ public class Cat extends Animal { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java index e8e73cc0c28..6959f4c07e5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { - @JsonProperty("declawed") private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -37,6 +36,7 @@ public class CatAllOf { */ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java index f781ae5574c..061086c3c3f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -54,6 +52,7 @@ public class Category { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -73,6 +72,7 @@ public class Category { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java index d3c9c803ec3..33d10d79839 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { - @JsonProperty("_class") private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -36,6 +35,7 @@ public class ClassModel { */ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java index 7aa7dd5ee0c..415ad50e2c8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { - @JsonProperty("client") private String client; public Client client(String client) { @@ -35,6 +34,7 @@ public class Client { */ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..9787053cbe3 --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java @@ -0,0 +1,224 @@ +package org.openapitools.virtualan.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java index 1ae16f68d79..bf856e98705 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { - @JsonProperty("breed") private String breed; /** @@ -56,6 +55,7 @@ public class Dog extends Animal { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java index 0e8f816aa4f..92fd0a1003a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { - @JsonProperty("breed") private String breed; public DogAllOf breed(String breed) { @@ -37,6 +36,7 @@ public class DogAllOf { */ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java index bf35bb62dfb..3231c81446e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java @@ -59,7 +59,6 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -97,9 +96,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -112,6 +110,7 @@ public class EnumArrays { */ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -139,6 +138,7 @@ public class EnumArrays { */ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index a9557c84a90..33431bc6b3b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -62,7 +62,6 @@ public class EnumTest { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -102,7 +101,6 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -140,7 +138,6 @@ public class EnumTest { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -178,10 +175,8 @@ public class EnumTest { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnum outerEnum; /** @@ -211,6 +206,7 @@ public class EnumTest { */ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -230,6 +226,7 @@ public class EnumTest { */ @NotNull @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -249,6 +246,7 @@ public class EnumTest { */ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -268,6 +266,7 @@ public class EnumTest { */ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -287,6 +286,7 @@ public class EnumTest { */ @Valid @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java index b98a0b9589e..90ae951c28c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { - @JsonProperty("sourceURI") private String sourceURI; public File sourceURI(String sourceURI) { @@ -36,6 +35,7 @@ public class File { */ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } 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 0fe10da645d..26c11a8e86b 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 @@ -24,12 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { - @JsonProperty("file") private File file; - @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files; public FileSchemaTestClass file(File file) { this.file = file; @@ -42,6 +40,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("file") public File getFile() { return file; } @@ -69,6 +68,7 @@ public class FileSchemaTestClass { */ @Valid @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("files") public List<@Valid File> getFiles() { return files; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index e4ad2be9177..f2cc31357aa 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -29,48 +29,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -105,6 +91,7 @@ public class FormatTest { */ @Min(10) @Max(100) @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -126,6 +113,7 @@ public class FormatTest { */ @Min(20) @Max(200) @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -145,6 +133,7 @@ public class FormatTest { */ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -166,6 +155,7 @@ public class FormatTest { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -187,6 +177,7 @@ public class FormatTest { */ @DecimalMin("54.3") @DecimalMax("987.6") @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("float") public Float getFloat() { return _float; } @@ -208,6 +199,7 @@ public class FormatTest { */ @DecimalMin("67.8") @DecimalMax("123.4") @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("double") public Double getDouble() { return _double; } @@ -227,6 +219,7 @@ public class FormatTest { */ @Pattern(regexp = "/[a-z]/i") @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("string") public String getString() { return string; } @@ -246,6 +239,7 @@ public class FormatTest { */ @NotNull @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -265,6 +259,7 @@ public class FormatTest { */ @Valid @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -284,6 +279,7 @@ public class FormatTest { */ @NotNull @Valid @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -303,6 +299,7 @@ public class FormatTest { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -322,6 +319,7 @@ public class FormatTest { */ @Valid @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -341,6 +339,7 @@ public class FormatTest { */ @NotNull @Size(min = 10, max = 64) @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -360,6 +359,7 @@ public class FormatTest { */ @Valid @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java index cf9c6e9d27e..a359abf6d61 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java @@ -23,10 +23,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnly bar(String bar) { @@ -40,6 +38,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -59,6 +58,7 @@ public class HasOnlyReadOnly { */ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java index d10f2317c38..a14b0343044 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java @@ -24,9 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -63,17 +62,14 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -94,6 +90,7 @@ public class MapTest { */ @Valid @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -121,6 +118,7 @@ public class MapTest { */ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,6 +146,7 @@ public class MapTest { */ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -175,6 +174,7 @@ public class MapTest { */ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9a92421585e..2165294c3be 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -27,16 +27,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -49,6 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -68,6 +66,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -95,6 +94,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { */ @Valid @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java index 3cbf29bb8ae..3e96c3c5eb5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200Response name(Integer name) { @@ -41,6 +39,7 @@ public class Model200Response { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -60,6 +59,7 @@ public class Model200Response { */ @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java index c4c57e9b55a..1dafc875a73 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java @@ -23,13 +23,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ModelApiResponse code(Integer code) { @@ -43,6 +40,7 @@ public class ModelApiResponse { */ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("code") public Integer getCode() { return code; } @@ -62,6 +60,7 @@ public class ModelApiResponse { */ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("type") public String getType() { return type; } @@ -81,6 +80,7 @@ public class ModelApiResponse { */ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java index 4c9f7b965f0..b2d5036185c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { - @JsonProperty("123-list") private String _123list; public ModelList _123list(String _123list) { @@ -37,6 +36,7 @@ public class ModelList { */ @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123-list") public String get123list() { return _123list; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java index 4f7b1d6a707..748bb9666ef 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { - @JsonProperty("return") private Integer _return; public ModelReturn _return(Integer _return) { @@ -38,6 +37,7 @@ public class ModelReturn { */ @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java index c765c47d462..f00cb75ddc7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java @@ -22,16 +22,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123number; /** @@ -61,6 +57,7 @@ public class Name { */ @NotNull @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public Integer getName() { return name; } @@ -80,6 +77,7 @@ public class Name { */ @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -99,6 +97,7 @@ public class Name { */ @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property") public String getProperty() { return property; } @@ -118,6 +117,7 @@ public class Name { */ @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("123Number") public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java index fa289a07a10..8a64f4c3b97 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -36,6 +35,7 @@ public class NumberOnly { */ @Valid @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java index 6d2bc000943..5d1e4d7d9dd 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java @@ -24,16 +24,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -74,10 +70,8 @@ public class Order { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public Order id(Long id) { @@ -91,6 +85,7 @@ public class Order { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -110,6 +105,7 @@ public class Order { */ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -129,6 +125,7 @@ public class Order { */ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -148,6 +145,7 @@ public class Order { */ @Valid @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -167,6 +165,7 @@ public class Order { */ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -186,6 +185,7 @@ public class Order { */ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java index 53b0591789c..fdc4d2d3a67 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java @@ -22,13 +22,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -42,6 +39,7 @@ public class OuterComposite { */ @Valid @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -61,6 +59,7 @@ public class OuterComposite { */ @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -80,6 +79,7 @@ public class OuterComposite { */ @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } 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 acb4d1464ef..92c95332cbd 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 @@ -29,22 +29,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { - @JsonProperty("id") private Long id; - @JsonProperty("category") private Category category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags; /** * pet status in the store @@ -83,7 +78,6 @@ public class Pet { } } - @JsonProperty("status") private StatusEnum status; /** @@ -114,6 +108,7 @@ public class Pet { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -133,6 +128,7 @@ public class Pet { */ @Valid @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("category") public Category getCategory() { return category; } @@ -152,6 +148,7 @@ public class Pet { */ @NotNull @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") public String getName() { return name; } @@ -166,6 +163,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -176,6 +176,7 @@ public class Pet { */ @NotNull @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -204,6 +205,7 @@ public class Pet { */ @Valid @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("tags") public List<@Valid Tag> getTags() { return tags; } @@ -223,6 +225,7 @@ public class Pet { */ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java index ab46b7db4cd..7609052eca3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirst bar(String bar) { @@ -38,6 +36,7 @@ public class ReadOnlyFirst { */ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bar") public String getBar() { return bar; } @@ -57,6 +56,7 @@ public class ReadOnlyFirst { */ @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ResponseObjectWithDifferentFieldNames.java new file mode 100644 index 00000000000..390bd1ee9e4 --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ResponseObjectWithDifferentFieldNames.java @@ -0,0 +1,155 @@ +package org.openapitools.virtualan.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNames + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNames { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNames responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNames) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNames {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java index c63be2646fe..79e507fccc3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java @@ -19,11 +19,10 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { - @JsonProperty("$special[property.name]") private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -37,6 +36,7 @@ public class SpecialModelName { */ @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java index 1924be7de11..2c284e36e4f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java @@ -21,10 +21,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public Tag id(Long id) { @@ -38,6 +36,7 @@ public class Tag { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -57,6 +56,7 @@ public class Tag { */ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java index 4b652fe3170..0deae5af294 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java @@ -24,21 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -71,6 +66,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -90,6 +86,7 @@ public class TypeHolderDefault { */ @NotNull @Valid @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -109,6 +106,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -128,6 +126,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -142,6 +141,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -152,6 +154,7 @@ public class TypeHolderDefault { */ @NotNull @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } 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 3bcd0c5f389..9c37a634809 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 @@ -24,22 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid private List arrayItem = new ArrayList<>(); @@ -75,6 +69,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -94,6 +89,7 @@ public class TypeHolderExample { */ @NotNull @Valid @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -113,6 +109,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -132,6 +129,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -151,6 +149,7 @@ public class TypeHolderExample { */ @NotNull @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -165,6 +164,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +176,8 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java index 3a2458136cb..319d6d960ca 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java @@ -21,28 +21,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public User id(Long id) { @@ -56,6 +48,7 @@ public class User { */ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") public Long getId() { return id; } @@ -75,6 +68,7 @@ public class User { */ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("username") public String getUsername() { return username; } @@ -94,6 +88,7 @@ public class User { */ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -113,6 +108,7 @@ public class User { */ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -132,6 +128,7 @@ public class User { */ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") public String getEmail() { return email; } @@ -151,6 +148,7 @@ public class User { */ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("password") public String getPassword() { return password; } @@ -170,6 +168,7 @@ public class User { */ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("phone") public String getPhone() { return phone; } @@ -189,6 +188,7 @@ public class User { */ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java index b13481f3fcd..77160243ee2 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java @@ -24,101 +24,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") 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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; @@ -131,6 +102,7 @@ public class XmlItem { */ @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -150,6 +122,7 @@ public class XmlItem { */ @Valid @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -169,6 +142,7 @@ public class XmlItem { */ @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -188,6 +162,7 @@ public class XmlItem { */ @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,6 +190,7 @@ public class XmlItem { */ @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -234,6 +210,7 @@ public class XmlItem { */ @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -253,6 +230,7 @@ public class XmlItem { */ @Valid @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -272,6 +250,7 @@ public class XmlItem { */ @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -291,6 +270,7 @@ public class XmlItem { */ @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -318,6 +298,7 @@ public class XmlItem { */ @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -345,6 +326,7 @@ public class XmlItem { */ @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -364,6 +346,7 @@ public class XmlItem { */ @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -383,6 +366,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -402,6 +386,7 @@ public class XmlItem { */ @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -421,6 +406,7 @@ public class XmlItem { */ @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -448,6 +434,7 @@ public class XmlItem { */ @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -475,6 +462,7 @@ public class XmlItem { */ @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -494,6 +482,7 @@ public class XmlItem { */ @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -513,6 +502,7 @@ public class XmlItem { */ @Valid @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -532,6 +522,7 @@ public class XmlItem { */ @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -551,6 +542,7 @@ public class XmlItem { */ @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -578,6 +570,7 @@ public class XmlItem { */ @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -605,6 +598,7 @@ public class XmlItem { */ @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -624,6 +618,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -643,6 +638,7 @@ public class XmlItem { */ @Valid @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -662,6 +658,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -681,6 +678,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -708,6 +706,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -735,6 +734,7 @@ public class XmlItem { */ @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml index 658d8a96b30..260abafd6ea 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1865,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2103,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2198,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2333,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index c8573ea8e66..1a5080e6434 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -39,6 +39,7 @@ src/main/java/org/openapitools/model/CatDto.java src/main/java/org/openapitools/model/CategoryDto.java src/main/java/org/openapitools/model/ClassModelDto.java src/main/java/org/openapitools/model/ClientDto.java +src/main/java/org/openapitools/model/ContainerDefaultValueDto.java src/main/java/org/openapitools/model/DogAllOfDto.java src/main/java/org/openapitools/model/DogDto.java src/main/java/org/openapitools/model/EnumArraysDto.java @@ -59,6 +60,7 @@ src/main/java/org/openapitools/model/OuterCompositeDto.java src/main/java/org/openapitools/model/OuterEnumDto.java src/main/java/org/openapitools/model/PetDto.java src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java src/main/java/org/openapitools/model/ReturnDto.java src/main/java/org/openapitools/model/SpecialModelNameDto.java src/main/java/org/openapitools/model/TagDto.java 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 4e7225e6c6a..dd7e7a83c84 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 @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 ebd54f6e538..46d738f47b1 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 @@ -14,6 +14,7 @@ import java.time.LocalDate; import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto; import org.openapitools.model.UserDto; import org.openapitools.model.XmlItemDto; import io.swagger.annotations.*; @@ -45,7 +46,7 @@ public interface FakeApi { * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem * - * @param xmlItem XmlItem Body (required) + * @param xmlItemDto XmlItem Body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -63,7 +64,7 @@ public interface FakeApi { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) default ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItem + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItemDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,7 +91,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +106,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerCompositeDto Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +122,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterCompositeDto body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterCompositeDto outerCompositeDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +162,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +193,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -199,11 +204,49 @@ public interface FakeApi { } + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "", + nickname = "responseObjectDifferentNames", + notes = "", + response = ResponseObjectWithDifferentFieldNamesDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNamesDto.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = "/fake/{petId}/response-object-different-names", + produces = { "application/json" } + ) + default ResponseEntity responseObjectDifferentNames( + @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"UPPER_CASE_PROPERTY_SNAKE\" : \"UPPER_CASE_PROPERTY_SNAKE\", \"lower-case-property-dashes\" : \"lower-case-property-dashes\", \"property name with spaces\" : \"property name with spaces\", \"normalPropertyName\" : \"normalPropertyName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClassDto (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +264,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClassDto body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +275,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param userDto (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +294,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody UserDto body + @ApiParam(value = "", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +305,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +325,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +486,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +506,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +515,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +549,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +569,6 @@ public interface FakeApi { ) 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 @@ -537,6 +580,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java index 832b3bbf29f..ad3ca0f55b6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java @@ -9,6 +9,7 @@ import java.time.LocalDate; import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto; import org.openapitools.model.UserDto; import org.openapitools.model.XmlItemDto; 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 bfb9d3a25c6..e78e13011a1 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 @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 3aea82310bb..6ac7757b9e9 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 @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -267,8 +269,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -298,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -345,6 +349,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) 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 95ac4fd02b6..8d3762eefd9 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 @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param orderDto order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { 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 70271a77435..e7ab6f8b530 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 @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param userDto Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody UserDto body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param userDto List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param userDto List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param userDto Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody UserDto body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index 4ae78f07714..a6ba7205ba7 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyTypeDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesAnyTypeDto name(String name) { @@ -40,6 +39,7 @@ public class AdditionalPropertiesAnyTypeDto extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index f3a031c68b5..2d3046d2152 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArrayDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesArrayDto name(String name) { @@ -41,6 +40,7 @@ public class AdditionalPropertiesArrayDto extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index e58c2612b57..48df16e5b13 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBooleanDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesBooleanDto name(String name) { @@ -40,6 +39,7 @@ public class AdditionalPropertiesBooleanDto extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 54cc686549a..cce9f53867e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -8,10 +8,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,45 +31,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClassDto { - @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); - @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") private Object anytype1; - @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); - @JsonProperty("anytype_3") private Object anytype3; public AdditionalPropertiesClassDto mapString(Map mapString) { @@ -88,6 +80,7 @@ public class AdditionalPropertiesClassDto { */ @ApiModelProperty(value = "") + @JsonProperty("map_string") public Map getMapString() { return mapString; } @@ -115,6 +108,7 @@ public class AdditionalPropertiesClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; } @@ -142,6 +136,7 @@ public class AdditionalPropertiesClassDto { */ @ApiModelProperty(value = "") + @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; } @@ -169,6 +164,7 @@ public class AdditionalPropertiesClassDto { */ @ApiModelProperty(value = "") + @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; } @@ -196,6 +192,7 @@ public class AdditionalPropertiesClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,6 +220,7 @@ public class AdditionalPropertiesClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -250,6 +248,7 @@ public class AdditionalPropertiesClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_string") public Map> getMapMapString() { return mapMapString; } @@ -277,6 +276,7 @@ public class AdditionalPropertiesClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -296,6 +296,7 @@ public class AdditionalPropertiesClassDto { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_1") public Object getAnytype1() { return anytype1; } @@ -305,7 +306,7 @@ public class AdditionalPropertiesClassDto { } public AdditionalPropertiesClassDto anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -315,11 +316,12 @@ public class AdditionalPropertiesClassDto { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -334,6 +336,7 @@ public class AdditionalPropertiesClassDto { */ @ApiModelProperty(value = "") + @JsonProperty("anytype_3") public Object getAnytype3() { return anytype3; } @@ -360,13 +363,24 @@ public class AdditionalPropertiesClassDto { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index a53cb5d6447..9a288249271 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesIntegerDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesIntegerDto name(String name) { @@ -40,6 +39,7 @@ public class AdditionalPropertiesIntegerDto extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index 7014b116fd5..9623f9828ee 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumberDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesNumberDto name(String name) { @@ -41,6 +40,7 @@ public class AdditionalPropertiesNumberDto extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index 112fc024ae6..513a0177106 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObjectDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesObjectDto name(String name) { @@ -40,6 +39,7 @@ public class AdditionalPropertiesObjectDto extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index c611ccb01c7..239aa573c7a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesStringDto extends HashMap { - @JsonProperty("name") private String name; public AdditionalPropertiesStringDto name(String name) { @@ -40,6 +39,7 @@ public class AdditionalPropertiesStringDto extends HashMap { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java index ac989cfb9c3..37494ffb09a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java @@ -10,9 +10,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.BigCatDto; -import org.openapitools.model.CatDto; -import org.openapitools.model.DogDto; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -40,10 +37,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AnimalDto { - @JsonProperty("className") private String className; - @JsonProperty("color") private String color = "red"; /** @@ -73,6 +68,7 @@ public class AnimalDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("className") public String getClassName() { return className; } @@ -92,6 +88,7 @@ public class AnimalDto { */ @ApiModelProperty(value = "") + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java index b491a360fe1..dcf05a96d97 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -24,13 +24,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ApiResponseDto { - @JsonProperty("code") private Integer code; - @JsonProperty("type") private String type; - @JsonProperty("message") private String message; public ApiResponseDto code(Integer code) { @@ -44,6 +41,7 @@ public class ApiResponseDto { */ @ApiModelProperty(value = "") + @JsonProperty("code") public Integer getCode() { return code; } @@ -63,6 +61,7 @@ public class ApiResponseDto { */ @ApiModelProperty(value = "") + @JsonProperty("type") public String getType() { return type; } @@ -82,6 +81,7 @@ public class ApiResponseDto { */ @ApiModelProperty(value = "") + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 2424bb2cf10..f822315149c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -27,9 +27,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnlyDto { - @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber; public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -50,6 +49,7 @@ public class ArrayOfArrayOfNumberOnlyDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 558810f5c49..036ce227947 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -27,9 +27,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnlyDto { - @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber; public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -50,6 +49,7 @@ public class ArrayOfNumberOnlyDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java index 179d5c1979e..45768a4fb3f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -27,17 +27,14 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTestDto { - @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString; - @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger; - @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel; public ArrayTestDto arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -58,6 +55,7 @@ public class ArrayTestDto { */ @ApiModelProperty(value = "") + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -85,6 +83,7 @@ public class ArrayTestDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -112,6 +111,7 @@ public class ArrayTestDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java index 5b7c1bd8094..546ab564a99 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java @@ -64,7 +64,6 @@ public class BigCatAllOfDto { } } - @JsonProperty("kind") private KindEnum kind; public BigCatAllOfDto kind(KindEnum kind) { @@ -78,6 +77,7 @@ public class BigCatAllOfDto { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java index dd08693ca40..5cf349a5334 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java @@ -69,7 +69,6 @@ public class BigCatDto extends CatDto { } } - @JsonProperty("kind") private KindEnum kind; /** @@ -99,6 +98,7 @@ public class BigCatDto extends CatDto { */ @ApiModelProperty(value = "") + @JsonProperty("kind") public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java index 404b2b016e5..0d9f693f54e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -24,22 +24,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CapitalizationDto { - @JsonProperty("smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") private String ATT_NAME; public CapitalizationDto smallCamel(String smallCamel) { @@ -53,6 +47,7 @@ public class CapitalizationDto { */ @ApiModelProperty(value = "") + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -72,6 +67,7 @@ public class CapitalizationDto { */ @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -91,6 +87,7 @@ public class CapitalizationDto { */ @ApiModelProperty(value = "") + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -110,6 +107,7 @@ public class CapitalizationDto { */ @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -129,6 +127,7 @@ public class CapitalizationDto { */ @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -148,6 +147,7 @@ public class CapitalizationDto { */ @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java index 1fc610ad6cb..5381c543ba3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOfDto { - @JsonProperty("declawed") private Boolean declawed; public CatAllOfDto declawed(Boolean declawed) { @@ -38,6 +37,7 @@ public class CatAllOfDto { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java index a990352b607..57665355b04 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java @@ -11,7 +11,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.AnimalDto; -import org.openapitools.model.BigCatDto; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -37,7 +36,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatDto extends AnimalDto { - @JsonProperty("declawed") private Boolean declawed; /** @@ -67,6 +65,7 @@ public class CatDto extends AnimalDto { */ @ApiModelProperty(value = "") + @JsonProperty("declawed") public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java index 557df9bb685..3c3b3abd47a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CategoryDto { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name = "default-name"; /** @@ -57,6 +55,7 @@ public class CategoryDto { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -76,6 +75,7 @@ public class CategoryDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java index e82763d08e6..d25c1804dbc 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModelDto { - @JsonProperty("_class") private String propertyClass; public ClassModelDto propertyClass(String propertyClass) { @@ -39,6 +38,7 @@ public class ClassModelDto { */ @ApiModelProperty(value = "") + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java index 469d640a365..12821380779 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClientDto { - @JsonProperty("client") private String client; public ClientDto client(String client) { @@ -38,6 +37,7 @@ public class ClientDto { */ @ApiModelProperty(value = "") + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java new file mode 100644 index 00000000000..b7c7f4e573d --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -0,0 +1,227 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValueDto + */ + +@JsonTypeName("ContainerDefaultValue") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValueDto { + + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @Valid + private List requiredArray = new ArrayList<>(); + + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValueDto#ContainerDefaultValueDto(List, List)} + */ + @Deprecated + public ContainerDefaultValueDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValueDto(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValueDto nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValueDto nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValueDto requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValueDto addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValueDto nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValueDto containerDefaultValue = (ContainerDefaultValueDto) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValueDto {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java index e2855024947..d855ccb5e82 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOfDto { - @JsonProperty("breed") private String breed; public DogAllOfDto breed(String breed) { @@ -38,6 +37,7 @@ public class DogAllOfDto { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java index 44649549f19..c5aa58ba072 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java @@ -29,7 +29,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogDto extends AnimalDto { - @JsonProperty("breed") private String breed; /** @@ -59,6 +58,7 @@ public class DogDto extends AnimalDto { */ @ApiModelProperty(value = "") + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java index ef02dec9464..faf57f8317b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -62,7 +62,6 @@ public class EnumArraysDto { } } - @JsonProperty("just_symbol") private JustSymbolEnum justSymbol; /** @@ -100,9 +99,8 @@ public class EnumArraysDto { } } - @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum; public EnumArraysDto justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -115,6 +113,7 @@ public class EnumArraysDto { */ @ApiModelProperty(value = "") + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -142,6 +141,7 @@ public class EnumArraysDto { */ @ApiModelProperty(value = "") + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java index ddf3979b7b2..569cba845e8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java @@ -63,7 +63,6 @@ public class EnumTestDto { } } - @JsonProperty("enum_string") private EnumStringEnum enumString; /** @@ -103,7 +102,6 @@ public class EnumTestDto { } } - @JsonProperty("enum_string_required") private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +139,6 @@ public class EnumTestDto { } } - @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger; /** @@ -179,10 +176,8 @@ public class EnumTestDto { } } - @JsonProperty("enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") private OuterEnumDto outerEnum; /** @@ -212,6 +207,7 @@ public class EnumTestDto { */ @ApiModelProperty(value = "") + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -231,6 +227,7 @@ public class EnumTestDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -250,6 +247,7 @@ public class EnumTestDto { */ @ApiModelProperty(value = "") + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -269,6 +267,7 @@ public class EnumTestDto { */ @ApiModelProperty(value = "") + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -288,6 +287,7 @@ public class EnumTestDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("outerEnum") public OuterEnumDto getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java index 380a2a9a77e..09f0cb543a3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileDto { - @JsonProperty("sourceURI") private String sourceURI; public FileDto sourceURI(String sourceURI) { @@ -39,6 +38,7 @@ public class FileDto { */ @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") public String getSourceURI() { return sourceURI; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index 3df831dd0d1..20934ecff64 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -27,12 +27,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClassDto { - @JsonProperty("file") private FileDto file; - @JsonProperty("files") @Valid - private List<@Valid FileDto> files = null; + private List<@Valid FileDto> files; public FileSchemaTestClassDto file(FileDto file) { this.file = file; @@ -45,6 +43,7 @@ public class FileSchemaTestClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("file") public FileDto getFile() { return file; } @@ -72,6 +71,7 @@ public class FileSchemaTestClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("files") public List<@Valid FileDto> getFiles() { return files; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java index 9958d734539..2a12fb9c44b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java @@ -30,48 +30,34 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTestDto { - @JsonProperty("integer") private Integer integer; - @JsonProperty("int32") private Integer int32; - @JsonProperty("int64") private Long int64; - @JsonProperty("number") private BigDecimal number; - @JsonProperty("float") private Float _float; - @JsonProperty("double") private Double _double; - @JsonProperty("string") private String string; - @JsonProperty("byte") private byte[] _byte; - @JsonProperty("binary") private org.springframework.core.io.Resource binary; - @JsonProperty("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("password") private String password; - @JsonProperty("BigDecimal") private BigDecimal bigDecimal; /** @@ -106,6 +92,7 @@ public class FormatTestDto { */ @Min(10) @Max(100) @ApiModelProperty(value = "") + @JsonProperty("integer") public Integer getInteger() { return integer; } @@ -127,6 +114,7 @@ public class FormatTestDto { */ @Min(20) @Max(200) @ApiModelProperty(value = "") + @JsonProperty("int32") public Integer getInt32() { return int32; } @@ -146,6 +134,7 @@ public class FormatTestDto { */ @ApiModelProperty(value = "") + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -167,6 +156,7 @@ public class FormatTestDto { */ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @JsonProperty("number") public BigDecimal getNumber() { return number; } @@ -188,6 +178,7 @@ public class FormatTestDto { */ @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @JsonProperty("float") public Float getFloat() { return _float; } @@ -209,6 +200,7 @@ public class FormatTestDto { */ @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @JsonProperty("double") public Double getDouble() { return _double; } @@ -228,6 +220,7 @@ public class FormatTestDto { */ @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") + @JsonProperty("string") public String getString() { return string; } @@ -247,6 +240,7 @@ public class FormatTestDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") public byte[] getByte() { return _byte; } @@ -266,6 +260,7 @@ public class FormatTestDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("binary") public org.springframework.core.io.Resource getBinary() { return binary; } @@ -285,6 +280,7 @@ public class FormatTestDto { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("date") public LocalDate getDate() { return date; } @@ -304,6 +300,7 @@ public class FormatTestDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -323,6 +320,7 @@ public class FormatTestDto { */ @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -342,6 +340,7 @@ public class FormatTestDto { */ @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -361,6 +360,7 @@ public class FormatTestDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index 2b8b8181dd2..4911ed09bf3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnlyDto { - @JsonProperty("bar") private String bar; - @JsonProperty("foo") private String foo; public HasOnlyReadOnlyDto bar(String bar) { @@ -41,6 +39,7 @@ public class HasOnlyReadOnlyDto { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class HasOnlyReadOnlyDto { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java index b62ae7e5cb0..915c901ea75 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ListDto { - @JsonProperty("123-list") private String _123List; public ListDto _123List(String _123List) { @@ -38,6 +37,7 @@ public class ListDto { */ @ApiModelProperty(value = "") + @JsonProperty("123-list") public String get123List() { return _123List; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java index 2d47fa769e0..6d74ef6517e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java @@ -27,9 +27,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTestDto { - @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,17 +65,14 @@ public class MapTestDto { } } - @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTestDto mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -97,6 +93,7 @@ public class MapTestDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -124,6 +121,7 @@ public class MapTestDto { */ @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } @@ -151,6 +149,7 @@ public class MapTestDto { */ @ApiModelProperty(value = "") + @JsonProperty("direct_map") public Map getDirectMap() { return directMap; } @@ -178,6 +177,7 @@ public class MapTestDto { */ @ApiModelProperty(value = "") + @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index d105480477d..3640ff771d1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -30,16 +30,13 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClassDto { - @JsonProperty("uuid") private UUID uuid; - @JsonProperty("dateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClassDto uuid(UUID uuid) { this.uuid = uuid; @@ -52,6 +49,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -71,6 +69,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("dateTime") public OffsetDateTime getDateTime() { return dateTime; } @@ -98,6 +97,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java index 88f61f6732c..6a9cd2b5ef2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -25,10 +25,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200ResponseDto { - @JsonProperty("name") private Integer name; - @JsonProperty("class") private String propertyClass; public Model200ResponseDto name(Integer name) { @@ -42,6 +40,7 @@ public class Model200ResponseDto { */ @ApiModelProperty(value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -61,6 +60,7 @@ public class Model200ResponseDto { */ @ApiModelProperty(value = "") + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java index 1428f8ee913..21351e2fced 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java @@ -25,16 +25,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NameDto { - @JsonProperty("name") private Integer name; - @JsonProperty("snake_case") private Integer snakeCase; - @JsonProperty("property") private String property; - @JsonProperty("123Number") private Integer _123Number; /** @@ -64,6 +60,7 @@ public class NameDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("name") public Integer getName() { return name; } @@ -83,6 +80,7 @@ public class NameDto { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -102,6 +100,7 @@ public class NameDto { */ @ApiModelProperty(value = "") + @JsonProperty("property") public String getProperty() { return property; } @@ -121,6 +120,7 @@ public class NameDto { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") public Integer get123Number() { return _123Number; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java index d3ae78d54cb..23b53177c21 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnlyDto { - @JsonProperty("JustNumber") private BigDecimal justNumber; public NumberOnlyDto justNumber(BigDecimal justNumber) { @@ -39,6 +38,7 @@ public class NumberOnlyDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java index 52825dc3d50..05e501b79e4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java @@ -27,16 +27,12 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OrderDto { - @JsonProperty("id") private Long id; - @JsonProperty("petId") private Long petId; - @JsonProperty("quantity") private Integer quantity; - @JsonProperty("shipDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; @@ -77,10 +73,8 @@ public class OrderDto { } } - @JsonProperty("status") private StatusEnum status; - @JsonProperty("complete") private Boolean complete = false; public OrderDto id(Long id) { @@ -94,6 +88,7 @@ public class OrderDto { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -113,6 +108,7 @@ public class OrderDto { */ @ApiModelProperty(value = "") + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -132,6 +128,7 @@ public class OrderDto { */ @ApiModelProperty(value = "") + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -151,6 +148,7 @@ public class OrderDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("shipDate") public OffsetDateTime getShipDate() { return shipDate; } @@ -170,6 +168,7 @@ public class OrderDto { */ @ApiModelProperty(value = "Order Status") + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -189,6 +188,7 @@ public class OrderDto { */ @ApiModelProperty(value = "") + @JsonProperty("complete") public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java index e7d74089cb2..68c1e7f760d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -25,13 +25,10 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterCompositeDto { - @JsonProperty("my_number") private BigDecimal myNumber; - @JsonProperty("my_string") private String myString; - @JsonProperty("my_boolean") private Boolean myBoolean; public OuterCompositeDto myNumber(BigDecimal myNumber) { @@ -45,6 +42,7 @@ public class OuterCompositeDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -64,6 +62,7 @@ public class OuterCompositeDto { */ @ApiModelProperty(value = "") + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -83,6 +82,7 @@ public class OuterCompositeDto { */ @ApiModelProperty(value = "") + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java index 2a8f59a30af..88d38a4e503 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -32,22 +32,17 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class PetDto { - @JsonProperty("id") private Long id; - @JsonProperty("category") private CategoryDto category; - @JsonProperty("name") private String name; - @JsonProperty("photoUrls") @Valid private Set photoUrls = new LinkedHashSet<>(); - @JsonProperty("tags") @Valid - private List<@Valid TagDto> tags = null; + private List<@Valid TagDto> tags; /** * pet status in the store @@ -86,7 +81,6 @@ public class PetDto { } } - @JsonProperty("status") private StatusEnum status; /** @@ -117,6 +111,7 @@ public class PetDto { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -136,6 +131,7 @@ public class PetDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("category") public CategoryDto getCategory() { return category; } @@ -155,6 +151,7 @@ public class PetDto { */ @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") public String getName() { return name; } @@ -169,6 +166,9 @@ public class PetDto { } public PetDto addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } @@ -179,6 +179,7 @@ public class PetDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; } @@ -207,6 +208,7 @@ public class PetDto { */ @Valid @ApiModelProperty(value = "") + @JsonProperty("tags") public List<@Valid TagDto> getTags() { return tags; } @@ -226,6 +228,7 @@ public class PetDto { */ @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index 9d60f0b4f2e..5112782b229 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirstDto { - @JsonProperty("bar") private String bar; - @JsonProperty("baz") private String baz; public ReadOnlyFirstDto bar(String bar) { @@ -41,6 +39,7 @@ public class ReadOnlyFirstDto { */ @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") public String getBar() { return bar; } @@ -60,6 +59,7 @@ public class ReadOnlyFirstDto { */ @ApiModelProperty(value = "") + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java new file mode 100644 index 00000000000..3276113a5c9 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java @@ -0,0 +1,158 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNamesDto + */ + +@JsonTypeName("ResponseObjectWithDifferentFieldNames") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ResponseObjectWithDifferentFieldNamesDto { + + private String normalPropertyName; + + private String UPPER_CASE_PROPERTY_SNAKE; + + private String lowerCasePropertyDashes; + + private String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("normalPropertyName") + public String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNamesDto UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @ApiModelProperty(value = "") + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNamesDto lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @ApiModelProperty(value = "") + @JsonProperty("lower-case-property-dashes") + public String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNamesDto propertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @ApiModelProperty(value = "") + @JsonProperty("property name with spaces") + public String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNamesDto responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNamesDto) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNamesDto {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java index 44c776f01c1..033daa6a180 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReturnDto { - @JsonProperty("return") private Integer _return; public ReturnDto _return(Integer _return) { @@ -39,6 +38,7 @@ public class ReturnDto { */ @ApiModelProperty(value = "") + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 0214f949034..35c91451a26 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -20,11 +20,10 @@ import javax.annotation.Generated; * SpecialModelNameDto */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelNameDto { - @JsonProperty("$special[property.name]") private Long $SpecialPropertyName; public SpecialModelNameDto $SpecialPropertyName(Long $SpecialPropertyName) { @@ -38,6 +37,7 @@ public class SpecialModelNameDto { */ @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { return $SpecialPropertyName; } @@ -54,8 +54,8 @@ public class SpecialModelNameDto { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelNameDto $SpecialModelName = (SpecialModelNameDto) o; - return Objects.equals(this.$SpecialPropertyName, $SpecialModelName.$SpecialPropertyName); + SpecialModelNameDto specialModelName = (SpecialModelNameDto) o; + return Objects.equals(this.$SpecialPropertyName, specialModelName.$SpecialPropertyName); } @Override diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java index 073b54c2b98..18f25a44044 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java @@ -24,10 +24,8 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TagDto { - @JsonProperty("id") private Long id; - @JsonProperty("name") private String name; public TagDto id(Long id) { @@ -41,6 +39,7 @@ public class TagDto { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -60,6 +59,7 @@ public class TagDto { */ @ApiModelProperty(value = "") + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 33a4f10606c..ef1a9c240ee 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -27,21 +27,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefaultDto { - @JsonProperty("string_item") private String stringItem = "what"; - @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); - @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; - @JsonProperty("bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -74,6 +69,7 @@ public class TypeHolderDefaultDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -93,6 +89,7 @@ public class TypeHolderDefaultDto { */ @NotNull @Valid @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -112,6 +109,7 @@ public class TypeHolderDefaultDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -131,6 +129,7 @@ public class TypeHolderDefaultDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -145,6 +144,9 @@ public class TypeHolderDefaultDto { } public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } @@ -155,6 +157,7 @@ public class TypeHolderDefaultDto { */ @NotNull @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 396dab179f4..c4eb4d96721 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -27,22 +27,16 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExampleDto { - @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") @Valid private List arrayItem = new ArrayList<>(); @@ -78,6 +72,7 @@ public class TypeHolderExampleDto { */ @NotNull @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") public String getStringItem() { return stringItem; } @@ -97,6 +92,7 @@ public class TypeHolderExampleDto { */ @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; } @@ -116,6 +112,7 @@ public class TypeHolderExampleDto { */ @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") public Float getFloatItem() { return floatItem; } @@ -135,6 +132,7 @@ public class TypeHolderExampleDto { */ @NotNull @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; } @@ -154,6 +152,7 @@ public class TypeHolderExampleDto { */ @NotNull @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; } @@ -168,6 +167,9 @@ public class TypeHolderExampleDto { } public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -177,7 +179,8 @@ public class TypeHolderExampleDto { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @JsonProperty("array_item") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java index 43f14f44bff..e8f22138103 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java @@ -24,28 +24,20 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class UserDto { - @JsonProperty("id") private Long id; - @JsonProperty("username") private String username; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("email") private String email; - @JsonProperty("password") private String password; - @JsonProperty("phone") private String phone; - @JsonProperty("userStatus") private Integer userStatus; public UserDto id(Long id) { @@ -59,6 +51,7 @@ public class UserDto { */ @ApiModelProperty(value = "") + @JsonProperty("id") public Long getId() { return id; } @@ -78,6 +71,7 @@ public class UserDto { */ @ApiModelProperty(value = "") + @JsonProperty("username") public String getUsername() { return username; } @@ -97,6 +91,7 @@ public class UserDto { */ @ApiModelProperty(value = "") + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -116,6 +111,7 @@ public class UserDto { */ @ApiModelProperty(value = "") + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -135,6 +131,7 @@ public class UserDto { */ @ApiModelProperty(value = "") + @JsonProperty("email") public String getEmail() { return email; } @@ -154,6 +151,7 @@ public class UserDto { */ @ApiModelProperty(value = "") + @JsonProperty("password") public String getPassword() { return password; } @@ -173,6 +171,7 @@ public class UserDto { */ @ApiModelProperty(value = "") + @JsonProperty("phone") public String getPhone() { return phone; } @@ -192,6 +191,7 @@ public class UserDto { */ @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java index cbc3d3a1aea..10677d46297 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java @@ -27,101 +27,72 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItemDto { - @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") @Valid - private List wrappedArray = null; + private List wrappedArray; - @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") @Valid - private List nameArray = null; + private List nameArray; - @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray; - @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") @Valid - private List prefixArray = null; + private List prefixArray; - @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray; - @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") @Valid - private List namespaceArray = null; + private List namespaceArray; - @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray; - @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") @Valid - private List prefixNsArray = null; + private List prefixNsArray; - @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray; public XmlItemDto attributeString(String attributeString) { this.attributeString = attributeString; @@ -134,6 +105,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; } @@ -153,6 +125,7 @@ public class XmlItemDto { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -172,6 +145,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; } @@ -191,6 +165,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -218,6 +193,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; } @@ -237,6 +213,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") public String getNameString() { return nameString; } @@ -256,6 +233,7 @@ public class XmlItemDto { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") public BigDecimal getNameNumber() { return nameNumber; } @@ -275,6 +253,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; } @@ -294,6 +273,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; } @@ -321,6 +301,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("name_array") public List getNameArray() { return nameArray; } @@ -348,6 +329,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; } @@ -367,6 +349,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; } @@ -386,6 +369,7 @@ public class XmlItemDto { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -405,6 +389,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; } @@ -424,6 +409,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -451,6 +437,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; } @@ -478,6 +465,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -497,6 +485,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; } @@ -516,6 +505,7 @@ public class XmlItemDto { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -535,6 +525,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; } @@ -554,6 +545,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -581,6 +573,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; } @@ -608,6 +601,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -627,6 +621,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; } @@ -646,6 +641,7 @@ public class XmlItemDto { */ @Valid @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -665,6 +661,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -684,6 +681,7 @@ public class XmlItemDto { */ @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -711,6 +709,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; } @@ -738,6 +737,7 @@ public class XmlItemDto { */ @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml index dd15cd15820..2151d60d758 100644 --- a/samples/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: 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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -616,30 +591,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1214,7 +1174,59 @@ paths: x-accepts: application/json x-tags: - tag: pet + /fake/{petId}/response-object-different-names: + get: + operationId: responseObjectDifferentNames + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResponseObjectWithDifferentFieldNames' + description: successful operation + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: Order: example: @@ -1355,6 +1367,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1394,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1419,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1429,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1436,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1497,6 @@ components: 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 @@ -1590,7 +1590,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1602,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1643,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1652,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1660,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1864,13 +1857,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2095,6 +2095,58 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object + ResponseObjectWithDifferentFieldNames: + example: + UPPER_CASE_PROPERTY_SNAKE: UPPER_CASE_PROPERTY_SNAKE + lower-case-property-dashes: lower-case-property-dashes + property name with spaces: property name with spaces + normalPropertyName: normalPropertyName + properties: + normalPropertyName: + type: string + UPPER_CASE_PROPERTY_SNAKE: + type: string + lower-case-property-dashes: + type: string + property name with spaces: + type: string + type: object updatePetWithForm_request: properties: name: @@ -2138,7 +2190,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2274,4 +2325,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index 22a6201fb52..8803682da6c 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -48,6 +48,11 @@ image: "img/companies/logo-askul-01.gif" infoLink: "https://www.askul.co.jp/" pinned: true +- + caption: Amazon Web Services (AWS) + image: "img/companies/aws.png" + infoLink: "https://aws.amazon.com/" + pinned: false - caption: "b<>com" image: "img/companies/b-com.png" @@ -198,6 +203,11 @@ image: "img/companies/fenergo.png" infoLink: "https://www.fenergo.com/" pinned: false +- + caption: "Flipkart" + image: "img/companies/flipkart.png" + infoLink: "https://www.flipkart.com/" + pinned: false - caption: FiNC Technologies image: "img/companies/finc-technologies.png" diff --git a/website/static/img/companies/aws.png b/website/static/img/companies/aws.png new file mode 100644 index 00000000000..4ff85d172c8 Binary files /dev/null and b/website/static/img/companies/aws.png differ diff --git a/website/static/img/companies/flipkart.png b/website/static/img/companies/flipkart.png new file mode 100644 index 00000000000..30801a6be38 Binary files /dev/null and b/website/static/img/companies/flipkart.png differ